diff options
Diffstat (limited to 'lib/bundler/templates/Executable')
-rw-r--r-- | lib/bundler/templates/Executable | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/bundler/templates/Executable b/lib/bundler/templates/Executable index 3e8d5b317a..9ff6f00898 100644 --- a/lib/bundler/templates/Executable +++ b/lib/bundler/templates/Executable @@ -8,14 +8,12 @@ # this file is here to facilitate running it. # -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../<%= relative_gemfile_path %>", - Pathname.new(__FILE__).realpath) +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("<%= relative_gemfile_path %>", __dir__) -bundle_binstub = File.expand_path("../bundle", __FILE__) +bundle_binstub = File.expand_path("bundle", __dir__) if File.file?(bundle_binstub) - if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") load(bundle_binstub) else abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. |