Platinum Partner

Import Your Installed Gems To Your Ruby Enterprise Ed. Gems

// mirrors your Ruby Enterprise gem list to your regular Ruby installed gems


#!/opt/local/bin/ruby

# The command to run for your vanila Ruby 'gem' command
OLD_GEM='gem'
# The command to run for REE's 'gem' command
NEW_GEM='RUBYOPT="" /opt/ruby-enterprise-1.8.6-20080810/bin/gem'

output=`#{OLD_GEM} list`
new_list=`#{NEW_GEM} list`
output.each do |line|
        # Skip lines that don't look like a gem version
        matches=line.match(/([A-Z].+) \(([0-9\., ]+)\)/i)
        if matches then
                gem_name=matches[1]
                versions=matches[2]
                versions.split(', ').each do |ver|
                        cmd="#{NEW_GEM} install #{gem_name} -v #{ver} --no-rdoc --no-ri --backtrace -y" 
                        # See if this gem is already installed
                        if new_list =~ /#{gem_name} \(.*#{ver}.*\)/i then
                                puts "#{gem_name} #{ver} is already installed. Skipping" 
                        else
                                puts cmd
                                system(cmd)
                        end
                end
        end
end
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}