method

generate_standalone_bundler_executable_stubs

ruby latest stable - Class: Bundler::Installer

Method not available on this version

This method is only available on newer versions. The first available version (v2_6_3) is shown here.

generate_standalone_bundler_executable_stubs(spec)
public

No documentation available.

# 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