Browse files

add minimal support for bundler/Gemfile in setup

  • Loading branch information...
1 parent 9c23f10 commit 9114457d487353a0c16e521284ad164835c64b4e @mpapis mpapis committed Mar 15, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0 lib/shoes/setup.rb
View
13 lib/shoes/setup.rb
@@ -103,6 +103,19 @@ def gem name, version = nil
@steps << [:gem, arg]
end
+ # TODO: add GUI
+ def bundler options = {}
+ bundler_version = options[:version] || Gem::Requirement.default
+ bundler_file = options[:file] || "Gemfile"
+ Gem::Specification.find_by_name( "bundler", bundler_version ).activate
+ rescue Gem::LoadError
+ Gem::DependencyInstaller.new.install("bundler", bundler_version)
+ ensure
+ require 'bundler'
+ require 'bundler/cli'
+ Bundler::CLI.new(:gemfile => bundler_file).install
+ end
+
def source uri
@steps << [:source, uri]
end

0 comments on commit 9114457

Please sign in to comment.