diff options
author | Xavier Noria <fxn@hashref.com> | 2011-05-13 21:34:11 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-05-13 21:34:11 +0200 |
commit | b1ceffd7b224c397d8ba5344b9c1438dd62f8325 (patch) | |
tree | 3e1d47cc8bebd16adb908c174e45dabf764f7864 /railties | |
parent | 2a98fd96aa2cd33be171bca652098253dbf55f8c (diff) | |
download | rails-b1ceffd7b224c397d8ba5344b9c1438dd62f8325.tar.gz rails-b1ceffd7b224c397d8ba5344b9c1438dd62f8325.tar.bz2 rails-b1ceffd7b224c397d8ba5344b9c1438dd62f8325.zip |
run bundler programmatically rather than shelling out
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/app_base.rb | 10 |
1 files changed, 3 insertions, 7 deletions
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 |