Skip to content

Instantly share code, notes, and snippets.

@ayasuda
Created September 28, 2015 12:44
Show Gist options
  • Save ayasuda/4153ab2054a91d428ac2 to your computer and use it in GitHub Desktop.
Save ayasuda/4153ab2054a91d428ac2 to your computer and use it in GitHub Desktop.
手っ取り早く bundle install した rubygems の summary と description を取得する ref: http://qiita.com/ayasuda/items/449b7c0f8f2c9db80710
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