Created
September 28, 2015 12:44
-
-
Save ayasuda/4153ab2054a91d428ac2 to your computer and use it in GitHub Desktop.
手っ取り早く bundle install した rubygems の summary と description を取得する ref: http://qiita.com/ayasuda/items/449b7c0f8f2c9db80710
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
# とりあえず bundle list の結果から、gem の名前だけを取得して配列に突っ込んでみます | |
gems = (`bundle list | awk '{print $2}'`).split("\n") | |
# 先頭2行は bundler の出力なので無視します | |
2.times{ gems.shift } | |
gems.each do |gem| | |
puts gem | |
# 具体的な情報は gem spec GEMFILE で取得します。結果は yaml でくるので、パースしてやります。 | |
puts YAML.load(`bundle exec gem spec #{gem} summary -l`) | |
puts YAML.load(`bundle exec gem spec #{gem} description -l`) | |
puts "--" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment