From b3b3306df7f0bc18004dee35e91b5845417c9424 Mon Sep 17 00:00:00 2001 From: Yuji Nakayama Date: Sun, 28 Dec 2014 01:54:12 +0900 Subject: [PATCH] Remove strange conditional in generate:app task The `bindir` is rspec-rails' one. We want to run `bundle binstubs` in the `tmp/example_app` project so the conditional `if test, 'd', bindir` is useless. --- Rakefile | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/Rakefile b/Rakefile index 1c8b73abaf..6458a79be8 100644 --- a/Rakefile +++ b/Rakefile @@ -29,21 +29,19 @@ namespace :generate do sh "rm -f #{bindir}/rails" sh "bundle exec rails new ./tmp/example_app --skip-javascript --skip-sprockets --skip-git --skip-test-unit --skip-bundle --template=example_app_generator/generate_app.rb" - if test 'd', bindir - in_example_app do - sh "./travis_retry_bundle_install.sh 2>&1" - # Rails 4 cannot use a `rails` binstub generated by Bundler - sh "bundle binstubs rspec-core rake --force" - sh "bundle binstubs railties" unless File.exist?("bin/rails") - - application_file = File.read("config/application.rb") - sh "rm config/application.rb" - File.open("config/application.rb", "w") do |f| - f.write application_file.gsub( - "config.assets.enabled = true", - "config.assets.enabled = false" - ) - end + in_example_app do + sh "./travis_retry_bundle_install.sh 2>&1" + # Rails 4 cannot use a `rails` binstub generated by Bundler + sh "bundle binstubs rspec-core rake --force" + sh "bundle binstubs railties" unless File.exist?("bin/rails") + + application_file = File.read("config/application.rb") + sh "rm config/application.rb" + File.open("config/application.rb", "w") do |f| + f.write application_file.gsub( + "config.assets.enabled = true", + "config.assets.enabled = false" + ) end end end