Skip to content

Commit 5b1f6fa

Browse files
author
David Rodríguez
committed
Don't check for bindir existence
Otherwise it will fail if the directory is not there by default (Rails 3). The folder will be automatically created when creating the binstubs if not already there.
1 parent 0720ecf commit 5b1f6fa

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

Rakefile

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,19 @@ namespace :no_active_record do
151151
sh "rm -f #{bindir}/rails"
152152
sh "bundle exec rails new #{example_app_dir} --skip-active-record --skip-javascript --skip-sprockets --skip-git --skip-test-unit --skip-bundle --template=example_app_generator/generate_app.rb"
153153

154-
if test 'd', bindir
155-
in_example_app(:app_dir => example_app_dir) do
156-
sh "bundle install --gemfile ./Gemfile --path ../../../bundle"
157-
# Rails 4 cannot use a `rails` binstub generated by Bundler
158-
sh "bundle binstubs rspec-core rake --force"
159-
sh "bundle binstubs railties" unless File.exist?("bin/rails")
160-
161-
application_file = File.read("config/application.rb")
162-
sh "rm config/application.rb"
163-
File.open("config/application.rb","w") do |f|
164-
f.write application_file.gsub(
165-
"config.assets.enabled = true",
166-
"config.assets.enabled = false"
167-
)
168-
end
154+
in_example_app(:app_dir => example_app_dir) do
155+
sh "bundle install --gemfile ./Gemfile --path ../../../bundle"
156+
# Rails 4 cannot use a `rails` binstub generated by Bundler
157+
sh "bundle binstubs rspec-core rake --force"
158+
sh "bundle binstubs railties" unless File.exist?("bin/rails")
159+
160+
application_file = File.read("config/application.rb")
161+
sh "rm config/application.rb"
162+
File.open("config/application.rb","w") do |f|
163+
f.write application_file.gsub(
164+
"config.assets.enabled = true",
165+
"config.assets.enabled = false"
166+
)
169167
end
170168
end
171169
end

0 commit comments

Comments
 (0)