Permalink
Browse files

+ install_dependencies.rb

  • Loading branch information...
1 parent 1915b18 commit 7a87acc4a559e4a459757a3992e80eb8e34261e4 @prabirshrestha committed Oct 16, 2010
Showing with 27 additions and 0 deletions.
  1. +27 −0 install_dependencies.rb
View
@@ -0,0 +1,27 @@
+require 'rubygems'
+require 'rubygems/gem_runner'
+require 'rubygems/exceptions'
+
+required_version = Gem::Requirement.new "> 1.8.5"
+
+unless required_version.satisfied_by? Gem.ruby_version then
+ abort "Expected Ruby Version #{required_version}, was #{Gem.ruby_version}"
+end
+
+def install(lib)
+ begin
+ matches = Gem.source_index.find_name(lib)
+ if matches.empty?
+ puts "Installing #{lib}"
+ Gem::GemRunner.new.run ['install', lib]
+ else
+ puts "Found #{lib} gem - skipping"
+ end
+ rescue Gem::SystemExitException => e
+ end
+end
+
+gems = ['rake','net-ssh','net-sftp','rubyzip']
+
+puts "Installing required dependencies"
+gems.each { |gem| install gem}

0 comments on commit 7a87acc

Please sign in to comment.