Rubygems front end?

Does one exist? I wanted to have a look at how one would go about
it. Or to be more specific, I need to make a web interface that I can
use to search the available gems, and list their descriptions and
versions. I can use the normal gem command line to actually install
stuff. But I want to do quick local auto complete searches of
available gems.

Basically all I need is the info that comes from a gem list --

remote. But I want to pull this info every few hours and insert it
into my database so I can use it in my web interface. What would be
the most polite way of doing this as far as rubygems are concerned?
Should I just parse the gem list --remote with regexes? Doesn’t seem
like the way to go really. And is down
right now so I can’t read up on it.

Is there an easier way to do this built into rubygems already? I

suppose my next step will be to just read the source and figure it
out but if anyone has suggestions then please let me know,.


Ezra Z. wrote:

Does one exist?

There is the beginnings of a project at ‘rubyslippers’ on Rubyforge.
[last activity 18 months ago.]

And I thought I had seen something with a ‘native’ GUI [rubyslippers
uses rwd] but I can’t find it…

Also, there was this thread on rubygems-developers -



The Gem.source_index contains a source index object that contains lots
of information on available packages.

Thanks for the responses. I ended up just regexing the gem list –
remote output as it was simple to do. I’ll share here in case someone
else ends up wanting something like this. Here is a rake task that
will pull the gem list and parse it into a hash with he name of the
gem as the key and versions and descriptions as subhashes of the gem
name key. THen it populates a bunch of GemIndex ActiveRecord Objects.

namespace :parsegems do
def parse_gems(gem_list)
last = ‘’
gem_list.each do |line|
case line
when /(\w+)\s+((.?))/
(hsh[$1] ||= {})[:versions]=$2
last = $1
when /\A(\s+\w.
(hsh[last][:desc] ||= ‘’) << ($1+’ ')

desc ‘Gets the gems list --remote and parse it into the app_gems
database table for quick autocomplete.’
task :import => :environment do
hsh = parse_gems(gem list --remote)
hsh.keys.each do |key|
g = GemIndex.find_or_create_by_name(key)
g.update_attributes :versions => hsh[key][:versions],
:description => hsh[key][:desc]
puts “Imported Gem Data for: #{key}”



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs