List Ruby Gem Dependencies Recursively

From Bonus Bits
Jump to: navigation, search

Purpose

This article gives the steps to list all the dependencies of the dependant gems of a Ruby gem in BASH.


Local

for i in $(gem dependency busser); do gem dependency $(echo $i | cut -f1 -d '  '); done | sort | uniq

If using ChefDK embedded Ruby:

for i in $(chef exec gem dependency busser); do chef exec gem dependency $(echo $i | cut -f1 -d '  '); done | sort | uniq


Remote

for i in $(gem dependency busser -r); do gem dependency $(echo $i | cut -f1 -d '  '); done | sort | uniq

If using ChefDK embedded Ruby:

for i in $(chef exec gem dependency busser -r); do chef exec gem dependency $(echo $i | cut -f1 -d '  '); done | sort | uniq


Related Articles