summaryrefslogtreecommitdiff
path: root/lib/bundler/installer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/installer.rb')
-rw-r--r--lib/bundler/installer.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index e08cc9722b..048b0786a7 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require "erb"
require "rubygems/dependency_installer"
require_relative "worker"
require_relative "installer/parallel_installer"
@@ -136,6 +135,7 @@ module Bundler
end
mode = Bundler::WINDOWS ? "wb:UTF-8" : "w"
+ require "erb"
content = if RUBY_VERSION >= "2.6"
ERB.new(template, :trim_mode => "-").result(binding)
else
@@ -143,7 +143,7 @@ module Bundler
end
File.write(binstub_path, content, :mode => mode, :perm => 0o777 & ~File.umask)
- if Bundler::WINDOWS
+ if Bundler::WINDOWS || options[:all_platforms]
prefix = "@ruby -x \"%~f0\" %*\n@exit /b %ERRORLEVEL%\n\n"
File.write("#{binstub_path}.cmd", prefix + content, :mode => mode)
end
@@ -164,7 +164,7 @@ module Bundler
end
end
- def generate_standalone_bundler_executable_stubs(spec)
+ def generate_standalone_bundler_executable_stubs(spec, options = {})
# double-assignment to avoid warnings about variables that will be used by ERB
bin_path = Bundler.bin_path
unless path = Bundler.settings[:path]
@@ -182,6 +182,7 @@ module Bundler
executable_path = executable_path
mode = Bundler::WINDOWS ? "wb:UTF-8" : "w"
+ require "erb"
content = if RUBY_VERSION >= "2.6"
ERB.new(template, :trim_mode => "-").result(binding)
else
@@ -189,7 +190,7 @@ module Bundler
end
File.write("#{bin_path}/#{executable}", content, :mode => mode, :perm => 0o755)
- if Bundler::WINDOWS
+ if Bundler::WINDOWS || options[:all_platforms]
prefix = "@ruby -x \"%~f0\" %*\n@exit /b %ERRORLEVEL%\n\n"
File.write("#{bin_path}/#{executable}.cmd", prefix + content, :mode => mode)
end
@@ -243,6 +244,7 @@ module Bundler
end
end.flatten
Bundler.rubygems.load_plugin_files(path_plugin_files)
+ Bundler.rubygems.load_env_plugins
end
def ensure_specs_are_compatible!
@@ -297,7 +299,7 @@ module Bundler
# returns whether or not a re-resolve was needed
def resolve_if_needed(options)
- if !@definition.unlocking? && !options["force"] && !options["all-platforms"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
+ if !@definition.unlocking? && !options["force"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
return false if @definition.nothing_changed? && !@definition.missing_specs?
end