Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (19 sloc) 645 Bytes
BUNDLER_VERSION="1.0.0"
namespace :bundle do
desc "Install the gems needed according to the Gemfile"
task :expand => :ensure_bundler_available do
system("bundle install")
fail "bundler failed" unless $? == 0
end
task :ensure_bundler_available do
`gem list -i bundler -v '#{BUNDLER_VERSION}'`
unless $? == 0
puts "Installing bundler #{BUNDLER_VERSION}"
system("gem install bundler -v '#{BUNDLER_VERSION}'")
unless $? == 0
fail "Install failed.\nPlease fix the problem and try again or manually install bundler #{BUNDLER_VERSION}."
end
end
end
end
task :default => :'bundle:expand'