1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Merge bundler-2.2.0.rc.2

This commit is contained in:
Hiroshi SHIBATA 2020-10-15 13:20:25 +09:00
parent 7ffd14a18c
commit d386a58f6f
Notes: git 2020-10-15 17:19:31 +09:00
200 changed files with 1058 additions and 3672 deletions

View file

@ -353,7 +353,10 @@ EOF
env.delete_if {|k, _| k[0, 7] == "BUNDLE_" }
if env.key?("RUBYOPT")
env["RUBYOPT"] = env["RUBYOPT"].sub "-rbundler/setup", ""
rubyopt = env["RUBYOPT"].split(" ")
rubyopt.delete("-r#{File.expand_path("bundler/setup", __dir__)}")
rubyopt.delete("-rbundler/setup")
env["RUBYOPT"] = rubyopt.join(" ")
end
if env.key?("RUBYLIB")
@ -453,7 +456,7 @@ EOF
# system binaries. If you put '-n foo' in your .gemrc, RubyGems will
# install binstubs there instead. Unfortunately, RubyGems doesn't expose
# that directory at all, so rather than parse .gemrc ourselves, we allow
# the directory to be set as well, via `bundle config set bindir foo`.
# the directory to be set as well, via `bundle config set --local bindir foo`.
Bundler.settings[:system_bindir] || Bundler.rubygems.gem_bindir
end
@ -621,7 +624,7 @@ EOF
@rubygems = nil
end
private
private
def eval_yaml_gemspec(path, contents)
require_relative "bundler/psyched_yaml"

View file

@ -27,19 +27,11 @@ module Bundler
# If Bundler has been installed without its .git directory and without a
# commit instance variable then we can't determine its commits SHA.
git_dir = File.join(File.expand_path("../../..", __FILE__), ".git")
git_dir = File.join(File.expand_path("../../../..", __FILE__), ".git")
if File.directory?(git_dir)
return @git_commit_sha = Dir.chdir(git_dir) { `git rev-parse --short HEAD`.strip.freeze }
end
# If Bundler is a submodule in RubyGems, get the submodule commit
git_sub_dir = File.join(File.expand_path("../../../..", __FILE__), ".git")
if File.directory?(git_sub_dir)
return @git_commit_sha = Dir.chdir(git_sub_dir) do
`git ls-tree --abbrev=8 HEAD bundler`.split(/\s/).fetch(2, "").strip.freeze
end
end
@git_commit_sha ||= "unknown"
end

View file

@ -134,7 +134,7 @@ module Bundler
if Bundler.which("man") && man_path !~ %r{^file:/.+!/META-INF/jruby.home/.+}
Kernel.exec "man #{man_page}"
else
puts File.read("#{File.dirname(man_page)}/#{File.basename(man_page)}.txt")
puts File.read("#{File.dirname(man_page)}/#{File.basename(man_page)}.ronn")
end
elsif command_path = Bundler.which("bundler-#{cli}")
Kernel.exec(command_path, "--help")
@ -439,11 +439,18 @@ module Bundler
Outdated.new(options, gems).run
end
desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
unless Bundler.feature_flag.cache_all?
method_option "all", :type => :boolean,
:banner => "Include all sources (including path and git)."
desc "fund [OPTIONS]", "Lists information about gems seeking funding assistance"
method_option "group", :aliases => "-g", :type => :array, :banner =>
"Fetch funding information for a specific group"
def fund
require_relative "cli/fund"
Fund.new(options).run
end
desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
method_option "all", :type => :boolean,
:default => Bundler.feature_flag.cache_all?,
:banner => "Include all sources (including path and git)."
method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
method_option "cache-path", :type => :string, :banner =>
"Specify a different cache path than the default (vendor/cache)."
@ -462,6 +469,12 @@ module Bundler
bundle without having to download any additional gems.
D
def cache
SharedHelpers.major_deprecation 2,
"The `--all` flag is deprecated because it relies on being " \
"remembered across bundler invocations, which bundler will no longer " \
"do in future versions. Instead please use `bundle config set cache_all true`, " \
"and stop using this flag" if ARGV.include?("--all")
require_relative "cli/cache"
Cache.new(options).run
end
@ -565,18 +578,18 @@ module Bundler
desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
method_option :exe, :type => :boolean, :default => false, :aliases => ["--bin", "-b"], :desc => "Generate a binary executable for your library."
method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config set gem.coc true`."
method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
method_option :edit, :type => :string, :aliases => "-e", :required => false, :banner => "EDITOR",
:lazy_default => [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? },
:desc => "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
method_option :ext, :type => :boolean, :default => false, :desc => "Generate the boilerplate for C extension code"
method_option :git, :type => :boolean, :default => true, :desc => "Initialize a git repo inside your library."
method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set gem.mit true`."
method_option :rubocop, :type => :boolean, :desc => "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set gem.rubocop true`."
method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
method_option :rubocop, :type => :boolean, :desc => "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true`."
method_option :test, :type => :string, :lazy_default => Bundler.settings["gem.test"] || "", :aliases => "-t", :banner => "Use the specified test framework for your library",
:desc => "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set gem.test (rspec|minitest|test-unit)`."
:desc => "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
method_option :ci, :type => :string, :lazy_default => Bundler.settings["gem.ci"] || "",
:desc => "Generate CI configuration, either GitHub Actions, Travis CI, GitLab CI or CircleCI. Set a default with `bundle config set gem.ci (github|travis|gitlab|circle)`"
:desc => "Generate CI configuration, either GitHub Actions, Travis CI, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|travis|gitlab|circle)`"
def gem(name)
end
@ -740,11 +753,11 @@ module Bundler
end
end
private
private
# Automatically invoke `bundle install` and resume if
# Bundler.settings[:auto_install] exists. This is set through config cmd
# `bundle config set auto_install 1`.
# `bundle config set --global auto_install 1`.
#
# Note that this method `nil`s out the global Definition object, so it
# should be called first, before you instantiate anything like an
@ -839,10 +852,10 @@ module Bundler
value = options[name]
value = value.join(" ").to_s if option.type == :array
Bundler::SharedHelpers.major_deprecation 2,\
Bundler::SharedHelpers.major_deprecation 2,
"The `#{flag_name}` flag is deprecated because it relies on being " \
"remembered across bundler invocations, which bundler will no longer " \
"do in future versions. Instead please use `bundle config set #{name.tr("-", "_")} " \
"do in future versions. Instead please use `bundle config set --local #{name.tr("-", "_")} " \
"'#{value}'`, and stop using this flag"
end
end

View file

@ -17,7 +17,7 @@ module Bundler
perform_bundle_install unless options["skip-install"]
end
private
private
def perform_bundle_install
Installer.install(Bundler.root, Bundler.definition)

View file

@ -24,7 +24,7 @@ module Bundler
end
end
private
private
def install
require_relative "install"
@ -37,12 +37,6 @@ module Bundler
all = options.fetch(:all, Bundler.feature_flag.cache_all? || nil)
Bundler.settings.set_command_option_if_given :cache_all, all
if Bundler.definition.has_local_dependencies? && !Bundler.feature_flag.cache_all?
Bundler.ui.warn "Your Gemfile contains path and git dependencies. If you want " \
"to cache them as well, please pass the --all flag. This will be the default " \
"on Bundler 3.0."
end
end
end
end

View file

@ -13,7 +13,7 @@ module Bundler
Bundler.load.clean(options[:"dry-run"])
end
protected
protected
def require_path_or_force
return unless Bundler.use_system_gems? && !options[:force]

View file

@ -14,6 +14,20 @@ module Bundler
Bundler.ui.info msg
end
def self.output_fund_metadata_summary
definition = Bundler.definition
current_dependencies = definition.requested_dependencies
current_specs = definition.specs
count = current_dependencies.count {|dep| current_specs[dep.name].first.metadata.key?("funding_uri") }
return if count.zero?
intro = count > 1 ? "#{count} installed gems you directly depend on are" : "#{count} installed gem you directly depend on is"
message = "#{intro} looking for funding.\n Run `bundle fund` for details"
Bundler.ui.info message
end
def self.output_without_groups_message(command)
return if Bundler.settings[:without].empty?
Bundler.ui.confirm without_groups_message(command)

View file

@ -93,7 +93,7 @@ module Bundler
end
end
private
private
def check_home_permissions
require "find"

View file

@ -34,7 +34,7 @@ module Bundler
end
end
private
private
def validate_cmd!
return unless cmd.nil?

36
lib/bundler/cli/fund.rb Normal file
View file

@ -0,0 +1,36 @@
# frozen_string_literal: true
module Bundler
class CLI::Fund
attr_reader :options
def initialize(options)
@options = options
end
def run
Bundler.definition.validate_runtime!
groups = Array(options[:group]).map(&:to_sym)
deps = if groups.any?
Bundler.definition.dependencies_for(groups)
else
Bundler.definition.current_dependencies
end
fund_info = deps.each_with_object([]) do |dep, arr|
spec = Bundler.definition.specs[dep.name].first
if spec.metadata.key?("funding_uri")
arr << "* #{spec.name} (#{spec.version})\n Funding: #{spec.metadata["funding_uri"]}"
end
end
if fund_info.empty?
Bundler.ui.info "None of the installed gems you directly depend on are looking for funding."
else
Bundler.ui.info fund_info.join("\n")
end
end
end
end

View file

@ -192,7 +192,7 @@ module Bundler
raise GenericSystemCallError.new(e, "There was a conflict while creating the new gem.")
end
private
private
def resolve_name(name)
SharedHelpers.pwd.join(name).basename.to_s

View file

@ -22,7 +22,7 @@ module Bundler
end
end
private
private
def spec_for_gem(gem_name)
spec = Bundler.definition.specs.find {|s| s.name == gem_name }
@ -60,6 +60,7 @@ module Bundler
gem_info << "\tHomepage: #{spec.homepage}\n" if spec.homepage
gem_info << "\tDocumentation: #{metadata["documentation_uri"]}\n" if metadata.key?("documentation_uri")
gem_info << "\tSource Code: #{metadata["source_code_uri"]}\n" if metadata.key?("source_code_uri")
gem_info << "\tFunding: #{metadata["funding_uri"]}\n" if metadata.key?("funding_uri")
gem_info << "\tWiki: #{metadata["wiki_uri"]}\n" if metadata.key?("wiki_uri")
gem_info << "\tChangelog: #{metadata["changelog_uri"]}\n" if metadata.key?("changelog_uri")
gem_info << "\tBug Tracker: #{metadata["bug_tracker_uri"]}\n" if metadata.key?("bug_tracker_uri")

View file

@ -38,7 +38,7 @@ module Bundler
puts "Writing new #{gemfile} to #{SharedHelpers.pwd}/#{gemfile}"
end
private
private
def gemfile
@gemfile ||= Bundler.preferred_gemfile_name

View file

@ -44,7 +44,7 @@ module Bundler
end
end
private
private
def last_version_number
definition = Bundler.definition(true)

View file

@ -53,7 +53,7 @@ module Bundler
if options["binstubs"]
Bundler::SharedHelpers.major_deprecation 2,
"The --binstubs option will be removed in favor of `bundle binstubs`"
"The --binstubs option will be removed in favor of `bundle binstubs --all`"
end
Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
@ -82,6 +82,8 @@ module Bundler
require_relative "clean"
Bundler::CLI::Clean.new(options).run
end
Bundler::CLI::Common.output_fund_metadata_summary
rescue GemNotFound, VersionConflict => e
if options[:local] && Bundler.app_cache.exist?
Bundler.ui.warn "Some gems seem to be missing from your #{Bundler.settings.app_cache_path} directory."
@ -100,7 +102,7 @@ module Bundler
raise e
end
private
private
def warn_if_root
return if Bundler.settings[:silence_root_warning] || Bundler::WINDOWS || !Process.uid.zero?

View file

@ -31,7 +31,7 @@ module Bundler
Bundler.ui.info "Use `bundle info` to print more detailed information about a gem"
end
private
private
def verify_group_exists(groups)
(@without_group + @only_group).each do |group|

View file

@ -127,7 +127,7 @@ module Bundler
end
end
private
private
def groups_text(group_text, groups)
"#{group_text}#{groups.split(",").size > 1 ? "s" : ""} \"#{groups}\""

View file

@ -53,7 +53,7 @@ module Bundler
end
end
private
private
def fetch_latest_specs
definition = Bundler.definition(true)

View file

@ -106,6 +106,8 @@ module Bundler
Bundler.ui.confirm "Bundle updated!"
Bundler::CLI::Common.output_without_groups_message(:update)
Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
Bundler::CLI::Common.output_fund_metadata_summary
end
end
end

View file

@ -87,7 +87,7 @@ module Bundler
@parsed_checksums = true
end
private
private
def update(local_path, remote_path)
Bundler::CompactIndexClient.debug { "update(#{local_path}, #{remote_path})" }

View file

@ -83,7 +83,7 @@ module Bundler
gem_line ? parse_gem(gem_line) : nil
end
private
private
def lines(path)
return [] unless path.file?

View file

@ -199,10 +199,6 @@ module Bundler
@locked_specs - specs
end
def new_platform?
@new_platform
end
def missing_specs
missing = []
resolve.materialize(requested_dependencies, missing)
@ -232,6 +228,12 @@ module Bundler
end
end
def requested_dependencies
groups = requested_groups
groups.map!(&:to_sym)
dependencies_for(groups)
end
def current_dependencies
dependencies.select do |d|
d.should_include? && !d.gem_platforms(@platforms).empty?
@ -243,6 +245,12 @@ module Bundler
specs.for(expand_dependencies(deps))
end
def dependencies_for(groups)
current_dependencies.reject do |d|
(d.groups & groups).empty?
end
end
# Resolve all the dependencies specified in Gemfile. It ensures that
# dependencies that have been already resolved via locked file and are fresh
# are reused when resolving dependencies
@ -318,10 +326,6 @@ module Bundler
sources.rubygems_sources.any? {|s| s.remotes.any? }
end
def has_local_dependencies?
!sources.path_sources.empty? || !sources.git_sources.empty?
end
def spec_git_paths
sources.git_sources.map {|s| File.realpath(s.path) if File.exist?(s.path) }.compact
end
@ -541,7 +545,7 @@ module Bundler
@unlocking
end
private
private
def add_platforms
(@dependencies.flat_map(&:expanded_platforms) + current_platforms).uniq.each do |platform|
@ -550,10 +554,9 @@ module Bundler
end
def current_platforms
current_platform = Bundler.local_platform
[].tap do |platforms|
platforms << current_platform if Bundler.feature_flag.specific_platform?
platforms << generic(current_platform)
platforms << local_platform if Bundler.feature_flag.specific_platform?
platforms << generic_local_platform
end
end
@ -821,7 +824,7 @@ module Bundler
end
resolve = SpecSet.new(converged)
@locked_specs_incomplete_for_platform = !resolve.for(expand_dependencies(deps), @unlock[:gems], true, true)
@locked_specs_incomplete_for_platform = !resolve.for(expand_dependencies(requested_dependencies & deps), @unlock[:gems], true, true)
resolve = resolve.for(expand_dependencies(deps, true), @unlock[:gems], false, false, false)
diff = nil
@ -859,11 +862,7 @@ module Bundler
def metadata_dependencies
@metadata_dependencies ||= begin
ruby_versions = concat_ruby_version_requirements(@ruby_version)
if ruby_versions.empty? || !@ruby_version.exact?
concat_ruby_version_requirements(RubyVersion.system, ruby_versions)
concat_ruby_version_requirements(locked_ruby_version_object, ruby_versions) unless @unlock[:ruby]
end
ruby_versions = ruby_version_requirements(@ruby_version)
[
Dependency.new("Ruby\0", ruby_versions),
Dependency.new("RubyGems\0", Gem::VERSION),
@ -871,47 +870,39 @@ module Bundler
end
end
def concat_ruby_version_requirements(ruby_version, ruby_versions = [])
return ruby_versions unless ruby_version
def ruby_version_requirements(ruby_version)
return [] unless ruby_version
if ruby_version.patchlevel
ruby_versions << ruby_version.to_gem_version_with_patchlevel
[ruby_version.to_gem_version_with_patchlevel]
else
ruby_versions.concat(ruby_version.versions.map do |version|
ruby_version.versions.map do |version|
requirement = Gem::Requirement.new(version)
if requirement.exact?
"~> #{version}.0"
else
requirement
end
end)
end
end
end
def expand_dependencies(dependencies, remote = false)
sorted_platforms = Resolver.sort_platforms(@platforms)
deps = []
dependencies.each do |dep|
dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
next if !remote && !dep.current_platform?
dep.gem_platforms(sorted_platforms).each do |p|
deps << DepProxy.new(dep, p) if remote || p == generic_local_platform
end
next unless remote || dep.current_platform?
target_platforms = dep.gem_platforms(remote ? Resolver.sort_platforms(@platforms) : [generic_local_platform])
deps += expand_dependency_with_platforms(dep, target_platforms)
end
deps
end
def dependencies_for(groups)
current_dependencies.reject do |d|
(d.groups & groups).empty?
def expand_dependency_with_platforms(dep, platforms)
platforms.map do |p|
DepProxy.new(dep, p)
end
end
def requested_dependencies
groups = requested_groups
groups.map!(&:to_sym)
dependencies_for(groups)
end
def source_requirements
# Load all specs from remote sources
index

View file

@ -39,7 +39,7 @@ module Bundler
s
end
private
private
def method_missing(*args, &blk)
@dep.send(*args, &blk)

View file

@ -63,7 +63,7 @@ module Bundler
development_group = opts[:development_group] || :development
expanded_path = gemfile_root.join(path)
gemspecs = Dir[File.join(expanded_path, "{,*}.gemspec")].map {|g| Bundler.load_gemspec(g) }.compact
gemspecs = Gem::Util.glob_files_in_dir("{,*}.gemspec", expanded_path).map {|g| Bundler.load_gemspec(g) }.compact
gemspecs.reject! {|s| s.name != name } if name
Index.sort_specs(gemspecs)
specs_by_name_and_version = gemspecs.group_by {|s| [s.name, s.version] }
@ -279,7 +279,7 @@ module Bundler
raise GemfileError, "Undefined local variable or method `#{name}' for Gemfile"
end
private
private
def add_git_sources
git_source(:github) do |repo_name|
@ -457,7 +457,7 @@ repo_name ||= user_name
"Using `source` more than once without a block is a security risk, and " \
"may result in installing unexpected gems. To resolve this warning, use " \
"a block to indicate which gems should come from the secondary source. " \
"To upgrade this warning to an error, run `bundle config set " \
"To upgrade this warning to an error, run `bundle config set --local " \
"disable_multisource true`."
end
end
@ -567,7 +567,7 @@ The :#{name} git source is deprecated, and will be removed in the future.#{addit
end
end
private
private
def parse_line_number_from_description
description = self.description

View file

@ -104,7 +104,7 @@ module Bundler
@remote_specification = spec
end
private
private
def local_specification_path
"#{base_dir}/specifications/#{full_name}.gemspec"

View file

@ -47,7 +47,7 @@ module Bundler
remote_uri = filter_uri(remote_uri)
super "Authentication is required for #{remote_uri}.\n" \
"Please supply credentials for this source. You can do this by running:\n" \
" bundle config set #{remote_uri} username:password"
" bundle config set --global #{remote_uri} username:password"
end
end
# This error is raised if HTTP authentication is provided, but incorrect.
@ -216,7 +216,7 @@ module Bundler
"#<#{self.class}:0x#{object_id} uri=#{uri}>"
end
private
private
FETCHERS = [CompactIndex, Dependency, Index].freeze
@ -303,7 +303,7 @@ module Bundler
store
end
private
private
def remote_uri
@remote.uri

View file

@ -38,7 +38,7 @@ module Bundler
false
end
private
private
def log_specs(debug_msg)
if Bundler.ui.debug?

View file

@ -83,7 +83,7 @@ module Bundler
true
end
private
private
def compact_index_client
@compact_index_client ||=

View file

@ -74,7 +74,7 @@ module Bundler
end
end
private
private
def validate_uri_scheme!(uri)
return if uri.scheme =~ /\Ahttps?\z/

View file

@ -42,7 +42,7 @@ module Bundler
"Your network or your gem server is probably having issues right now."
end
private
private
# cached gem specification path, if one exists
def gemspec_cached_path(spec_file_name)

View file

@ -4,7 +4,7 @@ require_relative "vendored_thor"
module Bundler
module FriendlyErrors
module_function
module_function
def log_error(error)
case error
@ -51,7 +51,7 @@ module Bundler
end
def request_issue_report_for(e)
Bundler.ui.info <<-EOS.gsub(/^ {8}/, "")
Bundler.ui.error <<-EOS.gsub(/^ {8}/, ""), nil, nil
--- ERROR REPORT TEMPLATE -------------------------------------------------------
# Error Report
@ -94,7 +94,7 @@ module Bundler
Bundler.ui.error "Unfortunately, an unexpected error occurred, and Bundler cannot continue."
Bundler.ui.warn <<-EOS.gsub(/^ {8}/, "")
Bundler.ui.error <<-EOS.gsub(/^ {8}/, ""), nil, :yellow
First, try this link to see if there are any existing issue reports for this error:
#{issues_url(e)}

View file

@ -32,7 +32,7 @@ module Bundler
def initialize(base = nil, name = nil)
@base = File.expand_path(base || SharedHelpers.pwd)
gemspecs = name ? [File.join(@base, "#{name}.gemspec")] : Dir[File.join(@base, "{,*}.gemspec")]
gemspecs = name ? [File.join(@base, "#{name}.gemspec")] : Gem::Util.glob_files_in_dir("{,*}.gemspec", @base)
raise "Unable to determine name from existing gemspec. Use :name => 'gemname' in #install_tasks to manually set it." unless gemspecs.size == 1
@spec_path = gemspecs.first
@gemspec = Bundler.load_gemspec(@spec_path)
@ -100,27 +100,35 @@ module Bundler
Bundler.ui.confirm "#{name} (#{version}) installed."
end
protected
protected
def rubygem_push(path)
cmd = [*gem_command, "push", path]
cmd << "--key" << gem_key if gem_key
cmd << "--host" << allowed_push_host if allowed_push_host
unless allowed_push_host || Bundler.user_home.join(".gem/credentials").file?
raise "Your rubygems.org credentials aren't set. Run `gem signin` to set them."
end
sh_with_input(cmd)
Bundler.ui.confirm "Pushed #{name} #{version} to #{gem_push_host}"
end
def built_gem_path
Dir[File.join(base, "#{name}-*.gem")].sort_by {|f| File.mtime(f) }.last
Gem::Util.glob_files_in_dir("#{name}-*.gem", base).sort_by {|f| File.mtime(f) }.last
end
def git_push(remote = "")
def git_push(remote = nil)
remote ||= default_remote
perform_git_push remote
perform_git_push "#{remote} --tags"
Bundler.ui.confirm "Pushed git commits and tags."
perform_git_push "#{remote} #{version_tag}"
Bundler.ui.confirm "Pushed git commits and release tag."
end
def default_remote
current_branch = sh(%w[git rev-parse --abbrev-ref HEAD]).strip
return "origin" if current_branch.empty?
remote_for_branch = sh(%W[git config --get branch.#{current_branch}.remote]).strip
return "origin" if remote_for_branch.empty?
remote_for_branch
end
def allowed_push_host

View file

@ -24,10 +24,15 @@ module Bundler
module_function :generic
def generic_local_platform
generic(Bundler.local_platform)
generic(local_platform)
end
module_function :generic_local_platform
def local_platform
Bundler.local_platform
end
module_function :local_platform
def platform_specificity_match(spec_platform, user_platform)
spec_platform = Gem::Platform.new(spec_platform)
return PlatformMatch::EXACT_MATCH if spec_platform == user_platform

View file

@ -98,7 +98,7 @@ module Bundler
level == :minor
end
private
private
def filter_dep_specs(spec_groups, locked_spec)
res = spec_groups.select do |spec_group|

View file

@ -27,7 +27,7 @@ module Bundler
GraphVizClient.new(self).run
end
private
private
def _populate_relations
parent_dependencies = _groups.values.to_set.flatten

View file

@ -179,7 +179,7 @@ module Bundler
@sources.uniq! # need to use uniq! here instead of checking for the item before adding
end
private
private
def specs_by_name(name)
@specs[name].values

View file

@ -74,7 +74,7 @@ module Bundler
end
end
private
private
def conservative_version(spec)
version = spec.version

View file

@ -196,7 +196,7 @@ module Bundler
end
end
private
private
# the order that the resolver provides is significant, since
# dependencies might affect the installation of a gem.

View file

@ -27,7 +27,7 @@ module Bundler
return false, specific_failure_message(e)
end
private
private
def specific_failure_message(e)
message = "#{e.class}: #{e.message}\n"

View file

@ -130,7 +130,7 @@ module Bundler
Bundler.ui.warn(warning.join("\n"))
end
private
private
def failed_specs
@specs.select(&:failed?)

View file

@ -16,12 +16,12 @@ module Bundler
file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
file.puts "path = File.expand_path('..', __FILE__)"
paths.each do |path|
file.puts %($:.unshift "\#{path}/#{path}")
file.puts %($:.unshift File.expand_path("\#{path}/#{path}"))
end
end
end
private
private
def paths
@specs.map do |spec|

View file

@ -12,7 +12,7 @@ module Bundler
[name, version, platform_string] <=> [other.name, other.version, other.platform_string]
end
protected
protected
def platform_string
platform_string = platform.to_s
@ -89,7 +89,7 @@ module Bundler
if search && Gem::Platform.new(search.platform) != platform_object && !search.runtime_dependencies.-(dependencies.reject {|d| d.type == :development }).empty?
Bundler.ui.warn "Unable to use the platform-specific (#{search.platform}) version of #{name} (#{version}) " \
"because it has different dependencies from the #{platform} version. " \
"To use the platform-specific version of the gem, run `bundle config set specific_platform true` and install again."
"To use the platform-specific version of the gem, run `bundle config set --local specific_platform true` and install again."
search = source.specs.search(self).last
end
search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
@ -118,7 +118,7 @@ module Bundler
" #{source.revision[0..6]}"
end
private
private
def to_ary
nil

View file

@ -25,7 +25,7 @@ module Bundler
out
end
private
private
def add_sources
definition.send(:sources).lock_sources.each_with_index do |source, idx|

View file

@ -109,7 +109,7 @@ module Bundler
"bundler:#{bundler_version}#{prerelease_text}`.\n"
end
private
private
TYPES = {
GIT => Bundler::Source::Git,

View file

@ -43,7 +43,7 @@ module Bundler
config.update_mirror(mirror)
end
private
private
def fetch_valid_mirror_for(uri)
downcased = uri.to_s.downcase
@ -158,7 +158,7 @@ module Bundler
end
end
private
private
def wait_for_writtable_socket(socket, address, timeout)
if IO.select(nil, [socket], nil, timeout)

View file

@ -16,7 +16,7 @@ module Bundler
PLUGIN_FILE_NAME = "plugins.rb".freeze
module_function
module_function
def reset!
instance_variables.each {|i| remove_instance_variable(i) }
@ -39,12 +39,11 @@ module Bundler
save_plugins names, specs
rescue PluginError => e
if specs
specs_to_delete = Hash[specs.select {|k, _v| names.include?(k) && !index.commands.values.include?(k) }]
specs_to_delete.values.each {|spec| Bundler.rm_rf(spec.full_gem_path) }
end
specs_to_delete = specs.select {|k, _v| names.include?(k) && !index.commands.values.include?(k) }
specs_to_delete.each_value {|spec| Bundler.rm_rf(spec.full_gem_path) }
Bundler.ui.error "Failed to install plugin #{name}: #{e.message}\n #{e.backtrace.join("\n ")}"
names_list = names.map {|name| "`#{name}`" }.join(", ")
Bundler.ui.error "Failed to install the following plugins: #{names_list}. The underlying error was: #{e.message}.\n #{e.backtrace.join("\n ")}"
end
# Uninstalls plugins by the given names

View file

@ -133,7 +133,7 @@ module Bundler
@hooks[event] || []
end
private
private
# Reads the index file from the directory and initializes the instance
# variables.

View file

@ -41,7 +41,7 @@ module Bundler
install_from_specs specs
end
private
private
def check_sources_consistency!(options)
if options.key?(:git) && options.key?(:local_git)

View file

@ -8,7 +8,7 @@ module Bundler
"#{spec.name} #{spec.version}"
end
private
private
def requires_sudo?
false # Will change on implementation of project level plugins

View file

@ -17,7 +17,7 @@ module Bundler
path_sources + git_sources + rubygems_sources + [metadata_source]
end
private
private
def rubygems_aggregate_class
Plugin::Installer::Rubygems

View file

@ -91,7 +91,7 @@ module Bundler
" #{source.revision[0..6]}"
end
private
private
def to_ary
nil

View file

@ -158,10 +158,10 @@ module Bundler
# spec group.
sg_ruby = sg.copy_for(Gem::Platform::RUBY)
selected_sgs << sg_ruby if sg_ruby
sg_all_platforms = nil
all_platforms = @platforms + [platform]
sorted_all_platforms = self.class.sort_platforms(all_platforms)
sorted_all_platforms.reverse_each do |other_platform|
next if all_platforms.to_a == [Gem::Platform::RUBY]
sg_all_platforms = nil
self.class.sort_platforms(all_platforms).reverse_each do |other_platform|
if sg_all_platforms.nil?
sg_all_platforms = sg.copy_for(other_platform)
else
@ -250,7 +250,7 @@ module Bundler
["00", *platform.to_a.map {|part| part || "" }]
end
private
private
# returns an integer \in (-\infty, 0]
# a number closer to 0 means the dependency is less constraining

View file

@ -87,13 +87,13 @@ module Bundler
name.hash ^ version.hash ^ sorted_activated_platforms.hash ^ source.hash
end
protected
protected
def sorted_activated_platforms
@activated_platforms.sort_by(&:to_s)
end
private
private
def __dependencies
@dependencies = Hash.new do |dependencies, platform|

View file

@ -32,7 +32,7 @@ module Bundler
end
alias_method :attempts, :attempt
private
private
def run(&block)
@failed = false

View file

@ -123,7 +123,7 @@ module Bundler
@exact = versions.all? {|v| Gem::Requirement.create(v).exact? }
end
private
private
def matches?(requirements, version)
# Handles RUBY_PATCHLEVEL of -1 for instances like ruby-head

View file

@ -85,7 +85,7 @@ module Gem
dependencies - development_dependencies
end
private
private
def dependencies_to_gemfile(dependencies, group = nil)
gemfile = String.new
@ -129,6 +129,35 @@ module Gem
end
end
# comparison is done order independently since rubygems 3.2.0.rc.2
unless Gem::Requirement.new("> 1", "< 2") == Gem::Requirement.new("< 2", "> 1")
class Requirement
module OrderIndependentComparison
def ==(other)
if _requirements_sorted? && other._requirements_sorted?
super
else
_with_sorted_requirements == other._with_sorted_requirements
end
end
protected
def _requirements_sorted?
return @_are_requirements_sorted if defined?(@_are_requirements_sorted)
strings = as_list
@_are_requirements_sorted = strings == strings.sort
end
def _with_sorted_requirements
@_with_sorted_requirements ||= _requirements_sorted? ? self : self.class.new(as_list.sort)
end
end
prepend OrderIndependentComparison
end
end
class Platform
JAVA = Gem::Platform.new("java") unless defined?(JAVA)
MSWIN = Gem::Platform.new("mswin32") unless defined?(MSWIN)
@ -144,6 +173,22 @@ module Gem
undef_method :eql? if method_defined? :eql?
alias_method :eql?, :==
end
require "rubygems/util"
Util.singleton_class.module_eval do
if Util.singleton_methods.include?(:glob_files_in_dir) # since 3.0.0.beta.2
remove_method :glob_files_in_dir
end
def glob_files_in_dir(glob, base_path)
if RUBY_VERSION >= "2.5"
Dir.glob(glob, :base => base_path).map! {|f| File.expand_path(f, base_path) }
else
Dir.glob(File.join(base_path.to_s.gsub(/[\[\]]/, '\\\\\\&'), glob)).map! {|f| File.expand_path(f) }
end
end
end
end
module Gem

View file

@ -34,7 +34,7 @@ module Bundler
end
end
private
private
def validate_bundler_checksum(checksum)
return true if Bundler.settings[:disable_checksum_validation]
@ -60,7 +60,7 @@ module Bundler
If you wish to continue installing the downloaded gem, and are certain it does not pose a \
security issue despite the mismatching checksum, do the following:
1. run `bundle config set disable_checksum_validation true` to turn off checksum verification
1. run `bundle config set --local disable_checksum_validation true` to turn off checksum verification
2. run `bundle install`
(More info: The expected SHA256 checksum was #{checksum.inspect}, but the \

View file

@ -313,8 +313,13 @@ module Bundler
end
message = if spec.nil?
target_file = begin
Bundler.default_gemfile.basename
rescue GemfileNotFound
"inline Gemfile"
end
"#{dep.name} is not part of the bundle." \
" Add it to your #{Bundler.default_gemfile.basename}."
" Add it to your #{target_file}."
else
"can't activate #{dep}, already activated #{spec.full_name}. " \
"Make sure all dependencies are added to Gemfile."
@ -406,6 +411,17 @@ module Bundler
# Replace or hook into RubyGems to provide a bundlerized view
# of the world.
def replace_entrypoints(specs)
specs_by_name = add_default_gems_to(specs)
replace_gem(specs, specs_by_name)
stub_rubygems(specs)
replace_bin_path(specs_by_name)
Gem.clear_paths
end
# Add default gems not already present in specs, and return them as a hash.
def add_default_gems_to(specs)
specs_by_name = specs.reduce({}) do |h, s|
h[s.name] = s
h
@ -420,11 +436,7 @@ module Bundler
specs_by_name[default_spec_name] = default_spec
end
replace_gem(specs, specs_by_name)
stub_rubygems(specs)
replace_bin_path(specs_by_name)
Gem.clear_paths
specs_by_name
end
def undo_replacements

View file

@ -155,7 +155,7 @@ module Bundler
spec_cache_paths = []
spec_gemspec_paths = []
spec_extension_paths = []
specs.each do |spec|
Bundler.rubygems.add_default_gems_to(specs).values.each do |spec|
spec_gem_paths << spec.full_gem_path
# need to check here in case gems are nested like for the rails git repo
md = %r{(.+bundler/gems/.+-[a-f0-9]{7,12})}.match(spec.full_gem_path)
@ -203,7 +203,7 @@ module Bundler
output
end
private
private
def prune_gem_cache(resolve, cache_path)
cached = Dir["#{cache_path}/*.gem"]

View file

@ -63,30 +63,25 @@ module Bundler
].freeze
DEFAULT_CONFIG = {
:silence_deprecations => false,
:disable_version_check => true,
:prefer_patch => false,
:redirect => 5,
:retry => 3,
:timeout => 10,
"BUNDLE_SILENCE_DEPRECATIONS" => false,
"BUNDLE_DISABLE_VERSION_CHECK" => true,
"BUNDLE_PREFER_PATCH" => false,
"BUNDLE_REDIRECT" => 5,
"BUNDLE_RETRY" => 3,
"BUNDLE_TIMEOUT" => 10,
}.freeze
def initialize(root = nil)
@root = root
@local_config = load_config(local_config_file)
@env_config = ENV.to_h.select {|key, _value| key =~ /\ABUNDLE_.+/ }
@global_config = load_config(global_config_file)
@temporary = {}
end
def [](name)
key = key_for(name)
value = @temporary.fetch(key) do
@local_config.fetch(key) do
ENV.fetch(key) do
@global_config.fetch(key) do
DEFAULT_CONFIG.fetch(name) do
nil
end end end end end
value = configs.values.map {|config| config[key] }.compact.first
converted_value(value, name)
end
@ -129,9 +124,7 @@ module Bundler
end
def all
env_keys = ENV.keys.grep(/\ABUNDLE_.+/)
keys = @temporary.keys | @global_config.keys | @local_config.keys | env_keys
keys = @temporary.keys | @global_config.keys | @local_config.keys | @env_config.keys
keys.map do |key|
key.sub(/^BUNDLE_/, "").gsub(/__/, ".").downcase
@ -168,13 +161,11 @@ module Bundler
def locations(key)
key = key_for(key)
locations = {}
locations[:temporary] = @temporary[key] if @temporary.key?(key)
locations[:local] = @local_config[key] if @local_config.key?(key)
locations[:env] = ENV[key] if ENV[key]
locations[:global] = @global_config[key] if @global_config.key?(key)
locations[:default] = DEFAULT_CONFIG[key] if DEFAULT_CONFIG.key?(key)
locations
configs.keys.inject({}) do |partial_locations, level|
value_on_level = configs[level][key]
partial_locations[level] = value_on_level unless value_on_level.nil?
partial_locations
end
end
def pretty_values_for(exposed_key)
@ -182,20 +173,20 @@ module Bundler
locations = []
if @temporary.key?(key)
locations << "Set for the current command: #{converted_value(@temporary[key], exposed_key).inspect}"
if value = @temporary[key]
locations << "Set for the current command: #{converted_value(value, exposed_key).inspect}"
end
if @local_config.key?(key)
locations << "Set for your local app (#{local_config_file}): #{converted_value(@local_config[key], exposed_key).inspect}"
if value = @local_config[key]
locations << "Set for your local app (#{local_config_file}): #{converted_value(value, exposed_key).inspect}"
end
if value = ENV[key]
if value = @env_config[key]
locations << "Set via #{key}: #{converted_value(value, exposed_key).inspect}"
end
if @global_config.key?(key)
locations << "Set for the current user (#{global_config_file}): #{converted_value(@global_config[key], exposed_key).inspect}"
if value = @global_config[key]
locations << "Set for the current user (#{global_config_file}): #{converted_value(value, exposed_key).inspect}"
end
return ["You have not configured a value for `#{exposed_key}`"] if locations.empty?
@ -204,17 +195,19 @@ module Bundler
# for legacy reasons, in Bundler 2, we do not respect :disable_shared_gems
def path
key = key_for(:path)
path = ENV[key] || @global_config[key]
if path && !@temporary.key?(key) && !@local_config.key?(key)
return Path.new(path, false, false)
configs.each do |_level, settings|
path = value_for("path", settings)
path_system = value_for("path.system", settings)
disabled_shared_gems = value_for("disable_shared_gems", settings)
next if path.nil? && path_system.nil? && disabled_shared_gems.nil?
system_path = path_system || (disabled_shared_gems == false)
return Path.new(path, system_path)
end
system_path = self["path.system"] || (self[:disable_shared_gems] == false)
Path.new(self[:path], system_path, Bundler.feature_flag.default_install_uses_path?)
Path.new(nil, false)
end
Path = Struct.new(:explicit_path, :system_path, :default_install_uses_path) do
Path = Struct.new(:explicit_path, :system_path) do
def path
path = base_path
path = File.join(path, Bundler.ruby_scope) unless use_system_gems?
@ -224,7 +217,7 @@ module Bundler
def use_system_gems?
return true if system_path
return false if explicit_path
!default_install_uses_path
!Bundler.feature_flag.default_install_uses_path?
end
def base_path
@ -277,9 +270,9 @@ module Bundler
def validate!
all.each do |raw_key|
[@local_config, ENV, @global_config].each do |settings|
value = converted_value(settings[key_for(raw_key)], raw_key)
Validator.validate!(raw_key, value, settings.to_hash.dup)
[@local_config, @env_config, @global_config].each do |settings|
value = value_for(raw_key, settings)
Validator.validate!(raw_key, value, settings.dup)
end
end
end
@ -290,7 +283,21 @@ module Bundler
"BUNDLE_#{key}"
end
private
private
def configs
{
:temporary => @temporary,
:local => @local_config,
:env => @env_config,
:global => @global_config,
:default => DEFAULT_CONFIG,
}
end
def value_for(name, config)
converted_value(config[key_for(name)], name)
end
def parent_setting_for(name)
split_specific_setting_for(name)[0]

View file

@ -212,7 +212,7 @@ module Bundler
filesystem_access(gemfile_path) {|g| File.open(g, "w") {|file| file.puts contents } }
end
private
private
def validate_bundle_path
path_separator = Bundler.rubygems.path_separator

View file

@ -26,7 +26,7 @@ module Bundler
end
end
protected
protected
# https://www.informit.com/articles/article.aspx?p=683059&seqNum=36
def levenshtein_distance(this, that, ins = 2, del = 2, sub = 1)

View file

@ -63,7 +63,7 @@ module Bundler
)
end
private
private
def version_color(spec_version, locked_spec_version)
if Gem::Version.correct?(spec_version) && Gem::Version.correct?(locked_spec_version)

View file

@ -234,7 +234,7 @@ module Bundler
@local
end
private
private
def serialize_gemspecs_in(destination)
destination = destination.expand_path(Bundler.root) if destination.relative?

View file

@ -136,11 +136,13 @@ module Bundler
if submodules
git_retry "submodule update --init --recursive", :dir => destination
elsif Gem::Version.create(version) >= Gem::Version.create("2.9.0")
git_retry "submodule deinit --all --force", :dir => destination
inner_command = "git -C $toplevel submodule deinit --force $sm_path"
inner_command = inner_command.gsub("$") { '\$' } unless Bundler::WINDOWS
git_retry "submodule foreach --quiet \"#{inner_command}\"", :dir => destination
end
end
private
private
def git_null(command, dir: SharedHelpers.pwd)
check_allowed(command)

View file

@ -125,7 +125,7 @@ module Bundler
@expanded_original_path ||= expand(original_path)
end
private
private
def expanded_path
@expanded_path ||= expand(path)
@ -171,7 +171,7 @@ module Bundler
if File.directory?(expanded_path)
# We sort depth-first since `<<` will override the earlier-found specs
Dir["#{expanded_path}/#{@glob}"].sort_by {|p| -p.split(File::SEPARATOR).size }.each do |file|
Gem::Util.glob_files_in_dir(@glob, expanded_path).sort_by {|p| -p.split(File::SEPARATOR).size }.each do |file|
next unless spec = load_gemspec(file)
spec.source = self

View file

@ -40,7 +40,7 @@ module Bundler
Bundler.rm_rf(@tmp_dir) if Bundler.requires_sudo?
end
private
private
def generate_bin
super

View file

@ -291,7 +291,7 @@ module Bundler
names
end
protected
protected
def credless_remotes
remotes.map(&method(:suppress_configured_credentials))
@ -465,7 +465,7 @@ module Bundler
Bundler.app_cache
end
private
private
# Checks if the requested spec exists in the global cache. If it does,
# we copy it to the download path, and if it does not, we download it.

View file

@ -39,7 +39,7 @@ module Bundler
"rubygems remote at #{anonymized_uri}"
end
private
private
def apply_auth(uri, auth)
if auth && uri.userinfo.nil?

View file

@ -116,7 +116,7 @@ module Bundler
@rubygems_aggregate.remotes
end
private
private
def rubygems_aggregate_class
Source::Rubygems
@ -147,7 +147,7 @@ module Bundler
if source.uri =~ /^git\:/
Bundler.ui.warn "The git source `#{source.uri}` uses the `git` protocol, " \
"which transmits data without encryption. Disable this warning with " \
"`bundle config set git.allow_insecure true`, or switch to the `https` " \
"`bundle config set --local git.allow_insecure true`, or switch to the `https` " \
"protocol to keep your data secure."
end
end

View file

@ -147,7 +147,7 @@ module Bundler
sorted.each(&b)
end
private
private
def sorted
rake = @specs.find {|s| s.name == "rake" }

View file

@ -83,7 +83,7 @@ module Bundler
stub.raw_require_paths
end
private
private
def _remote_specification
@_remote_specification ||= begin

View file

@ -28,7 +28,7 @@ TODO: Write usage instructions here
After checking out the repo, run `bin/setup` to install dependencies.<% if config[:test] %> Then, run `rake <%= config[:test].sub('mini', '').sub('rspec', 'spec') %>` to run the tests.<% end %> You can also run `bin/console` for an interactive prompt that will allow you to experiment.<% if config[:bin] %> Run `bundle exec <%= config[:name] %>` to use the gem in this directory, ignoring other installed copies of this gem.<% end %>
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing

View file

@ -1,6 +1,5 @@
# frozen_string_literal: true
require "bundler/setup"
require "<%= config[:namespaced_path] %>"
RSpec.configure do |config|

View file

@ -28,17 +28,17 @@ module Bundler
tell_me(msg, :green, newline) if level("confirm")
end
def warn(msg, newline = nil)
def warn(msg, newline = nil, color = :yellow)
return unless level("warn")
return if @warning_history.include? msg
@warning_history << msg
tell_err(msg, :yellow, newline)
tell_err(msg, color, newline)
end
def error(msg, newline = nil)
def error(msg, newline = nil, color = :red)
return unless level("error")
tell_err(msg, :red, newline)
tell_err(msg, color, newline)
end
def debug(msg, newline = nil)
@ -92,7 +92,7 @@ module Bundler
[]
end
private
private
# valimism
def tell_me(msg, color = nil, newline = nil)

View file

@ -2,7 +2,7 @@
module Bundler
module URICredentialsFilter
module_function
module_function
def credential_filtered_uri(uri_to_anonymize)
return uri_to_anonymize if uri_to_anonymize.nil?

View file

@ -3,8 +3,6 @@ require_relative '../../../../uri/lib/uri'
require 'cgi' # for escaping
require_relative '../../../../connection_pool/lib/connection_pool'
autoload :OpenSSL, 'openssl'
##
# Persistent connections for Net::HTTP
#
@ -149,9 +147,14 @@ class Bundler::Persistent::Net::HTTP::Persistent
EPOCH = Time.at 0 # :nodoc:
##
# Is OpenSSL available? This test works with autoload
# Is OpenSSL available?
HAVE_OPENSSL = defined? OpenSSL::SSL # :nodoc:
HAVE_OPENSSL = begin # :nodoc:
require 'openssl'
true
rescue LoadError
false
end
##
# The default connection pool size is 1/4 the allowed open files

View file

@ -1,7 +1,7 @@
# frozen_string_literal: false
module Bundler
VERSION = "2.2.0.rc.1".freeze
VERSION = "2.2.0.rc.2".freeze
def self.bundler_major_version
@bundler_major_version ||= VERSION.split(".").first.to_i

View file

@ -48,7 +48,7 @@ module Bundler
stop_threads
end
private
private
def process_queue(i)
loop do

View file

@ -3,7 +3,7 @@
module Bundler
# A stub yaml serializer that can handle only hashes and strings (as of now).
module YAMLSerializer
module_function
module_function
def dump(hash)
yaml = String.new("---")

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-ADD" "1" "July 2020" "" ""
.TH "BUNDLE\-ADD" "1" "October 2020" "" ""
.
.SH "NAME"
\fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install

View file

@ -1,58 +0,0 @@
BUNDLE-ADD(1) BUNDLE-ADD(1)
NAME
bundle-add - Add gem to the Gemfile and run bundle install
SYNOPSIS
bundle add GEM_NAME [--group=GROUP] [--version=VERSION]
[--source=SOURCE] [--git=GIT] [--branch=BRANCH] [--skip-install]
[--strict] [--optimistic]
DESCRIPTION
Adds the named gem to the Gemfile and run bundle install. bundle
install can be avoided by using the flag --skip-install.
Example:
bundle add rails
bundle add rails --version "< 3.0, > 1.1"
bundle add rails --version "~> 5.0.0" --source
"https://gems.example.com" --group "development"
bundle add rails --skip-install
bundle add rails --group "development, test"
OPTIONS
--version, -v
Specify version requirements(s) for the added gem.
--group, -g
Specify the group(s) for the added gem. Multiple groups should
be separated by commas.
--source, , -s
Specify the source for the added gem.
--git Specify the git source for the added gem.
--branch
Specify the git branch for the added gem.
--skip-install
Adds the gem to the Gemfile but does not install it.
--optimistic
Adds optimistic declaration of version
--strict
Adds strict declaration of version
July 2020 BUNDLE-ADD(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-BINSTUBS" "1" "July 2020" "" ""
.TH "BUNDLE\-BINSTUBS" "1" "October 2020" "" ""
.
.SH "NAME"
\fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
@ -36,5 +36,7 @@ Makes binstubs that can work without depending on Rubygems or Bundler at runtime
\fB\-\-shebang\fR
Specify a different shebang executable name than the default (default \'ruby\')
.
.SH "BUNDLE INSTALL \-\-BINSTUBS"
To create binstubs for all the gems in the bundle you can use the \fB\-\-binstubs\fR flag in bundle install(1) \fIbundle\-install\.1\.html\fR\.
.TP
\fB\-\-all\fR
Create binstubs for all gems in the bundle\.

View file

@ -37,7 +37,5 @@ Calling binstubs with [GEM [GEM]] will create binstubs for all given gems.
* `--shebang`:
Specify a different shebang executable name than the default (default 'ruby')
## BUNDLE INSTALL --BINSTUBS
To create binstubs for all the gems in the bundle you can use the `--binstubs`
flag in [bundle install(1)](bundle-install.1.html).
* `--all`:
Create binstubs for all gems in the bundle.

View file

@ -1,48 +0,0 @@
BUNDLE-BINSTUBS(1) BUNDLE-BINSTUBS(1)
NAME
bundle-binstubs - Install the binstubs of the listed gems
SYNOPSIS
bundle binstubs GEM_NAME [--force] [--path PATH] [--standalone]
DESCRIPTION
Binstubs are scripts that wrap around executables. Bundler creates a
small Ruby file (a binstub) that loads Bundler, runs the command, and
puts it into bin/. Binstubs are a shortcut-or alternative- to always
using bundle exec. This gives you a file that can be run directly, and
one that will always run the correct gem version used by the
application.
For example, if you run bundle binstubs rspec-core, Bundler will create
the file bin/rspec. That file will contain enough code to load Bundler,
tell it to load the bundled gems, and then run rspec.
This command generates binstubs for executables in GEM_NAME. Binstubs
are put into bin, or the --path directory if one has been set. Calling
binstubs with [GEM [GEM]] will create binstubs for all given gems.
OPTIONS
--force
Overwrite existing binstubs if they exist.
--path The location to install the specified binstubs to. This defaults
to bin.
--standalone
Makes binstubs that can work without depending on Rubygems or
Bundler at runtime.
--shebang
Specify a different shebang executable name than the default
(default 'ruby')
BUNDLE INSTALL --BINSTUBS
To create binstubs for all the gems in the bundle you can use the
--binstubs flag in bundle install(1) bundle-install.1.html.
July 2020 BUNDLE-BINSTUBS(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-CACHE" "1" "July 2020" "" ""
.TH "BUNDLE\-CACHE" "1" "October 2020" "" ""
.
.SH "NAME"
\fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application

View file

@ -1,78 +0,0 @@
BUNDLE-CACHE(1) BUNDLE-CACHE(1)
NAME
bundle-cache - Package your needed .gem files into your application
SYNOPSIS
bundle cache
DESCRIPTION
Copy all of the .gem files needed to run the application into the
vendor/cache directory. In the future, when running [bundle
install(1)][bundle-install], use the gems in the cache in preference to
the ones on rubygems.org.
GIT AND PATH GEMS
The bundle cache command can also package :git and :path dependencies
besides .gem files. This needs to be explicitly enabled via the --all
option. Once used, the --all option will be remembered.
SUPPORT FOR MULTIPLE PLATFORMS
When using gems that have different packages for different platforms,
Bundler supports caching of gems for other platforms where the Gemfile
has been resolved (i.e. present in the lockfile) in vendor/cache. This
needs to be enabled via the --all-platforms option. This setting will
be remembered in your local bundler configuration.
REMOTE FETCHING
By default, if you run bundle install(1)](bundle-install.1.html) after
running bundle cache(1) bundle-cache.1.html, bundler will still connect
to rubygems.org to check whether a platform-specific gem exists for any
of the gems in vendor/cache.
For instance, consider this Gemfile(5):
source "https://rubygems.org"
gem "nokogiri"
If you run bundle cache under C Ruby, bundler will retrieve the version
of nokogiri for the "ruby" platform. If you deploy to JRuby and run
bundle install, bundler is forced to check to see whether a "java"
platformed nokogiri exists.
Even though the nokogiri gem for the Ruby platform is technically
acceptable on JRuby, it has a C extension that does not run on JRuby.
As a result, bundler will, by default, still connect to rubygems.org to
check whether it has a version of one of your gems more specific to
your platform.
This problem is also not limited to the "java" platform. A similar
(common) problem can happen when developing on Windows and deploying to
Linux, or even when developing on OSX and deploying to Linux.
If you know for sure that the gems packaged in vendor/cache are
appropriate for the platform you are on, you can run bundle install
--local to skip checking for more appropriate gems, and use the ones in
vendor/cache.
One way to be sure that you have the right platformed versions of all
your gems is to run bundle cache on an identical machine and check in
the gems. For instance, you can run bundle cache on an identical
staging box during your staging process, and check in the vendor/cache
before deploying to production.
By default, bundle cache(1) bundle-cache.1.html fetches and also
installs the gems to the default location. To package the dependencies
to vendor/cache without installing them to the local install location,
you can run bundle cache --no-install.
July 2020 BUNDLE-CACHE(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-CHECK" "1" "July 2020" "" ""
.TH "BUNDLE\-CHECK" "1" "October 2020" "" ""
.
.SH "NAME"
\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems

View file

@ -1,33 +0,0 @@
BUNDLE-CHECK(1) BUNDLE-CHECK(1)
NAME
bundle-check - Verifies if dependencies are satisfied by installed gems
SYNOPSIS
bundle check [--dry-run] [--gemfile=FILE] [--path=PATH]
DESCRIPTION
check searches the local machine for each of the gems requested in the
Gemfile. If all gems are found, Bundler prints a success message and
exits with a status of 0.
If not, the first missing gem is listed and Bundler exits status 1.
OPTIONS
--dry-run
Locks the [Gemfile(5)][Gemfile(5)] before running the command.
--gemfile
Use the specified gemfile instead of the
[Gemfile(5)][Gemfile(5)].
--path Specify a different path than the system default ($BUNDLE_PATH
or $GEM_HOME). Bundler will remember this value for future
installs on this machine.
July 2020 BUNDLE-CHECK(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-CLEAN" "1" "July 2020" "" ""
.TH "BUNDLE\-CLEAN" "1" "October 2020" "" ""
.
.SH "NAME"
\fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory

View file

@ -1,26 +0,0 @@
BUNDLE-CLEAN(1) BUNDLE-CLEAN(1)
NAME
bundle-clean - Cleans up unused gems in your bundler directory
SYNOPSIS
bundle clean [--dry-run] [--force]
DESCRIPTION
This command will remove all unused gems in your bundler directory.
This is useful when you have made many changes to your gem
dependencies.
OPTIONS
--dry-run
Print the changes, but do not clean the unused gems.
--force
Force a clean even if --path is not set.
July 2020 BUNDLE-CLEAN(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-CONFIG" "1" "July 2020" "" ""
.TH "BUNDLE\-CONFIG" "1" "October 2020" "" ""
.
.SH "NAME"
\fBbundle\-config\fR \- Set bundler configuration options
@ -57,13 +57,13 @@ Executing \fBbundle config unset \-\-local <name> <value>\fR will delete the con
Executing bundle with the \fBBUNDLE_IGNORE_CONFIG\fR environment variable set will cause it to ignore all configuration\.
.
.P
Executing \fBbundle config set disable_multisource true\fR upgrades the warning about the Gemfile containing multiple primary sources to an error\. Executing \fBbundle config unset disable_multisource\fR downgrades this error to a warning\.
Executing \fBbundle config set \-\-local disable_multisource true\fR upgrades the warning about the Gemfile containing multiple primary sources to an error\. Executing \fBbundle config unset disable_multisource\fR downgrades this error to a warning\.
.
.SH "REMEMBERING OPTIONS"
Flags passed to \fBbundle install\fR or the Bundler runtime, such as \fB\-\-path foo\fR or \fB\-\-without production\fR, are remembered between commands and saved to your local application\'s configuration (normally, \fB\./\.bundle/config\fR)\.
.
.P
However, this will be changed in bundler 3, so it\'s better not to rely on this behavior\. If these options must be remembered, it\'s better to set them using \fBbundle config\fR (e\.g\., \fBbundle config set path foo\fR)\.
However, this will be changed in bundler 3, so it\'s better not to rely on this behavior\. If these options must be remembered, it\'s better to set them using \fBbundle config\fR (e\.g\., \fBbundle config set \-\-local path foo\fR)\.
.
.P
The options that can be configured are:
@ -111,7 +111,7 @@ Since the specific location of that executable can change from machine to machin
.
.nf
bundle config set build\.mysql \-\-with\-mysql\-config=/usr/local/mysql/bin/mysql_config
bundle config set \-\-global build\.mysql \-\-with\-mysql\-config=/usr/local/mysql/bin/mysql_config
.
.fi
.
@ -154,7 +154,7 @@ The following is a list of all configuration keys and their purpose\. You can le
\fBbin\fR (\fBBUNDLE_BIN\fR): Install executables from gems in the bundle to the specified directory\. Defaults to \fBfalse\fR\.
.
.IP "\(bu" 4
\fBcache_all\fR (\fBBUNDLE_CACHE_ALL\fR): Cache all gems, including path and git gems\.
\fBcache_all\fR (\fBBUNDLE_CACHE_ALL\fR): Cache all gems, including path and git gems\. This needs to be explicitly configured on bundler 1 and bundler 2, but will be the default on bundler 3\.
.
.IP "\(bu" 4
\fBcache_all_platforms\fR (\fBBUNDLE_CACHE_ALL_PLATFORMS\fR): Cache gems for all platforms\.
@ -312,7 +312,7 @@ Bundler also allows you to work against a git repository locally instead of usin
.
.nf
bundle config set local\.GEM_NAME /path/to/local/git/repository
bundle config set \-\-local local\.GEM_NAME /path/to/local/git/repository
.
.fi
.
@ -325,7 +325,7 @@ For example, in order to use a local Rack repository, a developer could call:
.
.nf
bundle config set local\.rack ~/Work/git/rack
bundle config set \-\-local local\.rack ~/Work/git/rack
.
.fi
.
@ -347,7 +347,7 @@ Bundler supports overriding gem sources with mirrors\. This allows you to config
.
.nf
bundle config set mirror\.SOURCE_URL MIRROR_URL
bundle config set \-\-global mirror\.SOURCE_URL MIRROR_URL
.
.fi
.
@ -360,7 +360,7 @@ For example, to use a mirror of rubygems\.org hosted at rubygems\-mirror\.org:
.
.nf
bundle config set mirror\.http://rubygems\.org http://rubygems\-mirror\.org
bundle config set \-\-global mirror\.http://rubygems\.org http://rubygems\-mirror\.org
.
.fi
.
@ -373,7 +373,7 @@ Each mirror also provides a fallback timeout setting\. If the mirror does not re
.
.nf
bundle config set mirror\.SOURCE_URL\.fallback_timeout TIMEOUT
bundle config set \-\-global mirror\.SOURCE_URL\.fallback_timeout TIMEOUT
.
.fi
.
@ -386,7 +386,7 @@ For example, to fall back to rubygems\.org after 3 seconds:
.
.nf
bundle config set mirror\.https://rubygems\.org\.fallback_timeout 3
bundle config set \-\-global mirror\.https://rubygems\.org\.fallback_timeout 3
.
.fi
.
@ -402,7 +402,7 @@ Bundler allows you to configure credentials for any gem source, which allows you
.
.nf
bundle config set SOURCE_HOSTNAME USERNAME:PASSWORD
bundle config set \-\-global SOURCE_HOSTNAME USERNAME:PASSWORD
.
.fi
.
@ -415,7 +415,7 @@ For example, to save the credentials of user \fBclaudette\fR for the gem source
.
.nf
bundle config set gems\.longerous\.com claudette:s00pers3krit
bundle config set \-\-global gems\.longerous\.com claudette:s00pers3krit
.
.fi
.
@ -441,7 +441,7 @@ For gems with a git source with HTTP(S) URL you can specify credentials like so:
.
.nf
bundle config set https://github\.com/bundler/bundler\.git username:password
bundle config set \-\-global https://github\.com/bundler/bundler\.git username:password
.
.fi
.

View file

@ -47,7 +47,7 @@ configuration only from the local application.
Executing bundle with the `BUNDLE_IGNORE_CONFIG` environment variable set will
cause it to ignore all configuration.
Executing `bundle config set disable_multisource true` upgrades the warning about
Executing `bundle config set --local disable_multisource true` upgrades the warning about
the Gemfile containing multiple primary sources to an error. Executing `bundle
config unset disable_multisource` downgrades this error to a warning.
@ -59,7 +59,7 @@ application's configuration (normally, `./.bundle/config`).
However, this will be changed in bundler 3, so it's better not to rely on this
behavior. If these options must be remembered, it's better to set them using
`bundle config` (e.g., `bundle config set path foo`).
`bundle config` (e.g., `bundle config set --local path foo`).
The options that can be configured are:
@ -103,7 +103,7 @@ pass configuration flags to `gem install` to specify where to find the
Since the specific location of that executable can change from machine
to machine, you can specify these flags on a per-machine basis.
bundle config set build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config
bundle config set --global build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config
After running this command, every time bundler needs to install the
`mysql` gem, it will pass along the flags you specified.
@ -150,7 +150,8 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
Install executables from gems in the bundle to the specified directory.
Defaults to `false`.
* `cache_all` (`BUNDLE_CACHE_ALL`):
Cache all gems, including path and git gems.
Cache all gems, including path and git gems. This needs to be explicitly
configured on bundler 1 and bundler 2, but will be the default on bundler 3.
* `cache_all_platforms` (`BUNDLE_CACHE_ALL_PLATFORMS`):
Cache gems for all platforms.
* `cache_path` (`BUNDLE_CACHE_PATH`):
@ -299,11 +300,11 @@ Bundler also allows you to work against a git repository locally
instead of using the remote version. This can be achieved by setting
up a local override:
bundle config set local.GEM_NAME /path/to/local/git/repository
bundle config set --local local.GEM_NAME /path/to/local/git/repository
For example, in order to use a local Rack repository, a developer could call:
bundle config set local.rack ~/Work/git/rack
bundle config set --local local.rack ~/Work/git/rack
Now instead of checking out the remote git repository, the local
override will be used. Similar to a path source, every time the local
@ -333,21 +334,21 @@ Bundler supports overriding gem sources with mirrors. This allows you to
configure rubygems.org as the gem source in your Gemfile while still using your
mirror to fetch gems.
bundle config set mirror.SOURCE_URL MIRROR_URL
bundle config set --global mirror.SOURCE_URL MIRROR_URL
For example, to use a mirror of rubygems.org hosted at rubygems-mirror.org:
bundle config set mirror.http://rubygems.org http://rubygems-mirror.org
bundle config set --global mirror.http://rubygems.org http://rubygems-mirror.org
Each mirror also provides a fallback timeout setting. If the mirror does not
respond within the fallback timeout, Bundler will try to use the original
server instead of the mirror.
bundle config set mirror.SOURCE_URL.fallback_timeout TIMEOUT
bundle config set --global mirror.SOURCE_URL.fallback_timeout TIMEOUT
For example, to fall back to rubygems.org after 3 seconds:
bundle config set mirror.https://rubygems.org.fallback_timeout 3
bundle config set --global mirror.https://rubygems.org.fallback_timeout 3
The default fallback timeout is 0.1 seconds, but the setting can currently
only accept whole seconds (for example, 1, 15, or 30).
@ -357,12 +358,12 @@ only accept whole seconds (for example, 1, 15, or 30).
Bundler allows you to configure credentials for any gem source, which allows
you to avoid putting secrets into your Gemfile.
bundle config set SOURCE_HOSTNAME USERNAME:PASSWORD
bundle config set --global SOURCE_HOSTNAME USERNAME:PASSWORD
For example, to save the credentials of user `claudette` for the gem source at
`gems.longerous.com`, you would run:
bundle config set gems.longerous.com claudette:s00pers3krit
bundle config set --global gems.longerous.com claudette:s00pers3krit
Or you can set the credentials as an environment variable like this:
@ -370,7 +371,7 @@ Or you can set the credentials as an environment variable like this:
For gems with a git source with HTTP(S) URL you can specify credentials like so:
bundle config set https://github.com/bundler/bundler.git username:password
bundle config set --global https://github.com/bundler/bundler.git username:password
Or you can set the credentials as an environment variable like so:

View file

@ -1,527 +0,0 @@
BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
NAME
bundle-config - Set bundler configuration options
SYNOPSIS
bundle config [list|get|set|unset] [name [value]]
DESCRIPTION
This command allows you to interact with Bundler's configuration
system.
Bundler loads configuration settings in this order:
1. Local config (<project_root>/.bundle/config or
$BUNDLE_APP_CONFIG/config)
2. Environmental variables (ENV)
3. Global config (~/.bundle/config)
4. Bundler default config
Executing bundle config list with will print a list of all bundler
configuration for the current bundle, and where that configuration was
set.
Executing bundle config get <name> will print the value of that
configuration setting, and where it was set.
Executing bundle config set <name> <value> will set that configuration
to the value specified for all bundles executed as the current user.
The configuration will be stored in ~/.bundle/config. If name already
is set, name will be overridden and user will be warned.
Executing bundle config set --global <name> <value> works the same as
above.
Executing bundle config set --local <name> <value> will set that
configuration in the directory for the local application. The
configuration will be stored in <project_root>/.bundle/config. If
BUNDLE_APP_CONFIG is set, the configuration will be stored in
$BUNDLE_APP_CONFIG/config.
Executing bundle config unset <name> will delete the configuration in
both local and global sources.
Executing bundle config unset --global <name> will delete the
configuration only from the user configuration.
Executing bundle config unset --local <name> <value> will delete the
configuration only from the local application.
Executing bundle with the BUNDLE_IGNORE_CONFIG environment variable set
will cause it to ignore all configuration.
Executing bundle config set disable_multisource true upgrades the
warning about the Gemfile containing multiple primary sources to an
error. Executing bundle config unset disable_multisource downgrades
this error to a warning.
REMEMBERING OPTIONS
Flags passed to bundle install or the Bundler runtime, such as --path
foo or --without production, are remembered between commands and saved
to your local application's configuration (normally, ./.bundle/config).
However, this will be changed in bundler 3, so it's better not to rely
on this behavior. If these options must be remembered, it's better to
set them using bundle config (e.g., bundle config set path foo).
The options that can be configured are:
bin Creates a directory (defaults to ~/bin) and place any
executables from the gem there. These executables run in
Bundler's context. If used, you might add this directory to your
environment's PATH variable. For instance, if the rails gem
comes with a rails executable, this flag will create a bin/rails
executable that ensures that all referred dependencies will be
resolved using the bundled gems.
deployment
In deployment mode, Bundler will 'roll-out' the bundle for
production use. Please check carefully if you want to have this
option enabled in development or test environments.
path The location to install the specified gems to. This defaults to
Rubygems' setting. Bundler shares this location with Rubygems,
gem install ... will have gem installed there, too. Therefore,
gems installed without a --path ... setting will show up by
calling gem list. Accordingly, gems installed to other locations
will not get listed.
without
A space-separated list of groups referencing gems to skip during
installation.
with A space-separated list of groups referencing gems to include
during installation.
BUILD OPTIONS
You can use bundle config to give Bundler the flags to pass to the gem
installer every time bundler tries to install a particular gem.
A very common example, the mysql gem, requires Snow Leopard users to
pass configuration flags to gem install to specify where to find the
mysql_config executable.
gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Since the specific location of that executable can change from machine
to machine, you can specify these flags on a per-machine basis.
bundle config set build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config
After running this command, every time bundler needs to install the
mysql gem, it will pass along the flags you specified.
CONFIGURATION KEYS
Configuration keys in bundler have two forms: the canonical form and
the environment variable form.
For instance, passing the --without flag to bundle install(1)
bundle-install.1.html prevents Bundler from installing certain groups
specified in the Gemfile(5). Bundler persists this value in
app/.bundle/config so that calls to Bundler.setup do not try to find
gems from the Gemfile that you didn't install. Additionally, subsequent
calls to bundle install(1) bundle-install.1.html remember this setting
and skip those groups.
The canonical form of this configuration is "without". To convert the
canonical form to the environment variable form, capitalize it, and
prepend BUNDLE_. The environment variable form of "without" is
BUNDLE_WITHOUT.
Any periods in the configuration keys must be replaced with two
underscores when setting it via environment variables. The
configuration key local.rack becomes the environment variable
BUNDLE_LOCAL__RACK.
LIST OF AVAILABLE KEYS
The following is a list of all configuration keys and their purpose.
You can learn more about their operation in bundle install(1)
bundle-install.1.html.
o allow_bundler_dependency_conflicts
(BUNDLE_ALLOW_BUNDLER_DEPENDENCY_CONFLICTS): Allow resolving to
specifications that have dependencies on bundler that are
incompatible with the running Bundler version.
o allow_deployment_source_credential_changes
(BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES): When in
deployment mode, allow changing the credentials to a gem's source.
Ex: https://some.host.com/gems/path/ ->
https://user_name:password@some.host.com/gems/path
o allow_offline_install (BUNDLE_ALLOW_OFFLINE_INSTALL): Allow Bundler
to use cached data when installing without network access.
o auto_clean_without_path (BUNDLE_AUTO_CLEAN_WITHOUT_PATH):
Automatically run bundle clean after installing when an explicit
path has not been set and Bundler is not installing into the system
gems.
o auto_install (BUNDLE_AUTO_INSTALL): Automatically run bundle
install when gems are missing.
o bin (BUNDLE_BIN): Install executables from gems in the bundle to
the specified directory. Defaults to false.
o cache_all (BUNDLE_CACHE_ALL): Cache all gems, including path and
git gems.
o cache_all_platforms (BUNDLE_CACHE_ALL_PLATFORMS): Cache gems for
all platforms.
o cache_path (BUNDLE_CACHE_PATH): The directory that bundler will
place cached gems in when running bundle package, and that bundler
will look in when installing gems. Defaults to vendor/cache.
o clean (BUNDLE_CLEAN): Whether Bundler should run bundle clean
automatically after bundle install.
o console (BUNDLE_CONSOLE): The console that bundle console starts.
Defaults to irb.
o default_install_uses_path (BUNDLE_DEFAULT_INSTALL_USES_PATH):
Whether a bundle install without an explicit --path argument
defaults to installing gems in .bundle.
o deployment (BUNDLE_DEPLOYMENT): Disallow changes to the Gemfile.
When the Gemfile is changed and the lockfile has not been updated,
running Bundler commands will be blocked.
o disable_checksum_validation (BUNDLE_DISABLE_CHECKSUM_VALIDATION):
Allow installing gems even if they do not match the checksum
provided by RubyGems.
o disable_exec_load (BUNDLE_DISABLE_EXEC_LOAD): Stop Bundler from
using load to launch an executable in-process in bundle exec.
o disable_local_branch_check (BUNDLE_DISABLE_LOCAL_BRANCH_CHECK):
Allow Bundler to use a local git override without a branch
specified in the Gemfile.
o disable_multisource (BUNDLE_DISABLE_MULTISOURCE): When set,
Gemfiles containing multiple sources will produce errors instead of
warnings. Use bundle config unset disable_multisource to unset.
o disable_shared_gems (BUNDLE_DISABLE_SHARED_GEMS): Stop Bundler from
accessing gems installed to RubyGems' normal location.
o disable_version_check (BUNDLE_DISABLE_VERSION_CHECK): Stop Bundler
from checking if a newer Bundler version is available on
rubygems.org.
o force_ruby_platform (BUNDLE_FORCE_RUBY_PLATFORM): Ignore the
current machine's platform and install only ruby platform gems. As
a result, gems with native extensions will be compiled from source.
o frozen (BUNDLE_FROZEN): Disallow changes to the Gemfile. When the
Gemfile is changed and the lockfile has not been updated, running
Bundler commands will be blocked. Defaults to true when
--deployment is used.
o gem.push_key (BUNDLE_GEM__PUSH_KEY): Sets the --key parameter for
gem push when using the rake release command with a private
gemstash server.
o gemfile (BUNDLE_GEMFILE): The name of the file that bundler should
use as the Gemfile. This location of this file also sets the root
of the project, which is used to resolve relative paths in the
Gemfile, among other things. By default, bundler will search up
from the current working directory until it finds a Gemfile.
o global_gem_cache (BUNDLE_GLOBAL_GEM_CACHE): Whether Bundler should
cache all gems globally, rather than locally to the installing Ruby
installation.
o ignore_messages (BUNDLE_IGNORE_MESSAGES): When set, no post install
messages will be printed. To silence a single gem, use dot notation
like ignore_messages.httparty true.
o init_gems_rb (BUNDLE_INIT_GEMS_RB) Generate a gems.rb instead of a
Gemfile when running bundle init.
o jobs (BUNDLE_JOBS): The number of gems Bundler can install in
parallel. Defaults to 1.
o no_install (BUNDLE_NO_INSTALL): Whether bundle package should skip
installing gems.
o no_prune (BUNDLE_NO_PRUNE): Whether Bundler should leave outdated
gems unpruned when caching.
o only_update_to_newer_versions
(BUNDLE_ONLY_UPDATE_TO_NEWER_VERSIONS): During bundle update, only
resolve to newer versions of the gems in the lockfile.
o path (BUNDLE_PATH): The location on disk where all gems in your
bundle will be located regardless of $GEM_HOME or $GEM_PATH values.
Bundle gems not found in this location will be installed by bundle
install. Defaults to Gem.dir. When --deployment is used, defaults
to vendor/bundle.
o path.system (BUNDLE_PATH__SYSTEM): Whether Bundler will install
gems into the default system path (Gem.dir).
o path_relative_to_cwd (BUNDLE_PATH_RELATIVE_TO_CWD) Makes --path
relative to the CWD instead of the Gemfile.
o plugins (BUNDLE_PLUGINS): Enable Bundler's experimental plugin
system.
o prefer_patch (BUNDLE_PREFER_PATCH): Prefer updating only to next
patch version during updates. Makes bundle update calls equivalent
to bundler update --patch.
o print_only_version_number (BUNDLE_PRINT_ONLY_VERSION_NUMBER) Print
only version number from bundler --version.
o redirect (BUNDLE_REDIRECT): The number of redirects allowed for
network requests. Defaults to 5.
o retry (BUNDLE_RETRY): The number of times to retry failed network
requests. Defaults to 3.
o setup_makes_kernel_gem_public
(BUNDLE_SETUP_MAKES_KERNEL_GEM_PUBLIC): Have Bundler.setup make the
Kernel#gem method public, even though RubyGems declares it as
private.
o shebang (BUNDLE_SHEBANG): The program name that should be invoked
for generated binstubs. Defaults to the ruby install name used to
generate the binstub.
o silence_deprecations (BUNDLE_SILENCE_DEPRECATIONS): Whether Bundler
should silence deprecation warnings for behavior that will be
changed in the next major version.
o silence_root_warning (BUNDLE_SILENCE_ROOT_WARNING): Silence the
warning Bundler prints when installing gems as root.
o specific_platform (BUNDLE_SPECIFIC_PLATFORM): Allow bundler to
resolve for the specific running platform and store it in the
lockfile, instead of only using a generic platform. A specific
platform is the exact platform triple reported by
Gem::Platform.local, such as x86_64-darwin-16 or
universal-java-1.8. On the other hand, generic platforms are those
such as ruby, mswin, or java. In this example, x86_64-darwin-16
would map to ruby and universal-java-1.8 to java.
o ssl_ca_cert (BUNDLE_SSL_CA_CERT): Path to a designated CA
certificate file or folder containing multiple certificates for
trusted CAs in PEM format.
o ssl_client_cert (BUNDLE_SSL_CLIENT_CERT): Path to a designated file
containing a X.509 client certificate and key in PEM format.
o ssl_verify_mode (BUNDLE_SSL_VERIFY_MODE): The SSL verification mode
Bundler uses when making HTTPS requests. Defaults to verify peer.
o suppress_install_using_messages
(BUNDLE_SUPPRESS_INSTALL_USING_MESSAGES): Avoid printing Using ...
messages during installation when the version of a gem has not
changed.
o system_bindir (BUNDLE_SYSTEM_BINDIR): The location where RubyGems
installs binstubs. Defaults to Gem.bindir.
o timeout (BUNDLE_TIMEOUT): The seconds allowed before timing out for
network requests. Defaults to 10.
o unlock_source_unlocks_spec (BUNDLE_UNLOCK_SOURCE_UNLOCKS_SPEC):
Whether running bundle update --source NAME unlocks a gem with the
given name. Defaults to true.
o update_requires_all_flag (BUNDLE_UPDATE_REQUIRES_ALL_FLAG) Require
passing --all to bundle update when everything should be updated,
and disallow passing no options to bundle update.
o user_agent (BUNDLE_USER_AGENT): The custom user agent fragment
Bundler includes in API requests.
o with (BUNDLE_WITH): A :-separated list of groups whose gems bundler
should install.
o without (BUNDLE_WITHOUT): A :-separated list of groups whose gems
bundler should not install.
In general, you should set these settings per-application by using the
applicable flag to the bundle install(1) bundle-install.1.html or
bundle package(1) bundle-package.1.html command.
You can set them globally either via environment variables or bundle
config, whichever is preferable for your setup. If you use both,
environment variables will take preference over global settings.
LOCAL GIT REPOS
Bundler also allows you to work against a git repository locally
instead of using the remote version. This can be achieved by setting up
a local override:
bundle config set local.GEM_NAME /path/to/local/git/repository
For example, in order to use a local Rack repository, a developer could
call:
bundle config set local.rack ~/Work/git/rack
Now instead of checking out the remote git repository, the local
override will be used. Similar to a path source, every time the local
git repository change, changes will be automatically picked up by
Bundler. This means a commit in the local git repo will update the
revision in the Gemfile.lock to the local git repo revision. This
requires the same attention as git submodules. Before pushing to the
remote, you need to ensure the local override was pushed, otherwise you
may point to a commit that only exists in your local machine. You'll
also need to CGI escape your usernames and passwords as well.
Bundler does many checks to ensure a developer won't work with invalid
references. Particularly, we force a developer to specify a branch in
the Gemfile in order to use this feature. If the branch specified in
the Gemfile and the current branch in the local git repository do not
match, Bundler will abort. This ensures that a developer is always
working against the correct branches, and prevents accidental locking
to a different branch.
Finally, Bundler also ensures that the current revision in the
Gemfile.lock exists in the local git repository. By doing this, Bundler
forces you to fetch the latest changes in the remotes.
MIRRORS OF GEM SOURCES
Bundler supports overriding gem sources with mirrors. This allows you
to configure rubygems.org as the gem source in your Gemfile while still
using your mirror to fetch gems.
bundle config set mirror.SOURCE_URL MIRROR_URL
For example, to use a mirror of rubygems.org hosted at
rubygems-mirror.org:
bundle config set mirror.http://rubygems.org http://rubygems-mirror.org
Each mirror also provides a fallback timeout setting. If the mirror
does not respond within the fallback timeout, Bundler will try to use
the original server instead of the mirror.
bundle config set mirror.SOURCE_URL.fallback_timeout TIMEOUT
For example, to fall back to rubygems.org after 3 seconds:
bundle config set mirror.https://rubygems.org.fallback_timeout 3
The default fallback timeout is 0.1 seconds, but the setting can
currently only accept whole seconds (for example, 1, 15, or 30).
CREDENTIALS FOR GEM SOURCES
Bundler allows you to configure credentials for any gem source, which
allows you to avoid putting secrets into your Gemfile.
bundle config set SOURCE_HOSTNAME USERNAME:PASSWORD
For example, to save the credentials of user claudette for the gem
source at gems.longerous.com, you would run:
bundle config set gems.longerous.com claudette:s00pers3krit
Or you can set the credentials as an environment variable like this:
export BUNDLE_GEMS__LONGEROUS__COM="claudette:s00pers3krit"
For gems with a git source with HTTP(S) URL you can specify credentials
like so:
bundle config set https://github.com/bundler/bundler.git username:password
Or you can set the credentials as an environment variable like so:
export BUNDLE_GITHUB__COM=username:password
This is especially useful for private repositories on hosts such as
Github, where you can use personal OAuth tokens:
export BUNDLE_GITHUB__COM=abcd0123generatedtoken:x-oauth-basic
CONFIGURE BUNDLER DIRECTORIES
Bundler's home, config, cache and plugin directories are able to be
configured through environment variables. The default location for
Bundler's home directory is ~/.bundle, which all directories inherit
from by default. The following outlines the available environment
variables and their default values
BUNDLE_USER_HOME : $HOME/.bundle
BUNDLE_USER_CACHE : $BUNDLE_USER_HOME/cache
BUNDLE_USER_CONFIG : $BUNDLE_USER_HOME/config
BUNDLE_USER_PLUGIN : $BUNDLE_USER_HOME/plugin
July 2020 BUNDLE-CONFIG(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-DOCTOR" "1" "July 2020" "" ""
.TH "BUNDLE\-DOCTOR" "1" "October 2020" "" ""
.
.SH "NAME"
\fBbundle\-doctor\fR \- Checks the bundle for common problems

Some files were not shown because too many files have changed in this diff Show more