Created
January 17, 2017 15:18
-
-
Save granolocks/c1953581cfc1bfdcab5a0d458710029c to your computer and use it in GitHub Desktop.
print locally installed rubygems
This file contains hidden or 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 'rubygems' | |
| data = Gem::Specification.map do |gemspec| | |
| { | |
| name: gemspec.name, | |
| version: "'#{gemspec.version.to_s}'", | |
| license: gemspec.license, | |
| homepage: gemspec.homepage, | |
| source: "Gem::Specification.each" | |
| } | |
| end | |
| csv = data.first.keys.join(",")+"\n"+data.map{|d| d.values.join(",")}.join("\n")+"\n" | |
| File.write('enum_gems.csv', csv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is the updated version after my tweaks:
The source line does not work though.
Here are the commands that I ran to execute it:
On the server (to loop through containers):
Then paste this for each container: