From ee8d7850fd38b4602dc1d40323addc3448b60947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Sat, 23 Jun 2018 13:27:19 -0300 Subject: Generate bundler-compatible bundler binstub --- railties/lib/rails/generators/app_base.rb | 6 ++++++ railties/lib/rails/generators/rails/app/app_generator.rb | 2 ++ railties/lib/rails/generators/rails/app/templates/bin/bundle.tt | 2 -- 3 files changed, 8 insertions(+), 2 deletions(-) delete mode 100644 railties/lib/rails/generators/rails/app/templates/bin/bundle.tt (limited to 'railties/lib') diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index f51542f3ec..3c5dfb2e92 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -458,6 +458,12 @@ module Rails end end + def generate_bundler_binstub + if bundle_install? + bundle_command("binstubs bundler") + end + end + def generate_spring_binstubs if bundle_install? && spring_install? bundle_command("exec spring binstub --all") diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 34067240d7..cc45a64b25 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -299,6 +299,8 @@ module Rails build(:bin) end + public_task :generate_bundler_binstub + def update_bin_files build(:bin_when_updating) end diff --git a/railties/lib/rails/generators/rails/app/templates/bin/bundle.tt b/railties/lib/rails/generators/rails/app/templates/bin/bundle.tt deleted file mode 100644 index a84f0afe47..0000000000 --- a/railties/lib/rails/generators/rails/app/templates/bin/bundle.tt +++ /dev/null @@ -1,2 +0,0 @@ -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) -load Gem.bin_path('bundler', 'bundle') -- cgit v1.2.3