jnstq (owner)

Revisions

gist: 192255 Download_button fork
public
Public Clone URL: git://gist.github.com/192255.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/ruby
require 'rubygems'
require 'activesupport'
 
gems = <<-EOF
chronic (0.2.3)
classy-inheritance (0.6.2)
elif (0.1.0)
fastercsv (1.5.0)
FiXato-daemons (1.0.10.2)
hpricot
javan-whenever (0.2.2)
mislav-will_paginate (2.3.11, 2.3.4, 2.3.2)
newrelic_rpm
rcov (0.8.1.2.0)
rmagick (2.5.2)
rspec (1.2.7, 1.1.12)
rspec-rails (1.2.7.1, 1.1.12)
rubyzip (0.9.1)
sequel (2.12.0)
unicode (0.1)
EOF
 
gems.each_line do |line|
  gem_name = $1 if line =~ /^([^\s]+)/
  gem_version = $1.split(', ').first.to_s.strip if line =~ /\((.*?)\)$/
  gem_version_cmd = "--version #{gem_version}" if gem_version.present?
  puts "sudo /opt/ruby/bin/ruby /opt/ruby/bin/gem install #{gem_name} #{gem_version_cmd}"
end