diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2014-01-02 10:06:29 +0000 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2014-01-02 10:06:29 +0000 |
commit | a1d0c0fa3d8ca97edc8f2a1d6ba96af19221dbad (patch) | |
tree | 18f0a94c84db446090a00c355b7b4dc6b082f825 | |
parent | 02d366842ccba9a221cb7cfd506cc9ee150a6760 (diff) | |
download | rails-a1d0c0fa3d8ca97edc8f2a1d6ba96af19221dbad.tar.gz rails-a1d0c0fa3d8ca97edc8f2a1d6ba96af19221dbad.tar.bz2 rails-a1d0c0fa3d8ca97edc8f2a1d6ba96af19221dbad.zip |
Reverse 821525e and wrap run_generator call
Ruby 2.1.0 includes the json gem 1.8.1 by default so we need bundler 1.5.1
for `bundle install` to work. To fix this reverse the downgrade to 1.3.5
and wrap the `run_generator` call with a block that resets `THOR_DEBUG`.
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/testing/behaviour.rb | 16 |
2 files changed, 14 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml index 559f981de8..3ddaf86fb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ script: 'ci/travis.rb' before_install: - - travis_retry gem install bundler -v 1.3.5 + - travis_retry gem install bundler - "rvm current | grep 'jruby' && export AR_JDBC=true || echo" rvm: - 1.9.3 diff --git a/railties/lib/rails/generators/testing/behaviour.rb b/railties/lib/rails/generators/testing/behaviour.rb index 7576eba6e0..8e9028a3fb 100644 --- a/railties/lib/rails/generators/testing/behaviour.rb +++ b/railties/lib/rails/generators/testing/behaviour.rb @@ -61,9 +61,11 @@ module Rails # You can provide a configuration hash as second argument. This method returns the output # printed by the generator. def run_generator(args=self.default_arguments, config={}) - capture(:stdout) do - args += ['--skip-bundle'] unless args.include? '--dev' - self.generator_class.start(args, config.reverse_merge(destination_root: destination_root)) + without_thor_debug do + capture(:stdout) do + args += ['--skip-bundle'] unless args.include? '--dev' + self.generator_class.start(args, config.reverse_merge(destination_root: destination_root)) + end end end @@ -100,6 +102,14 @@ module Rails dirname, file_name = File.dirname(absolute), File.basename(absolute).sub(/\.rb$/, '') Dir.glob("#{dirname}/[0-9]*_*.rb").grep(/\d+_#{file_name}.rb$/).first end + + # TODO: remove this once Bundler 1.5.2 is released + def without_thor_debug # :nodoc: + thor_debug, ENV['THOR_DEBUG'] = ENV['THOR_DEBUG'], nil + yield + ensure + ENV['THOR_DEBUG'] = thor_debug + end end end end |