Skip to content

Instantly share code, notes, and snippets.

@indirect
Created July 31, 2014 03:43
Show Gist options
  • Save indirect/c4c9f7fd34b08a8804e5 to your computer and use it in GitHub Desktop.
Save indirect/c4c9f7fd34b08a8804e5 to your computer and use it in GitHub Desktop.
Get list of all gem names from Rubygems
$ gem list --verbose -r
*** REMOTE GEMS ***
GET https://api.rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
GET https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
^CERROR: Interrupted
$ curl -O https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 632k 100 632k 0 0 261k 0 0:00:02 0:00:02 --:--:-- 262k
$ ungzip latest_specs.4.8.gz
$ irb
irb(main):001:0> gems=Marshal.load File.read("latest_specs.4.8");gems.first
=> ["_", #<Gem::Version "1.2">, "ruby"]
irb(main):002:0> gems[0..10].map{|g| g.first }
=> ["_", "-", "0mq", "0xffffff", "1234567890_", "12_hour_time", "189seg", "1_as_identity_function", "1pass", "24games", "24point"]
irb(main):003:0> gems.count
=> 79071
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment