/ Published in: Ruby
URL: http://rake.rubyforge.org/files/doc/rakefile_rdoc.html
Rails has a task like this, but I couldn't locate it, and it wasn't hard to write my own, and mine worked too :|
Expand |
Embed | Plain Text
desc 'check for gem dependencies and install any missing gems' task :gems do required_gems = %w{ cucumber mechanize raakt rspec } gem_list = %x{gem list} # check gem sources and only add github if its not already there if ((%x{gem sources} =~ %r{http://gems.github.com})).nil? puts %x{gem sources -a http://gems.github.com} end required_gems.each do | gem_name | if (gem_list=~ %r{#{gem_name}}).nil? puts %x{gem install #{gem_name}} end end end
You need to login to post a comment.
