Skip to content

Commit

Permalink
Remove strange conditional in generate:app task
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yujinakayama committed Dec 27, 2014
1 parent 440815a commit b3b3306
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions Rakefile
Expand Up @@ -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
Expand Down

0 comments on commit b3b3306

Please sign in to comment.