method
generate_standalone_bundler_executable_stubs
Ruby latest stable (v2_5_5)
-
0 notes -
Class: Installer
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3 (0)
- What's this?
generate_standalone_bundler_executable_stubs(spec)
public
Hide source
# File lib/bundler/installer.rb, line 162 def generate_standalone_bundler_executable_stubs(spec) # double-assignment to avoid warnings about variables that will be used by ERB bin_path = Bundler.bin_path unless path = Bundler.settings[:path] raise "Can't standalone without an explicit path set" end standalone_path = Bundler.root.join(path).relative_path_from(bin_path) standalone_path = standalone_path template = File.read(File.expand_path("../templates/Executable.standalone", __FILE__)) ruby_command = Thor::Util.ruby_command ruby_command = ruby_command spec.executables.each do |executable| next if executable == "bundle" executable_path = Pathname(spec.full_gem_path).join(spec.bindir, executable).relative_path_from(bin_path) executable_path = executable_path File.open "#{bin_path}/#{executable}", "w", 0o755 do |f| if RUBY_VERSION >= "2.6" f.puts ERB.new(template, :trim_mode => "-").result(binding) else f.puts ERB.new(template, nil, "-").result(binding) end end end end