From b1ceffd7b224c397d8ba5344b9c1438dd62f8325 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Fri, 13 May 2011 21:34:11 +0200 Subject: run bundler programmatically rather than shelling out --- railties/lib/rails/generators/app_base.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 3b0791a453..40e8f39201 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -5,6 +5,8 @@ require 'rails/version' unless defined?(Rails::VERSION) require 'rbconfig' require 'open-uri' require 'uri' +require 'bundler' +require 'bundler/cli' module Rails module Generators @@ -186,13 +188,7 @@ module Rails def bundle_command(command) say_status :run, "bundle #{command}" - - # We use backticks and #print here instead of vanilla #system because it - # is easier to silence stdout in the existing test suite this way. The - # end-user gets the bundler commands called anyway. - # - # Thanks to James Tucker for the Gem tricks involved in this call. - print `"#{Gem.ruby}" -rubygems "#{Gem.bin_path('bundler', 'bundle')}" #{command}` + Bundler::CLI.new.send(command) end def run_bundle -- cgit v1.2.3