tag:help.rubygems.org,2010-01-19:/discussions/questions/20-metadata-for-all-gems-in-yaml-available-anymoreRubyGems.org: Discussion 2018-10-18T19:50:54Ztag:help.rubygems.org,2010-01-19:Comment/15344242010-04-25T17:06:09Z2010-04-25T17:06:09Zmetadata for all gems in YAML available anymore?<div><p>Yeah, right now the only index supported is the old Marshal
index, at</p>
<p><a href=
"http://rubygems.org/Marshal.4.8.Z">http://rubygems.org/Marshal.4.8.Z</a></p>
<p>which is updated nightly. A little code sample of how to use
it:</p>
<pre>
<code>chef % irb -rubygems -ropen-uri
irb(main):003:0> gems = Marshal.load(Gem.inflate(open("http://rubygems.org/Marshal.4.8.Z").read)); nil
=> nil
irb(main):004:0> gems.size
=> 55891
irb(main):005:0> gems.first
=> ["cafepress-search-1.0.0", #<Gem::Specification:0x11fd0dc @licenses=[], @summary="A client library for the Cafepress search API that allows you to search for designs and products on Cafepress.com", @post_install_message=nil, @description="A client library for the Cafepress search API that allows you to search for\ndesigns and products on Cafepress.com", @dependencies=[<Gem::Dependency type=:runtime name="0.3.0" requirements=">= 0">, <Gem::Dependency type=:runtime name="happymapper" requirements=">= 0">, <Gem::Dependency type=:runtime name="hoe" requirements=">= 2.3.1">], @requirements=[], @bindir="bin", @require_paths=["lib"], @date=Thu Dec 17 00:00:00 -0500 2009, @name="cafepress-search", @new_platform="ruby", @loaded=false, @extensions=[], @authors=["Britt Crawford", "Dimple Joseph"], @cert_chain=[], @required_rubygems_version=#<Gem::Requirement:0x1200534 @requirements=[[">=", #<Gem::Version "0">]]>, @loaded_from=nil, @has_rdoc=true, @specification_version=3, @original_platform=nil, @version=#<Gem::Version "1.0.0">, @license=[], @extra_rdoc_files=[], @files=[], @signing_key=nil, @default_executable=nil, @email=nil, @test_files=[], @required_ruby_version=#<Gem::Requirement:0x1200624 @requirements=[[">=", #<Gem::Version "0">]]>, @rdoc_options=[], @rubygems_version="1.3.5", @homepage=nil, @executables=[], @platform="ruby", @autorequire=nil, @rubyforge_project=nil>]</code>
</pre>
<p>If there's ways we can extend our API to help with this task you
have, please let me know...definitely one of the goals of Gemcutter
going forward is building out the API to better support developers
and the RubyGems ecosystem as a whole, I'm sure you won't be the
only one who finds it useful. If the source for this tool of yours
is available I'd love to check it out.</p></div>Nick Quarantotag:help.rubygems.org,2010-01-19:Comment/15344242010-04-25T17:49:55Z2010-04-25T17:49:56Zmetadata for all gems in YAML available anymore?<div><p>Oh, thanks -- that's exactly what I was looking for!</p>
<p>My little search tool is pretty slap-dash and quickly assembled
-- I don't have it up online anywhere right now, though I suppose
if you'd really like to see it I can copy and paste. Basically, I
have a very simple SQLite3 database set up to house metadata for
various ruby-oriented command line tools I use often like rubygems
and cheat. I have a cron job that fetches gem info from this site
and the other main gem sources -- chiefly github -- and stuffs it
into a flat table every few days or so. I use SQLite's built in
full text search feature to index it and then I have a very minimal
command line script to search the database against name,
description, and summary fields. Then the script formats it cleanly
for console usage and it works really quickly since it uses the
database instead of combing through a list of objects.</p>
<p>With regard to your API, I'm not sure that I'd suggest anything
specifically, as you have basic search functionality built in
already, I believe? The reason I wrote my own little tool is
because sometimes I'm working and some random need will come up.
Earlier today I thought "what was that encoding detection package I
had a while ago?" because I had some screwy text encoding issues
while trying to fix tags in some mp3s. It's just quicker to search
all my sources for the word "detection" and see that it was
"chardet" than to open up a web browser. Also, perhaps it's changed
in recent versions, but I think the gems program only queries names
and versions, no?</p>
<p>Thanks for the link</p></div>Kyle