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

Update the bundler version with master branch

This commit is contained in:
Hiroshi SHIBATA 2020-05-08 14:19:04 +09:00
parent 68224651a4
commit 0e60b59d58
Notes: git 2020-05-13 07:55:16 +09:00
226 changed files with 4605 additions and 3751 deletions

View file

@ -34,9 +34,9 @@ require_relative "bundler/build_metadata"
# of loaded and required modules. # of loaded and required modules.
# #
module Bundler module Bundler
environment_preserver = EnvironmentPreserver.new(ENV, EnvironmentPreserver::BUNDLER_KEYS) environment_preserver = EnvironmentPreserver.from_env
ORIGINAL_ENV = environment_preserver.restore ORIGINAL_ENV = environment_preserver.restore
ENV.replace(environment_preserver.backup) environment_preserver.replace_with_backup
SUDO_MUTEX = Mutex.new SUDO_MUTEX = Mutex.new
autoload :Definition, File.expand_path("bundler/definition", __dir__) autoload :Definition, File.expand_path("bundler/definition", __dir__)
@ -285,7 +285,13 @@ module Bundler
def app_config_path def app_config_path
if app_config = ENV["BUNDLE_APP_CONFIG"] if app_config = ENV["BUNDLE_APP_CONFIG"]
Pathname.new(app_config).expand_path(root) app_config_pathname = Pathname.new(app_config)
if app_config_pathname.absolute?
app_config_pathname
else
app_config_pathname.expand_path(root)
end
else else
root.join(".bundle") root.join(".bundle")
end end
@ -451,6 +457,10 @@ EOF
Bundler.settings[:system_bindir] || Bundler.rubygems.gem_bindir Bundler.settings[:system_bindir] || Bundler.rubygems.gem_bindir
end end
def preferred_gemfile_name
Bundler.settings[:init_gems_rb] ? "gems.rb" : "Gemfile"
end
def use_system_gems? def use_system_gems?
configured_bundle_path.use_system_gems? configured_bundle_path.use_system_gems?
end end
@ -512,7 +522,8 @@ EOF
Your user account isn't allowed to install to the system RubyGems. Your user account isn't allowed to install to the system RubyGems.
You can cancel this installation and run: You can cancel this installation and run:
bundle install --path vendor/bundle bundle config set --local path 'vendor/bundle'
bundle install
to install the gems into ./vendor/bundle/, or you can enter your password to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to RubyGems using sudo. and install the bundled gems to RubyGems using sudo.

View file

@ -24,21 +24,24 @@ Gem::Specification.new do |s|
if s.respond_to?(:metadata=) if s.respond_to?(:metadata=)
s.metadata = { s.metadata = {
"bug_tracker_uri" => "https://github.com/bundler/bundler/issues", "bug_tracker_uri" => "https://github.com/rubygems/bundler/issues",
"changelog_uri" => "https://github.com/bundler/bundler/blob/master/CHANGELOG.md", "changelog_uri" => "https://github.com/rubygems/bundler/blob/master/CHANGELOG.md",
"homepage_uri" => "https://bundler.io/", "homepage_uri" => "https://bundler.io/",
"source_code_uri" => "https://github.com/bundler/bundler/", "source_code_uri" => "https://github.com/rubygems/bundler/",
} }
end end
s.required_ruby_version = ">= 2.3.0" s.required_ruby_version = ">= 2.3.0"
s.required_rubygems_version = ">= 2.5.2" s.required_rubygems_version = ">= 2.5.2"
s.files = (Dir.glob("lib/bundler/**/*", File::FNM_DOTMATCH) + Dir.glob("man/bundler*") + Dir.glob("libexec/bundle*")).reject {|f| File.directory?(f) } s.files = Dir.glob("{lib,man,exe}/**/*", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
s.files += ["lib/bundler.rb"] # Include the CHANGELOG.md, LICENSE.md, README.md manually
s.files += %w[CHANGELOG.md LICENSE.md README.md]
# include the gemspec itself because warbler breaks w/o it
s.files += %w[bundler.gemspec]
s.bindir = "libexec" s.bindir = "exe"
s.executables = %w[bundle bundler] s.executables = %w[bundle bundler]
s.require_paths = ["lib"] s.require_paths = ["lib"]
end end

View file

@ -345,8 +345,8 @@ module Bundler
desc "list", "List all gems in the bundle" desc "list", "List all gems in the bundle"
method_option "name-only", :type => :boolean, :banner => "print only the gem names" method_option "name-only", :type => :boolean, :banner => "print only the gem names"
method_option "only-group", :type => :string, :banner => "print gems from a particular group" method_option "only-group", :type => :array, :default => [], :banner => "print gems from a given set of groups"
method_option "without-group", :type => :string, :banner => "print all gems except from a group" method_option "without-group", :type => :array, :default => [], :banner => "print all gems except from a given set of groups"
method_option "paths", :type => :boolean, :banner => "print the path to each gem in the bundle" method_option "paths", :type => :boolean, :banner => "print the path to each gem in the bundle"
def list def list
require_relative "cli/list" require_relative "cli/list"
@ -570,8 +570,9 @@ module Bundler
method_option :ext, :type => :boolean, :default => false, :desc => "Generate the boilerplate for C extension code" 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 :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 :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 :test, :type => :string, :lazy_default => "rspec", :aliases => "-t", :banner => "rspec", method_option :test, :type => :string, :lazy_default => "rspec", :aliases => "-t", :banner => "rspec",
:desc => "Generate a test directory for your library, either rspec or minitest. Set a default with `bundle config set gem.test rspec`." :desc => "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set gem.test rspec`."
def gem(name) def gem(name)
end end
@ -815,7 +816,7 @@ module Bundler
option = current_command.options[name] option = current_command.options[name]
flag_name = option.switch_name flag_name = option.switch_name
name_index = ARGV.find {|arg| flag_name == arg } name_index = ARGV.find {|arg| flag_name == arg.split("=")[0] }
return unless name_index return unless name_index
value = options[name] value = options[name]

View file

@ -12,7 +12,7 @@ module Bundler
Bundler::SharedHelpers.major_deprecation 2, "bundle console will be replaced " \ Bundler::SharedHelpers.major_deprecation 2, "bundle console will be replaced " \
"by `bin/console` generated by `bundle gem <name>`" "by `bin/console` generated by `bundle gem <name>`"
group ? Bundler.require(:default, *group.split(' ').map!(&:to_sym)) : Bundler.require group ? Bundler.require(:default, *group.split(" ").map!(&:to_sym)) : Bundler.require
ARGV.clear ARGV.clear
console = get_console(Bundler.settings[:console] || "irb") console = get_console(Bundler.settings[:console] || "irb")

View file

@ -12,6 +12,7 @@ module Bundler
TEST_FRAMEWORK_VERSIONS = { TEST_FRAMEWORK_VERSIONS = {
"rspec" => "3.0", "rspec" => "3.0",
"minitest" => "5.0", "minitest" => "5.0",
"test-unit" => "3.0",
}.freeze }.freeze
attr_reader :options, :gem_name, :thor, :name, :target attr_reader :options, :gem_name, :thor, :name, :target
@ -62,7 +63,7 @@ module Bundler
ensure_safe_gem_name(name, constant_array) ensure_safe_gem_name(name, constant_array)
templates = { templates = {
"Gemfile.tt" => "Gemfile", "#{Bundler.preferred_gemfile_name}.tt" => Bundler.preferred_gemfile_name,
"lib/newgem.rb.tt" => "lib/#{namespaced_path}.rb", "lib/newgem.rb.tt" => "lib/#{namespaced_path}.rb",
"lib/newgem/version.rb.tt" => "lib/#{namespaced_path}/version.rb", "lib/newgem/version.rb.tt" => "lib/#{namespaced_path}/version.rb",
"newgem.gemspec.tt" => "#{name}.gemspec", "newgem.gemspec.tt" => "#{name}.gemspec",
@ -92,16 +93,22 @@ module Bundler
"spec/spec_helper.rb.tt" => "spec/spec_helper.rb", "spec/spec_helper.rb.tt" => "spec/spec_helper.rb",
"spec/newgem_spec.rb.tt" => "spec/#{namespaced_path}_spec.rb" "spec/newgem_spec.rb.tt" => "spec/#{namespaced_path}_spec.rb"
) )
config[:test_task] = :spec
when "minitest" when "minitest"
templates.merge!( templates.merge!(
"test/test_helper.rb.tt" => "test/test_helper.rb", "test/minitest/test_helper.rb.tt" => "test/test_helper.rb",
"test/newgem_test.rb.tt" => "test/#{namespaced_path}_test.rb" "test/minitest/newgem_test.rb.tt" => "test/#{namespaced_path}_test.rb"
) )
config[:test_task] = :test
when "test-unit"
templates.merge!(
"test/test-unit/test_helper.rb.tt" => "test/test_helper.rb",
"test/test-unit/newgem_test.rb.tt" => "test/#{namespaced_path}_test.rb"
)
config[:test_task] = :test
end end
end end
config[:test_task] = config[:test] == "minitest" ? "test" : "spec"
if ask_and_set(:mit, "Do you want to license your code permissively under the MIT license?", if ask_and_set(:mit, "Do you want to license your code permissively under the MIT license?",
"This means that any other developer or company will be legally allowed to use your code " \ "This means that any other developer or company will be legally allowed to use your code " \
"for free as long as they admit you created it. You can read more about the MIT license " \ "for free as long as they admit you created it. You can read more about the MIT license " \
@ -124,6 +131,15 @@ module Bundler
templates.merge!("CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md") templates.merge!("CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md")
end end
if ask_and_set(:rubocop, "Do you want to add rubocop as a dependency for gems you generate?",
"RuboCop is a static code analyzer that has out-of-the-box rules for many " \
"of the guidelines in the community style guide. " \
"For more information, see the RuboCop docs (https://docs.rubocop.org/en/stable/) " \
"and the Ruby Style Guides (https://github.com/rubocop-hq/ruby-style-guide).")
config[:rubocop] = true
Bundler.ui.info "RuboCop enabled in config"
end
templates.merge!("exe/newgem.tt" => "exe/#{name}") if config[:exe] templates.merge!("exe/newgem.tt" => "exe/#{name}") if config[:exe]
if options[:ext] if options[:ext]
@ -199,9 +215,9 @@ module Bundler
if test_framework.nil? if test_framework.nil?
Bundler.ui.confirm "Do you want to generate tests with your gem?" Bundler.ui.confirm "Do you want to generate tests with your gem?"
result = Bundler.ui.ask "Type 'rspec' or 'minitest' to generate those test files now and " \ result = Bundler.ui.ask "Type 'rspec', 'minitest' or 'test-unit' to generate those test files now and " \
"in the future. rspec/minitest/(none):" "in the future. rspec/minitest/test-unit/(none):"
if result =~ /rspec|minitest/ if result =~ /rspec|minitest|test-unit/
test_framework = result test_framework = result
else else
test_framework = false test_framework = false

View file

@ -50,10 +50,17 @@ module Bundler
end end
def print_gem_info(spec) def print_gem_info(spec)
metadata = spec.metadata
gem_info = String.new gem_info = String.new
gem_info << " * #{spec.name} (#{spec.version}#{spec.git_version})\n" gem_info << " * #{spec.name} (#{spec.version}#{spec.git_version})\n"
gem_info << "\tSummary: #{spec.summary}\n" if spec.summary gem_info << "\tSummary: #{spec.summary}\n" if spec.summary
gem_info << "\tHomepage: #{spec.homepage}\n" if spec.homepage 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 << "\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")
gem_info << "\tMailing List: #{metadata["mailing_list_uri"]}\n" if metadata.key?("mailing_list_uri")
gem_info << "\tPath: #{spec.full_gem_path}\n" gem_info << "\tPath: #{spec.full_gem_path}\n"
gem_info << "\tDefault Gem: yes" if spec.respond_to?(:default_gem?) && spec.default_gem? gem_info << "\tDefault Gem: yes" if spec.respond_to?(:default_gem?) && spec.default_gem?
Bundler.ui.info gem_info Bundler.ui.info gem_info

View file

@ -41,7 +41,7 @@ module Bundler
private private
def gemfile def gemfile
@gemfile ||= Bundler.settings[:init_gems_rb] ? "gems.rb" : "Gemfile" @gemfile ||= Bundler.preferred_gemfile_name
end end
end end
end end

View file

@ -10,7 +10,7 @@ module Bundler
be sure to check out these resources: be sure to check out these resources:
1. Check out our troubleshooting guide for quick fixes to common issues: 1. Check out our troubleshooting guide for quick fixes to common issues:
https://github.com/bundler/bundler/blob/master/doc/TROUBLESHOOTING.md https://github.com/rubygems/bundler/blob/master/doc/TROUBLESHOOTING.md
2. Instructions for common Bundler uses can be found on the documentation 2. Instructions for common Bundler uses can be found on the documentation
site: https://bundler.io/ site: https://bundler.io/
@ -22,7 +22,7 @@ module Bundler
still aren't working the way you expect them to, please let us know so still aren't working the way you expect them to, please let us know so
that we can diagnose and help fix the problem you're having. Please that we can diagnose and help fix the problem you're having. Please
view the Filing Issues guide for more information: view the Filing Issues guide for more information:
https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md https://github.com/rubygems/bundler/blob/master/doc/contributing/ISSUES.md
EOS EOS

View file

@ -4,14 +4,16 @@ module Bundler
class CLI::List class CLI::List
def initialize(options) def initialize(options)
@options = options @options = options
@without_group = options["without-group"].map(&:to_sym)
@only_group = options["only-group"].map(&:to_sym)
end end
def run def run
raise InvalidOption, "The `--only-group` and `--without-group` options cannot be used together" if @options["only-group"] && @options["without-group"] raise InvalidOption, "The `--only-group` and `--without-group` options cannot be used together" if @only_group.any? && @without_group.any?
raise InvalidOption, "The `--name-only` and `--paths` options cannot be used together" if @options["name-only"] && @options[:paths] raise InvalidOption, "The `--name-only` and `--paths` options cannot be used together" if @options["name-only"] && @options[:paths]
specs = if @options["only-group"] || @options["without-group"] specs = if @only_group.any? || @without_group.any?
filtered_specs_by_groups filtered_specs_by_groups
else else
Bundler.load.specs Bundler.load.specs
@ -32,9 +34,9 @@ module Bundler
private private
def verify_group_exists(groups) def verify_group_exists(groups)
raise InvalidOption, "`#{@options["without-group"]}` group could not be found." if @options["without-group"] && !groups.include?(@options["without-group"].to_sym) (@without_group + @only_group).each do |group|
raise InvalidOption, "`#{group}` group could not be found." unless groups.include?(group)
raise InvalidOption, "`#{@options["only-group"]}` group could not be found." if @options["only-group"] && !groups.include?(@options["only-group"].to_sym) end
end end
def filtered_specs_by_groups def filtered_specs_by_groups
@ -44,10 +46,10 @@ module Bundler
verify_group_exists(groups) verify_group_exists(groups)
show_groups = show_groups =
if @options["without-group"] if @without_group.any?
groups.reject {|g| g == @options["without-group"].to_sym } groups.reject {|g| @without_group.include?(g) }
elsif @options["only-group"] elsif @only_group.any?
groups.select {|g| g == @options["only-group"].to_sym } groups.select {|g| @only_group.include?(g) }
else else
groups groups
end.map(&:to_sym) end.map(&:to_sym)

View file

@ -3,18 +3,16 @@
module Bundler module Bundler
class CLI::Outdated class CLI::Outdated
attr_reader :options, :gems, :options_include_groups, :filter_options_patch, :sources, :strict attr_reader :options, :gems, :options_include_groups, :filter_options_patch, :sources, :strict
attr_accessor :outdated_gems_by_groups, :outdated_gems_list attr_accessor :outdated_gems
def initialize(options, gems) def initialize(options, gems)
@options = options @options = options
@gems = gems @gems = gems
@sources = Array(options[:source]) @sources = Array(options[:source])
@filter_options_patch = options.keys & @filter_options_patch = options.keys & %w[filter-major filter-minor filter-patch]
%w[filter-major filter-minor filter-patch]
@outdated_gems_by_groups = {} @outdated_gems = []
@outdated_gems_list = []
@options_include_groups = [:group, :groups].any? do |v| @options_include_groups = [:group, :groups].any? do |v|
options.keys.include?(v.to_s) options.keys.include?(v.to_s)
@ -22,8 +20,7 @@ module Bundler
# the patch level options imply strict is also true. It wouldn't make # the patch level options imply strict is also true. It wouldn't make
# sense otherwise. # sense otherwise.
@strict = options["filter-strict"] || @strict = options["filter-strict"] || Bundler::CLI::Common.patch_level_options(options).any?
Bundler::CLI::Common.patch_level_options(options).any?
end end
def run def run
@ -76,58 +73,54 @@ module Bundler
end end
specs.sort_by(&:name).each do |current_spec| specs.sort_by(&:name).each do |current_spec|
next if !gems.empty? && !gems.include?(current_spec.name) next unless gems.empty? || gems.include?(current_spec.name)
dependency = current_dependencies[current_spec.name]
active_spec = retrieve_active_spec(definition, current_spec) active_spec = retrieve_active_spec(definition, current_spec)
next unless active_spec
next if active_spec.nil? next unless filter_options_patch.empty? || update_present_via_semver_portions(current_spec, active_spec, options)
next if filter_options_patch.any? &&
!update_present_via_semver_portions(current_spec, active_spec, options)
gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version) gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version)
next unless gem_outdated || (current_spec.git_version != active_spec.git_version) next unless gem_outdated || (current_spec.git_version != active_spec.git_version)
groups = nil
dependency = current_dependencies[current_spec.name]
groups = ""
if dependency && !options[:parseable] if dependency && !options[:parseable]
groups = dependency.groups.join(", ") groups = dependency.groups.join(", ")
end end
outdated_gems_list << { :active_spec => active_spec, outdated_gems << {
:current_spec => current_spec, :active_spec => active_spec,
:dependency => dependency, :current_spec => current_spec,
:groups => groups } :dependency => dependency,
:groups => groups,
outdated_gems_by_groups[groups] ||= [] }
outdated_gems_by_groups[groups] << outdated_gems_list[-1]
end end
if outdated_gems_list.empty? if outdated_gems.empty?
display_nothing_outdated_message
else
unless options[:parseable] unless options[:parseable]
Bundler.ui.info(header_outdated_message) Bundler.ui.info(nothing_outdated_message)
end end
else
if options_include_groups if options_include_groups
ordered_groups = outdated_gems_by_groups.keys.compact.sort relevant_outdated_gems = outdated_gems.group_by {|g| g[:groups] }.sort.flat_map do |groups, gems|
ordered_groups.insert(0, nil).each do |groups| contains_group = groups.split(", ").include?(options[:group])
gems = outdated_gems_by_groups[groups] next unless options[:groups] || contains_group
contains_group = if groups
groups.split(", ").include?(options[:group]) gems
else end.compact
options[:group] == "group"
if options[:parseable]
relevant_outdated_gems.each do |gems|
print_gems(gems)
end end
else
next if (!options[:groups] && !contains_group) || gems.nil? print_gems_table(relevant_outdated_gems)
unless options[:parseable]
Bundler.ui.info(header_group_message(groups))
end
print_gems(gems)
end end
elsif options[:parseable]
print_gems(outdated_gems)
else else
print_gems(outdated_gems_list) print_gems_table(outdated_gems)
end end
exit 1 exit 1
@ -140,22 +133,6 @@ module Bundler
"#{group_text}#{groups.split(",").size > 1 ? "s" : ""} \"#{groups}\"" "#{group_text}#{groups.split(",").size > 1 ? "s" : ""} \"#{groups}\""
end end
def header_outdated_message
if options[:pre]
"Outdated gems included in the bundle (including pre-releases):"
else
"Outdated gems included in the bundle:"
end
end
def header_group_message(groups)
if groups
"===== #{groups_text("Group", groups)} ====="
else
"===== Without group ====="
end
end
def nothing_outdated_message def nothing_outdated_message
if filter_options_patch.any? if filter_options_patch.any?
display = filter_options_patch.map do |o| display = filter_options_patch.map do |o|
@ -169,6 +146,8 @@ module Bundler
end end
def retrieve_active_spec(definition, current_spec) def retrieve_active_spec(definition, current_spec)
return unless current_spec.match_platform(Bundler.local_platform)
if strict if strict
active_spec = definition.find_resolved_spec(current_spec) active_spec = definition.find_resolved_spec(current_spec)
else else
@ -182,12 +161,6 @@ module Bundler
active_spec active_spec
end end
def display_nothing_outdated_message
unless options[:parseable]
Bundler.ui.info(nothing_outdated_message)
end
end
def print_gems(gems_list) def print_gems(gems_list)
gems_list.each do |gem| gems_list.each do |gem|
print_gem( print_gem(
@ -199,6 +172,19 @@ module Bundler
end end
end end
def print_gems_table(gems_list)
data = gems_list.map do |gem|
gem_column_for(
gem[:current_spec],
gem[:active_spec],
gem[:dependency],
gem[:groups],
)
end
print_indented([table_header] + data)
end
def print_gem(current_spec, active_spec, dependency, groups) def print_gem(current_spec, active_spec, dependency, groups)
spec_version = "#{active_spec.version}#{active_spec.git_version}" spec_version = "#{active_spec.version}#{active_spec.git_version}"
spec_version += " (from #{active_spec.loaded_from})" if Bundler.ui.debug? && active_spec.loaded_from spec_version += " (from #{active_spec.loaded_from})" if Bundler.ui.debug? && active_spec.loaded_from
@ -213,7 +199,7 @@ module Bundler
output_message = if options[:parseable] output_message = if options[:parseable]
spec_outdated_info.to_s spec_outdated_info.to_s
elsif options_include_groups || !groups elsif options_include_groups || groups.empty?
" * #{spec_outdated_info}" " * #{spec_outdated_info}"
else else
" * #{spec_outdated_info} in #{groups_text("group", groups)}" " * #{spec_outdated_info} in #{groups_text("group", groups)}"
@ -222,6 +208,16 @@ module Bundler
Bundler.ui.info output_message.rstrip Bundler.ui.info output_message.rstrip
end end
def gem_column_for(current_spec, active_spec, dependency, groups)
current_version = "#{current_spec.version}#{current_spec.git_version}"
spec_version = "#{active_spec.version}#{active_spec.git_version}"
dependency = dependency.requirement if dependency
ret_val = [active_spec.name, current_version, spec_version, dependency.to_s, groups.to_s]
ret_val << active_spec.loaded_from.to_s if Bundler.ui.debug?
ret_val
end
def check_for_deployment_mode! def check_for_deployment_mode!
return unless Bundler.frozen_bundle? return unless Bundler.frozen_bundle?
suggested_command = if Bundler.settings.locations("frozen")[:global] suggested_command = if Bundler.settings.locations("frozen")[:global]
@ -266,5 +262,34 @@ module Bundler
version_section = spec.version.segments[version_portion_index, 1] version_section = spec.version.segments[version_portion_index, 1]
version_section.to_a[0].to_i version_section.to_a[0].to_i
end end
def print_indented(matrix)
header = matrix[0]
data = matrix[1..-1]
column_sizes = Array.new(header.size) do |index|
matrix.max_by {|row| row[index].length }[index].length
end
Bundler.ui.info justify(header, column_sizes)
data.sort_by! {|row| row[0] }
data.each do |row|
Bundler.ui.info justify(row, column_sizes)
end
end
def table_header
header = ["Gem", "Current", "Latest", "Requested", "Groups"]
header << "Path" if Bundler.ui.debug?
header
end
def justify(row, sizes)
row.each_with_index.map do |element, index|
element.ljust(sizes[index])
end.join(" ").strip + "\n"
end
end end
end end

View file

@ -23,6 +23,16 @@ module Bundler
Bundler::Plugin.install(plugins, options) Bundler::Plugin.install(plugins, options)
end end
desc "uninstall PLUGINS", "Uninstall the plugins"
long_desc <<-D
Uninstall given list of plugins. To uninstall all the plugins, use -all option.
D
method_option "all", :type => :boolean, :default => nil, :banner =>
"Uninstall all the installed plugins. If no plugin is installed, then it does nothing."
def uninstall(*plugins)
Bundler::Plugin.uninstall(plugins, options)
end
desc "list", "List the installed plugins and available commands" desc "list", "List the installed plugins and available commands"
def list def list
Bundler::Plugin.list Bundler::Plugin.list

View file

@ -29,6 +29,11 @@ module Bundler
FileUtils.rm_rf spec.full_gem_path FileUtils.rm_rf spec.full_gem_path
when Source::Git when Source::Git
if source.local?
Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is locally overriden.")
next
end
source.remote! source.remote!
if extension_cache_path = source.extension_cache_path(spec) if extension_cache_path = source.extension_cache_path(spec)
FileUtils.rm_rf extension_cache_path FileUtils.rm_rf extension_cache_path

View file

@ -1,5 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require_relative "gem_parser"
module Bundler module Bundler
class CompactIndexClient class CompactIndexClient
class Cache class Cache
@ -92,19 +94,9 @@ module Bundler
header ? lines[header + 1..-1] : lines header ? lines[header + 1..-1] : lines
end end
def parse_gem(string) def parse_gem(line)
version_and_platform, rest = string.split(" ", 2) @gem_parser ||= GemParser.new
version, platform = version_and_platform.split("-", 2) @gem_parser.parse(line)
dependencies, requirements = rest.split("|", 2).map {|s| s.split(",") } if rest
dependencies = dependencies ? dependencies.map {|d| parse_dependency(d) } : []
requirements = requirements ? requirements.map {|r| parse_dependency(r) } : []
[version, platform, dependencies, requirements]
end
def parse_dependency(string)
dependency = string.split(":")
dependency[-1] = dependency[-1].split("&") if dependency.size > 1
dependency
end end
def info_roots def info_roots

View file

@ -0,0 +1,66 @@
# frozen_string_literal: true
module Bundler
class CompactIndexClient
class GemParser
def parse(line)
version_and_platform, rest = line.split(" ", 2)
version, platform = version_and_platform.split("-", 2)
dependencies, requirements = rest.split("|", 2) if rest
dependencies = dependencies ? parse_dependencies(dependencies) : []
requirements = requirements ? parse_requirements(requirements) : []
[version, platform, dependencies, requirements]
end
private
def parse_dependencies(raw_dependencies)
raw_dependencies.split(",").map {|d| parse_dependency(d) }
end
def parse_dependency(raw_dependency)
dependency = raw_dependency.split(":")
dependency[-1] = dependency[-1].split("&") if dependency.size > 1
dependency
end
# Parse the following format:
#
# line = "checksum:#{checksum}"
# line << ",ruby:#{ruby_version}" if ruby_version && ruby_version != ">= 0"
# line << ",rubygems:#{rubygems_version}" if rubygems_version && rubygems_version != ">= 0"
#
# See compact_index/gem_version.rb for details.
#
# We can't use parse_dependencies for requirements because "," in
# ruby_version and rubygems_version isn't escaped as "&". For example,
# "checksum:XXX,ruby:>=2.2, < 2.7.dev" can't be parsed as expected.
def parse_requirements(raw_requirements)
requirements = []
checksum = raw_requirements.match(/\A(checksum):([^,]+)/)
if checksum
requirements << [checksum[1], [checksum[2]]]
raw_requirements = checksum.post_match
if raw_requirements.start_with?(",")
raw_requirements = raw_requirements[1..-1]
end
end
rubygems = raw_requirements.match(/(rubygems):(.+)\z/)
if rubygems
raw_requirements = rubygems.pre_match
if raw_requirements.start_with?(",")
raw_requirements = raw_requirements[1..-1]
end
end
ruby = raw_requirements.match(/\A(ruby):(.+)\z/)
if ruby
requirements << [ruby[1], ruby[2].split(/\s*,\s*/)]
end
if rubygems
requirements << [rubygems[1], rubygems[2].split(/\s*,\s*/)]
end
requirements
end
end
end
end

View file

@ -77,12 +77,17 @@ module Bundler
@locked_bundler_version = nil @locked_bundler_version = nil
@locked_ruby_version = nil @locked_ruby_version = nil
@locked_specs_incomplete_for_platform = false @locked_specs_incomplete_for_platform = false
@new_platform = nil
if lockfile && File.exist?(lockfile) if lockfile && File.exist?(lockfile)
@lockfile_contents = Bundler.read_file(lockfile) @lockfile_contents = Bundler.read_file(lockfile)
@locked_gems = LockfileParser.new(@lockfile_contents) @locked_gems = LockfileParser.new(@lockfile_contents)
@locked_platforms = @locked_gems.platforms @locked_platforms = @locked_gems.platforms
@platforms = @locked_platforms.dup if Bundler.settings[:force_ruby_platform]
@platforms = [Gem::Platform::RUBY]
else
@platforms = @locked_platforms.dup
end
@locked_bundler_version = @locked_gems.bundler_version @locked_bundler_version = @locked_gems.bundler_version
@locked_ruby_version = @locked_gems.ruby_version @locked_ruby_version = @locked_gems.ruby_version
@ -113,7 +118,7 @@ module Bundler
end end
@unlocking ||= @unlock[:ruby] ||= (!@locked_ruby_version ^ !@ruby_version) @unlocking ||= @unlock[:ruby] ||= (!@locked_ruby_version ^ !@ruby_version)
add_current_platform unless Bundler.frozen_bundle? add_platforms unless Bundler.frozen_bundle?
converge_path_sources_to_gemspec_sources converge_path_sources_to_gemspec_sources
@path_changes = converge_paths @path_changes = converge_paths
@ -228,12 +233,13 @@ module Bundler
end end
def current_dependencies def current_dependencies
dependencies.select(&:should_include?) dependencies.select do |d|
d.should_include? && !d.gem_platforms(@platforms).empty?
end
end end
def specs_for(groups) def specs_for(groups)
deps = dependencies.select {|d| (d.groups & groups).any? } deps = dependencies_for(groups)
deps.delete_if {|d| !d.should_include? }
specs.for(expand_dependencies(deps)) specs.for(expand_dependencies(deps))
end end
@ -450,9 +456,9 @@ module Bundler
@locked_deps.each {|name, d| both_sources[name][1] = d.source } @locked_deps.each {|name, d| both_sources[name][1] = d.source }
both_sources.each do |name, (dep, lock_source)| both_sources.each do |name, (dep, lock_source)|
next unless (dep.nil? && !lock_source.nil?) || (!dep.nil? && !lock_source.nil? && !lock_source.can_lock?(dep)) next if lock_source.nil? || (dep && lock_source.can_lock?(dep))
gemfile_source_name = (dep && dep.source) || "no specified source" gemfile_source_name = (dep && dep.source) || "no specified source"
lockfile_source_name = lock_source || "no specified source" lockfile_source_name = lock_source
changed << "* #{name} from `#{gemfile_source_name}` to `#{lockfile_source_name}`" changed << "* #{name} from `#{gemfile_source_name}` to `#{lockfile_source_name}`"
end end
@ -518,10 +524,6 @@ module Bundler
raise InvalidOption, "Unable to remove the platform `#{platform}` since the only platforms are #{@platforms.join ", "}" raise InvalidOption, "Unable to remove the platform `#{platform}` since the only platforms are #{@platforms.join ", "}"
end end
def add_current_platform
current_platforms.each {|platform| add_platform(platform) }
end
def find_resolved_spec(current_spec) def find_resolved_spec(current_spec)
specs.find_by_name_and_platform(current_spec.name, current_spec.platform) specs.find_by_name_and_platform(current_spec.name, current_spec.platform)
end end
@ -543,6 +545,12 @@ module Bundler
private private
def add_platforms
(@dependencies.flat_map(&:expanded_platforms) + current_platforms).uniq.each do |platform|
add_platform(platform)
end
end
def current_platforms def current_platforms
current_platform = Bundler.local_platform current_platform = Bundler.local_platform
[].tap do |platforms| [].tap do |platforms|
@ -706,9 +714,6 @@ module Bundler
elsif dep.source elsif dep.source
dep.source = sources.get(dep.source) dep.source = sources.get(dep.source)
end end
if dep.source.is_a?(Source::Gemspec)
dep.platforms.concat(@platforms.map {|p| Dependency::REVERSE_PLATFORM_MAP[p] }.flatten(1)).uniq!
end
end end
changes = false changes = false
@ -858,8 +863,8 @@ module Bundler
@metadata_dependencies ||= begin @metadata_dependencies ||= begin
ruby_versions = concat_ruby_version_requirements(@ruby_version) ruby_versions = concat_ruby_version_requirements(@ruby_version)
if ruby_versions.empty? || !@ruby_version.exact? if ruby_versions.empty? || !@ruby_version.exact?
concat_ruby_version_requirements(RubyVersion.system) concat_ruby_version_requirements(RubyVersion.system, ruby_versions)
concat_ruby_version_requirements(locked_ruby_version_object) unless @unlock[:ruby] concat_ruby_version_requirements(locked_ruby_version_object, ruby_versions) unless @unlock[:ruby]
end end
[ [
Dependency.new("Ruby\0", ruby_versions), Dependency.new("Ruby\0", ruby_versions),
@ -890,27 +895,23 @@ module Bundler
dependencies.each do |dep| dependencies.each do |dep|
dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name) dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
next if !remote && !dep.current_platform? next if !remote && !dep.current_platform?
platforms = dep.gem_platforms(sorted_platforms) dep.gem_platforms(sorted_platforms).each do |p|
if platforms.empty? && !Bundler.settings[:disable_platform_warnings]
mapped_platforms = dep.expanded_platforms
Bundler.ui.warn \
"The dependency #{dep} will be unused by any of the platforms Bundler is installing for. " \
"Bundler is installing for #{@platforms.join ", "} but the dependency " \
"is only for #{mapped_platforms.join ", "}. " \
"To add those platforms to the bundle, " \
"run `bundle lock --add-platform #{mapped_platforms.join " "}`."
end
platforms.each do |p|
deps << DepProxy.new(dep, p) if remote || p == generic_local_platform deps << DepProxy.new(dep, p) if remote || p == generic_local_platform
end end
end end
deps deps
end end
def dependencies_for(groups)
current_dependencies.reject do |d|
(d.groups & groups).empty?
end
end
def requested_dependencies def requested_dependencies
groups = requested_groups groups = requested_groups
groups.map!(&:to_sym) groups.map!(&:to_sym)
dependencies.reject {|d| !d.should_include? || (d.groups & groups).empty? } dependencies_for(groups)
end end
def source_requirements def source_requirements

View file

@ -74,15 +74,6 @@ module Bundler
:x64_mingw_26 => Gem::Platform::X64_MINGW, :x64_mingw_26 => Gem::Platform::X64_MINGW,
}.freeze }.freeze
REVERSE_PLATFORM_MAP = {}.tap do |reverse_platform_map|
PLATFORM_MAP.each do |key, value|
reverse_platform_map[value] ||= []
reverse_platform_map[value] << key
end
reverse_platform_map.each {|_, platforms| platforms.freeze }
end.freeze
def initialize(name, version, options = {}, &blk) def initialize(name, version, options = {}, &blk)
type = options["type"] || :runtime type = options["type"] || :runtime
super(name, version, type) super(name, version, type)

View file

@ -75,8 +75,7 @@ module Bundler
@gemspecs << spec @gemspecs << spec
gem_platforms = Bundler::Dependency::REVERSE_PLATFORM_MAP[Bundler::GemHelpers.generic_local_platform] gem spec.name, :name => spec.name, :path => path, :glob => glob
gem spec.name, :name => spec.name, :path => path, :glob => glob, :platforms => gem_platforms
group(development_group) do group(development_group) do
spec.development_dependencies.each do |dep| spec.development_dependencies.each do |dep|

View file

@ -17,14 +17,38 @@ module Bundler
].map(&:freeze).freeze ].map(&:freeze).freeze
BUNDLER_PREFIX = "BUNDLER_ORIG_".freeze BUNDLER_PREFIX = "BUNDLER_ORIG_".freeze
# @param env [ENV] def self.from_env
new(env_to_hash(ENV), BUNDLER_KEYS)
end
def self.env_to_hash(env)
to_hash = env.to_hash
return to_hash unless Gem.win_platform?
to_hash.each_with_object({}) {|(k,v), a| a[k.upcase] = v }
end
# @param env [Hash]
# @param keys [Array<String>] # @param keys [Array<String>]
def initialize(env, keys) def initialize(env, keys)
@original = env.to_hash @original = env
@keys = keys @keys = keys
@prefix = BUNDLER_PREFIX @prefix = BUNDLER_PREFIX
end end
# Replaces `ENV` with the bundler environment variables backed up
def replace_with_backup
ENV.replace(backup) unless Gem.win_platform?
# Fallback logic for Windows below to workaround
# https://bugs.ruby-lang.org/issues/16798. Can be dropped once all
# supported rubies include the fix for that.
ENV.clear
backup.each {|k, v| ENV[k] = v }
end
# @return [Hash] # @return [Hash]
def backup def backup
env = @original.clone env = @original.clone

View file

@ -56,6 +56,7 @@ module Bundler
class SudoNotPermittedError < BundlerError; status_code(30); end class SudoNotPermittedError < BundlerError; status_code(30); end
class ThreadCreationError < BundlerError; status_code(33); end class ThreadCreationError < BundlerError; status_code(33); end
class APIResponseMismatchError < BundlerError; status_code(34); end class APIResponseMismatchError < BundlerError; status_code(34); end
class APIResponseInvalidDependenciesError < BundlerError; status_code(35); end
class GemfileEvalError < GemfileError; end class GemfileEvalError < GemfileError; end
class MarshalError < StandardError; end class MarshalError < StandardError; end

View file

@ -30,7 +30,6 @@ module Bundler
settings_flag(:allow_bundler_dependency_conflicts) { bundler_3_mode? } settings_flag(:allow_bundler_dependency_conflicts) { bundler_3_mode? }
settings_flag(:allow_offline_install) { bundler_3_mode? } settings_flag(:allow_offline_install) { bundler_3_mode? }
settings_flag(:auto_clean_without_path) { bundler_3_mode? } settings_flag(:auto_clean_without_path) { bundler_3_mode? }
settings_flag(:auto_config_jobs) { bundler_3_mode? }
settings_flag(:cache_all) { bundler_3_mode? } settings_flag(:cache_all) { bundler_3_mode? }
settings_flag(:default_install_uses_path) { bundler_3_mode? } settings_flag(:default_install_uses_path) { bundler_3_mode? }
settings_flag(:deployment_means_frozen) { bundler_3_mode? } settings_flag(:deployment_means_frozen) { bundler_3_mode? }

View file

@ -229,6 +229,7 @@ module Bundler
"BUILDBOX" => "buildbox", "BUILDBOX" => "buildbox",
"GO_SERVER_URL" => "go", "GO_SERVER_URL" => "go",
"SNAP_CI" => "snap", "SNAP_CI" => "snap",
"GITLAB_CI" => "gitlab",
"CI_NAME" => ENV["CI_NAME"], "CI_NAME" => ENV["CI_NAME"],
"CI" => "ci", "CI" => "ci",
} }

View file

@ -23,13 +23,7 @@ module Bundler
Bundler.ui.error error.message Bundler.ui.error error.message
when LoadError when LoadError
raise error unless error.message =~ /cannot load such file -- openssl|openssl.so|libcrypto.so/ raise error unless error.message =~ /cannot load such file -- openssl|openssl.so|libcrypto.so/
Bundler.ui.error "\nCould not load OpenSSL." Bundler.ui.error "\nCould not load OpenSSL. #{error.class}: #{error}\n#{error.backtrace.join("\n ")}"
Bundler.ui.warn <<-WARN, :wrap => true
You must recompile Ruby with OpenSSL support or change the sources in your \
Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL \
using RVM are available at https://rvm.io/packages/openssl.
WARN
Bundler.ui.trace error
when Interrupt when Interrupt
Bundler.ui.error "\nQuitting..." Bundler.ui.error "\nQuitting..."
Bundler.ui.trace error Bundler.ui.trace error
@ -82,7 +76,7 @@ module Bundler
I tried... I tried...
- **Have you read our issues document, https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md?** - **Have you read our issues document, https://github.com/rubygems/bundler/blob/master/doc/contributing/ISSUES.md?**
... ...
@ -106,7 +100,7 @@ module Bundler
#{issues_url(e)} #{issues_url(e)}
If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at: If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
https://github.com/bundler/bundler/issues/new https://github.com/rubygems/bundler/issues/new
EOS EOS
end end
@ -114,7 +108,7 @@ module Bundler
message = exception.message.lines.first.tr(":", " ").chomp message = exception.message.lines.first.tr(":", " ").chomp
message = message.split("-").first if exception.is_a?(Errno) message = message.split("-").first if exception.is_a?(Errno)
require "cgi" require "cgi"
"https://github.com/bundler/bundler/search?q=" \ "https://github.com/rubygems/bundler/search?q=" \
"#{CGI.escape(message)}&type=Issues" "#{CGI.escape(message)}&type=Issues"
end end
end end

View file

@ -25,8 +25,8 @@ module Bundler
attr_reader :spec_path, :base, :gemspec attr_reader :spec_path, :base, :gemspec
def initialize(base = nil, name = nil) def initialize(base = nil, name = nil)
@base = (base ||= SharedHelpers.pwd) @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")] : Dir[File.join(@base, "{,*}.gemspec")]
raise "Unable to determine name from existing gemspec. Use :name => 'gemname' in #install_tasks to manually set it." unless gemspecs.size == 1 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 @spec_path = gemspecs.first
@gemspec = Bundler.load_gemspec(@spec_path) @gemspec = Bundler.load_gemspec(@spec_path)
@ -73,7 +73,7 @@ module Bundler
def build_gem def build_gem
file_name = nil file_name = nil
sh("#{gem_command} build -V #{spec_path.shellescape}".shellsplit) do sh([*gem_command, "build", "-V", spec_path]) do
file_name = File.basename(built_gem_path) file_name = File.basename(built_gem_path)
SharedHelpers.filesystem_access(File.join(base, "pkg")) {|p| FileUtils.mkdir_p(p) } SharedHelpers.filesystem_access(File.join(base, "pkg")) {|p| FileUtils.mkdir_p(p) }
FileUtils.mv(built_gem_path, "pkg") FileUtils.mv(built_gem_path, "pkg")
@ -84,9 +84,9 @@ module Bundler
def install_gem(built_gem_path = nil, local = false) def install_gem(built_gem_path = nil, local = false)
built_gem_path ||= build_gem built_gem_path ||= build_gem
cmd = "#{gem_command} install #{built_gem_path}" cmd = [*gem_command, "install", built_gem_path.to_s]
cmd += " --local" if local cmd << "--local" if local
_, status = sh_with_status(cmd.shellsplit) _, status = sh_with_status(cmd)
unless status.success? unless status.success?
raise "Couldn't install gem, run `gem install #{built_gem_path}' for more detailed output" raise "Couldn't install gem, run `gem install #{built_gem_path}' for more detailed output"
end end
@ -96,11 +96,11 @@ module Bundler
protected protected
def rubygem_push(path) def rubygem_push(path)
cmd = %W[#{gem_command} push #{path}] cmd = [*gem_command, "push", path]
cmd << "--key" << gem_key if gem_key cmd << "--key" << gem_key if gem_key
cmd << "--host" << allowed_push_host if allowed_push_host cmd << "--host" << allowed_push_host if allowed_push_host
unless allowed_push_host || Bundler.user_home.join(".gem/credentials").file? unless allowed_push_host || Bundler.user_home.join(".gem/credentials").file?
raise "Your rubygems.org credentials aren't set. Run `gem push` to set them." raise "Your rubygems.org credentials aren't set. Run `gem signin` to set them."
end end
sh_with_input(cmd) sh_with_input(cmd)
Bundler.ui.confirm "Pushed #{name} #{version} to #{gem_push_host}" Bundler.ui.confirm "Pushed #{name} #{version} to #{gem_push_host}"
@ -210,7 +210,7 @@ module Bundler
end end
def gem_command def gem_command
ENV["GEM_COMMAND"] ? ENV["GEM_COMMAND"] : "gem" ENV["GEM_COMMAND"]&.shellsplit || ["gem"]
end end
end end
end end

View file

@ -7,7 +7,7 @@ module Bundler
# available dependency versions as found in its index, before returning it to # available dependency versions as found in its index, before returning it to
# to the resolution engine to select the best version. # to the resolution engine to select the best version.
class GemVersionPromoter class GemVersionPromoter
DEBUG = ENV["DEBUG_RESOLVER"] DEBUG = ENV["BUNDLER_DEBUG_RESOLVER"] || ENV["DEBUG_RESOLVER"]
attr_reader :level, :locked_specs, :unlock_gems attr_reader :level, :locked_specs, :unlock_gems

View file

@ -58,7 +58,7 @@ def gemfile(install = false, options = {}, &gemfile)
Bundler.ui = install ? ui : Bundler::UI::Silent.new Bundler.ui = install ? ui : Bundler::UI::Silent.new
if install || definition.missing_specs? if install || definition.missing_specs?
Bundler.settings.temporary(:inline => true, :disable_platform_warnings => true) do Bundler.settings.temporary(:inline => true) do
installer = Bundler::Installer.install(Bundler.root, definition, :system => true) installer = Bundler::Installer.install(Bundler.root, definition, :system => true)
installer.post_install_messages.each do |name, message| installer.post_install_messages.each do |name, message|
Bundler.ui.info "Post-install message from #{name}:\n#{message}" Bundler.ui.info "Post-install message from #{name}:\n#{message}"

View file

@ -204,18 +204,7 @@ module Bundler
return 1 unless can_install_in_parallel? return 1 unless can_install_in_parallel?
auto_config_jobs = Bundler.feature_flag.auto_config_jobs? Bundler.settings[:jobs] || processor_count
if jobs = Bundler.settings[:jobs]
if auto_config_jobs
jobs
else
[jobs.pred, 1].max
end
elsif auto_config_jobs
processor_count
else
1
end
end end
def processor_count def processor_count

View file

@ -19,11 +19,11 @@ module Bundler
Bundler.ui.debug "#{worker}: #{spec.name} (#{spec.version}) from #{spec.loaded_from}" Bundler.ui.debug "#{worker}: #{spec.name} (#{spec.version}) from #{spec.loaded_from}"
generate_executable_stubs generate_executable_stubs
return true, post_install_message return true, post_install_message
rescue Bundler::InstallHookError, Bundler::SecurityError, APIResponseMismatchError rescue Bundler::InstallHookError, Bundler::SecurityError, Bundler::APIResponseMismatchError
raise raise
rescue Errno::ENOSPC rescue Errno::ENOSPC
return false, out_of_space_message return false, out_of_space_message
rescue StandardError => e rescue Bundler::BundlerError, Gem::InstallError, Bundler::APIResponseInvalidDependenciesError => e
return false, specific_failure_message(e) return false, specific_failure_message(e)
end end

View file

@ -99,7 +99,7 @@ module Bundler
install_serially install_serially
end end
handle_error if @specs.any?(&:failed?) handle_error if failed_specs.any?
@specs @specs
ensure ensure
worker_pool && worker_pool.stop worker_pool && worker_pool.stop
@ -132,6 +132,10 @@ module Bundler
private private
def failed_specs
@specs.select(&:failed?)
end
def install_with_worker def install_with_worker
enqueue_specs enqueue_specs
process_specs until finished_installing? process_specs until finished_installing?
@ -156,11 +160,7 @@ module Bundler
gem_installer = Bundler::GemInstaller.new( gem_installer = Bundler::GemInstaller.new(
spec_install.spec, @installer, @standalone, worker_num, @force spec_install.spec, @installer, @standalone, worker_num, @force
) )
success, message = begin success, message = gem_installer.install_from_spec
gem_installer.install_from_spec
rescue RuntimeError => e
raise e, "#{e}\n\n#{require_tree_for_spec(spec_install.spec)}"
end
if success if success
spec_install.state = :installed spec_install.state = :installed
spec_install.post_install_message = message unless message.nil? spec_install.post_install_message = message unless message.nil?
@ -190,11 +190,11 @@ module Bundler
end end
def handle_error def handle_error
errors = @specs.select(&:failed?).map(&:error) errors = failed_specs.map(&:error)
if exception = errors.find {|e| e.is_a?(Bundler::BundlerError) } if exception = errors.find {|e| e.is_a?(Bundler::BundlerError) }
raise exception raise exception
end end
raise Bundler::InstallError, errors.map(&:to_s).join("\n\n") raise Bundler::InstallError, errors.join("\n\n")
end end
def require_tree_for_spec(spec) def require_tree_for_spec(spec)

View file

@ -46,6 +46,14 @@ module Bundler
identifier == other.identifier identifier == other.identifier
end end
def eql?(other)
identifier.eql?(other.identifier)
end
def hash
identifier.hash
end
def satisfies?(dependency) def satisfies?(dependency)
@name == dependency.name && dependency.requirement.satisfied_by?(Gem::Version.new(@version)) @name == dependency.name && dependency.requirement.satisfied_by?(Gem::Version.new(@version))
end end
@ -72,8 +80,13 @@ module Bundler
@specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name @specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name
source.gemspec.tap {|s| s.source = source } source.gemspec.tap {|s| s.source = source }
else else
search = source.specs.search(search_object).last platform_object = Gem::Platform.new(platform)
if search && Gem::Platform.new(search.platform) != Gem::Platform.new(platform) && !search.runtime_dependencies.-(dependencies.reject {|d| d.type == :development }).empty? candidates = source.specs.search(search_object)
same_platform_candidates = candidates.select do |spec|
MatchPlatform.platforms_match?(spec.platform, platform_object)
end
search = same_platform_candidates.last || candidates.last
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}) " \ Bundler.ui.warn "Unable to use the platform-specific (#{search.platform}) version of #{name} (#{version}) " \
"because it has different dependencies from the #{platform} 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 specific_platform true` and install again."

View file

@ -47,6 +47,32 @@ module Bundler
Bundler.ui.error "Failed to install plugin #{name}: #{e.message}\n #{e.backtrace.join("\n ")}" Bundler.ui.error "Failed to install plugin #{name}: #{e.message}\n #{e.backtrace.join("\n ")}"
end end
# Uninstalls plugins by the given names
#
# @param [Array<String>] names the names of plugins to be uninstalled
def uninstall(names, options)
if names.empty? && !options[:all]
Bundler.ui.error "No plugins to uninstall. Specify at least 1 plugin to uninstall.\n"\
"Use --all option to uninstall all the installed plugins."
return
end
names = index.installed_plugins if options[:all]
if names.any?
names.each do |name|
if index.installed?(name)
Bundler.rm_rf(index.plugin_path(name))
index.unregister_plugin(name)
Bundler.ui.info "Uninstalled plugin #{name}"
else
Bundler.ui.error "Plugin #{name} is not installed \n"
end
end
else
Bundler.ui.info "No plugins installed"
end
end
# List installed plugins and commands # List installed plugins and commands
# #
def list def list

View file

@ -71,6 +71,15 @@ module Bundler
raise raise
end end
def unregister_plugin(name)
@commands.delete_if {|_, v| v == name }
@sources.delete_if {|_, v| v == name }
@hooks.each {|_, plugin_names| plugin_names.delete(name) }
@plugin_paths.delete(name)
@load_paths.delete(name)
save_index
end
# Path of default index file # Path of default index file
def index_file def index_file
Plugin.root.join("index") Plugin.root.join("index")

View file

@ -26,12 +26,3 @@ module Bundler
YamlLibrarySyntaxError = ::ArgumentError YamlLibrarySyntaxError = ::ArgumentError
end end
end end
require_relative "deprecate"
begin
Bundler::Deprecate.skip_during do
require "rubygems/safe_yaml"
end
rescue LoadError
# it's OK if the file isn't there
end

View file

@ -50,6 +50,8 @@ module Bundler
# once the remote gem is downloaded, the backend specification will # once the remote gem is downloaded, the backend specification will
# be swapped out. # be swapped out.
def __swap__(spec) def __swap__(spec)
raise APIResponseInvalidDependenciesError unless spec.dependencies.all? {|d| d.is_a?(Gem::Dependency) }
SharedHelpers.ensure_same_dependencies(self, dependencies, spec.dependencies) SharedHelpers.ensure_same_dependencies(self, dependencies, spec.dependencies)
@_remote_specification = spec @_remote_specification = spec
end end
@ -76,7 +78,8 @@ module Bundler
deps = method_missing(:dependencies) deps = method_missing(:dependencies)
# allow us to handle when the specs dependencies are an array of array of string # allow us to handle when the specs dependencies are an array of array of string
# see https://github.com/bundler/bundler/issues/5797 # in order to delay the crash to `#__swap__` where it results in a friendlier error
# see https://github.com/rubygems/bundler/issues/5797
deps = deps.map {|d| d.is_a?(Gem::Dependency) ? d : Gem::Dependency.new(*d) } deps = deps.map {|d| d.is_a?(Gem::Dependency) ? d : Gem::Dependency.new(*d) }
deps deps

View file

@ -75,12 +75,17 @@ module Bundler
return unless debug? return unless debug?
debug_info = yield debug_info = yield
debug_info = debug_info.inspect unless debug_info.is_a?(String) debug_info = debug_info.inspect unless debug_info.is_a?(String)
warn debug_info.split("\n").map {|s| " " * depth + s } warn debug_info.split("\n").map {|s| "BUNDLER: " + " " * depth + s }
end end
def debug? def debug?
return @debug_mode if defined?(@debug_mode) return @debug_mode if defined?(@debug_mode)
@debug_mode = ENV["DEBUG_RESOLVER"] || ENV["DEBUG_RESOLVER_TREE"] || false @debug_mode =
ENV["BUNDLER_DEBUG_RESOLVER"] ||
ENV["BUNDLER_DEBUG_RESOLVER_TREE"] ||
ENV["DEBUG_RESOLVER"] ||
ENV["DEBUG_RESOLVER_TREE"] ||
false
end end
def before_resolution def before_resolution
@ -146,7 +151,26 @@ module Bundler
@gem_version_promoter.sort_versions(dependency, spec_groups) @gem_version_promoter.sort_versions(dependency, spec_groups)
end end
end end
search.select {|sg| sg.for?(platform) }.each {|sg| sg.activate_platform!(platform) } selected_sgs = []
search.each do |sg|
next unless sg.for?(platform)
# Add a spec group for "non platform specific spec" as the fallback
# 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|
if sg_all_platforms.nil?
sg_all_platforms = sg.copy_for(other_platform)
else
sg_all_platforms.activate_platform!(other_platform)
end
end
selected_sgs << sg_all_platforms
end
selected_sgs
end end
def index_for(dependency) def index_for(dependency)
@ -183,9 +207,7 @@ module Bundler
end end
def requirement_satisfied_by?(requirement, activated, spec) def requirement_satisfied_by?(requirement, activated, spec)
return false unless requirement.matches_spec?(spec) || spec.source.is_a?(Source::Gemspec) requirement.matches_spec?(spec) || spec.source.is_a?(Source::Gemspec)
spec.activate_platform!(requirement.__platform) if !@platforms || @platforms.include?(requirement.__platform)
true
end end
def relevant_sources_for_vertex(vertex) def relevant_sources_for_vertex(vertex)
@ -223,8 +245,9 @@ module Bundler
end end
def self.platform_sort_key(platform) def self.platform_sort_key(platform)
return ["", "", ""] if Gem::Platform::RUBY == platform # Prefer specific platform to not specific platform
platform.to_a.map {|part| part || "" } return ["99-LAST", "", "", ""] if Gem::Platform::RUBY == platform
["00", *platform.to_a.map {|part| part || "" }]
end end
private private

View file

@ -9,6 +9,7 @@ module Bundler
attr_accessor :ignores_bundler_dependencies attr_accessor :ignores_bundler_dependencies
def initialize(all_specs) def initialize(all_specs)
@all_specs = all_specs
raise ArgumentError, "cannot initialize with an empty value" unless exemplary_spec = all_specs.first raise ArgumentError, "cannot initialize with an empty value" unless exemplary_spec = all_specs.first
@name = exemplary_spec.name @name = exemplary_spec.name
@version = exemplary_spec.version @version = exemplary_spec.version
@ -28,7 +29,7 @@ module Bundler
lazy_spec = LazySpecification.new(name, version, s.platform, source) lazy_spec = LazySpecification.new(name, version, s.platform, source)
lazy_spec.dependencies.replace s.dependencies lazy_spec.dependencies.replace s.dependencies
lazy_spec lazy_spec
end.compact end.compact.uniq
end end
def activate_platform!(platform) def activate_platform!(platform)
@ -37,13 +38,25 @@ module Bundler
@activated_platforms << platform @activated_platforms << platform
end end
def copy_for(platform)
copied_sg = self.class.new(@all_specs)
copied_sg.ignores_bundler_dependencies = @ignores_bundler_dependencies
return nil unless copied_sg.for?(platform)
copied_sg.activate_platform!(platform)
copied_sg
end
def spec_for(platform)
@specs[platform]
end
def for?(platform) def for?(platform)
spec = @specs[platform] !spec_for(platform).nil?
!spec.nil?
end end
def to_s def to_s
@to_s ||= "#{name} (#{version})" activated_platforms_string = sorted_activated_platforms.join(", ")
"#{name} (#{version}) (#{activated_platforms_string})"
end end
def dependencies_for_activated_platforms def dependencies_for_activated_platforms
@ -58,6 +71,7 @@ module Bundler
return unless other.is_a?(SpecGroup) return unless other.is_a?(SpecGroup)
name == other.name && name == other.name &&
version == other.version && version == other.version &&
sorted_activated_platforms == other.sorted_activated_platforms &&
source == other.source source == other.source
end end
@ -65,11 +79,18 @@ module Bundler
return unless other.is_a?(SpecGroup) return unless other.is_a?(SpecGroup)
name.eql?(other.name) && name.eql?(other.name) &&
version.eql?(other.version) && version.eql?(other.version) &&
sorted_activated_platforms.eql?(other.sorted_activated_platforms) &&
source.eql?(other.source) source.eql?(other.source)
end end
def hash def hash
to_s.hash ^ source.hash name.hash ^ version.hash ^ sorted_activated_platforms.hash ^ source.hash
end
protected
def sorted_activated_platforms
@activated_platforms.sort_by(&:to_s)
end end
private private

View file

@ -51,7 +51,8 @@ module Gem
alias_method :rg_extension_dir, :extension_dir alias_method :rg_extension_dir, :extension_dir
def extension_dir def extension_dir
@bundler_extension_dir ||= if source.respond_to?(:extension_dir_name) @bundler_extension_dir ||= if source.respond_to?(:extension_dir_name)
File.expand_path(File.join(extensions_dir, source.extension_dir_name)) unique_extension_dir = [source.extension_dir_name, File.basename(full_gem_path)].uniq.join("-")
File.expand_path(File.join(extensions_dir, unique_extension_dir))
else else
rg_extension_dir rg_extension_dir
end end

View file

@ -346,7 +346,7 @@ module Bundler
raise e raise e
end end
# backwards compatibility shim, see https://github.com/bundler/bundler/issues/5102 # backwards compatibility shim, see https://github.com/rubygems/bundler/issues/5102
kernel_class.send(:public, :gem) if Bundler.feature_flag.setup_makes_kernel_gem_public? kernel_class.send(:public, :gem) if Bundler.feature_flag.setup_makes_kernel_gem_public?
end end
end end
@ -443,35 +443,6 @@ module Bundler
Gem.clear_paths Gem.clear_paths
end end
# This backports base_dir which replaces installation path
# RubyGems 1.8+
def backport_base_dir
redefine_method(Gem::Specification, :base_dir) do
return Gem.dir unless loaded_from
File.dirname File.dirname loaded_from
end
end
def backport_cache_file
redefine_method(Gem::Specification, :cache_dir) do
@cache_dir ||= File.join base_dir, "cache"
end
redefine_method(Gem::Specification, :cache_file) do
@cache_file ||= File.join cache_dir, "#{full_name}.gem"
end
end
def backport_spec_file
redefine_method(Gem::Specification, :spec_dir) do
@spec_dir ||= File.join base_dir, "specifications"
end
redefine_method(Gem::Specification, :spec_file) do
@spec_file ||= File.join spec_dir, "#{full_name}.gemspec"
end
end
def undo_replacements def undo_replacements
@replaced_methods.each do |(sym, klass), method| @replaced_methods.each do |(sym, klass), method|
redefine_method(klass, sym, method) redefine_method(klass, sym, method)
@ -602,10 +573,10 @@ module Bundler
def backport_ext_builder_monitor def backport_ext_builder_monitor
# So we can avoid requiring "rubygems/ext" in its entirety # So we can avoid requiring "rubygems/ext" in its entirety
Gem.module_eval <<-RB, __FILE__, __LINE__ + 1 Gem.module_eval <<-RUBY, __FILE__, __LINE__ + 1
module Ext module Ext
end end
RB RUBY
require "rubygems/ext/builder" require "rubygems/ext/builder"

View file

@ -12,7 +12,6 @@ module Bundler
allow_offline_install allow_offline_install
auto_clean_without_path auto_clean_without_path
auto_install auto_install
auto_config_jobs
cache_all cache_all
cache_all_platforms cache_all_platforms
default_install_uses_path default_install_uses_path
@ -22,7 +21,6 @@ module Bundler
disable_exec_load disable_exec_load
disable_local_branch_check disable_local_branch_check
disable_multisource disable_multisource
disable_platform_warnings
disable_shared_gems disable_shared_gems
disable_version_check disable_version_check
force_ruby_platform force_ruby_platform

View file

@ -230,6 +230,10 @@ module Bundler
@allow_remote || @allow_cached @allow_remote || @allow_cached
end end
def local?
@local
end
private private
def serialize_gemspecs_in(destination) def serialize_gemspecs_in(destination)
@ -256,10 +260,6 @@ module Bundler
cached_revision && super cached_revision && super
end end
def local?
@local
end
def requires_checkout? def requires_checkout?
allow_git_ops? && !local? && !cached_revision_checked_out? allow_git_ops? && !local? && !cached_revision_checked_out?
end end

View file

@ -18,7 +18,7 @@ module Bundler
def initialize(command) def initialize(command)
msg = String.new msg = String.new
msg << "Bundler is trying to run a `git #{command}` at runtime. You probably need to run `bundle install`. However, " msg << "Bundler is trying to run a `git #{command}` at runtime. You probably need to run `bundle install`. However, "
msg << "this error message could probably be more useful. Please submit a ticket at https://github.com/bundler/bundler/issues " msg << "this error message could probably be more useful. Please submit a ticket at https://github.com/rubygems/bundler/issues "
msg << "with steps to reproduce as well as the following\n\nCALLER: #{caller.join("\n")}" msg << "with steps to reproduce as well as the following\n\nCALLER: #{caller.join("\n")}"
super msg super msg
end end
@ -27,21 +27,21 @@ module Bundler
class GitCommandError < GitError class GitCommandError < GitError
attr_reader :command attr_reader :command
def initialize(command, path = nil, extra_info = nil) def initialize(command, path, destination_path, extra_info = nil)
@command = command @command = command
msg = String.new msg = String.new
msg << "Git error: command `git #{command}` in directory #{SharedHelpers.pwd} has failed." msg << "Git error: command `git #{command}` in directory #{destination_path} has failed."
msg << "\n#{extra_info}" if extra_info msg << "\n#{extra_info}" if extra_info
msg << "\nIf this error persists you could try removing the cache directory '#{path}'" if path && path.exist? msg << "\nIf this error persists you could try removing the cache directory '#{path}'" if path.exist?
super msg super msg
end end
end end
class MissingGitRevisionError < GitCommandError class MissingGitRevisionError < GitCommandError
def initialize(command, path, ref, repo) def initialize(command, path, destination_path, ref, repo)
msg = "Revision #{ref} does not exist in the repository #{repo}. Maybe you misspelled it?" msg = "Revision #{ref} does not exist in the repository #{repo}. Maybe you misspelled it?"
super command, path, msg super command, path, destination_path, msg
end end
end end
@ -62,26 +62,18 @@ module Bundler
end end
def revision def revision
return @revision if @revision @revision ||= find_local_revision
begin
@revision ||= find_local_revision
rescue GitCommandError => e
raise MissingGitRevisionError.new(e.command, path, ref, URICredentialsFilter.credential_filtered_uri(uri))
end
@revision
end end
def branch def branch
@branch ||= allowed_in_path do @branch ||= allowed_with_path do
git("rev-parse --abbrev-ref HEAD").strip git("rev-parse --abbrev-ref HEAD", :dir => path).strip
end end
end end
def contains?(commit) def contains?(commit)
allowed_in_path do allowed_with_path do
result, status = git_null("branch --contains #{commit}") result, status = git_null("branch --contains #{commit}", :dir => path)
status.success? && result =~ /^\* (.*)$/ status.success? && result =~ /^\* (.*)$/
end end
end end
@ -108,8 +100,8 @@ module Bundler
return unless extra_ref return unless extra_ref
end end
in_path do with_path do
git_retry %(fetch --force --quiet --tags #{uri_escaped_with_configured_credentials} "refs/heads/*:refs/heads/*" #{extra_ref}) git_retry %(fetch --force --quiet --tags #{uri_escaped_with_configured_credentials} "refs/heads/*:refs/heads/*" #{extra_ref}), :dir => path
end end
end end
@ -133,58 +125,54 @@ module Bundler
end end
end end
# method 2 # method 2
SharedHelpers.chdir(destination) do git_retry %(fetch --force --quiet --tags "#{path}"), :dir => destination
git_retry %(fetch --force --quiet --tags "#{path}")
begin begin
git "reset --hard #{@revision}" git "reset --hard #{@revision}", :dir => destination
rescue GitCommandError => e rescue GitCommandError => e
raise MissingGitRevisionError.new(e.command, path, @revision, URICredentialsFilter.credential_filtered_uri(uri)) raise MissingGitRevisionError.new(e.command, path, destination, @revision, URICredentialsFilter.credential_filtered_uri(uri))
end end
if submodules if submodules
git_retry "submodule update --init --recursive" git_retry "submodule update --init --recursive", :dir => destination
elsif Gem::Version.create(version) >= Gem::Version.create("2.9.0") elsif Gem::Version.create(version) >= Gem::Version.create("2.9.0")
git_retry "submodule deinit --all --force" git_retry "submodule deinit --all --force", :dir => destination
end
end end
end end
private private
def git_null(command) def git_null(command, dir: SharedHelpers.pwd)
command_with_no_credentials = URICredentialsFilter.credential_filtered_string(command, uri) check_allowed(command)
raise GitNotAllowedError.new(command_with_no_credentials) unless allow?
out, status = SharedHelpers.with_clean_git_env do out, status = SharedHelpers.with_clean_git_env do
capture_and_ignore_stderr("git #{command}") capture_and_ignore_stderr("git #{command}", :chdir => dir.to_s)
end end
[URICredentialsFilter.credential_filtered_string(out, uri), status] [URICredentialsFilter.credential_filtered_string(out, uri), status]
end end
def git_retry(command) def git_retry(command, dir: SharedHelpers.pwd)
Bundler::Retry.new("`git #{URICredentialsFilter.credential_filtered_string(command, uri)}`", GitNotAllowedError).attempts do Bundler::Retry.new("`git #{URICredentialsFilter.credential_filtered_string(command, uri)}`", GitNotAllowedError).attempts do
git(command) git(command, :dir => dir)
end end
end end
def git(command, check_errors = true, error_msg = nil) def git(command, dir: SharedHelpers.pwd)
command_with_no_credentials = URICredentialsFilter.credential_filtered_string(command, uri) command_with_no_credentials = check_allowed(command)
raise GitNotAllowedError.new(command_with_no_credentials) unless allow?
out, status = SharedHelpers.with_clean_git_env do out, status = SharedHelpers.with_clean_git_env do
capture_and_filter_stderr(uri, "git #{command}") capture_and_filter_stderr(uri, "git #{command}", :chdir => dir.to_s)
end end
stdout_with_no_credentials = URICredentialsFilter.credential_filtered_string(out, uri) raise GitCommandError.new(command_with_no_credentials, path, dir) unless status.success?
raise GitCommandError.new(command_with_no_credentials, path, error_msg) if check_errors && !status.success?
stdout_with_no_credentials URICredentialsFilter.credential_filtered_string(out, uri)
end end
def has_revision_cached? def has_revision_cached?
return unless @revision return unless @revision
in_path { git("cat-file -e #{@revision}") } with_path { git("cat-file -e #{@revision}", :dir => path) }
true true
rescue GitError rescue GitError
false false
@ -195,9 +183,11 @@ module Bundler
end end
def find_local_revision def find_local_revision
allowed_in_path do allowed_with_path do
git("rev-parse --verify #{Shellwords.shellescape(ref)}", true).strip git("rev-parse --verify #{Shellwords.shellescape(ref)}", :dir => path).strip
end end
rescue GitCommandError => e
raise MissingGitRevisionError.new(e.command, path, path, ref, URICredentialsFilter.credential_filtered_uri(uri))
end end
# Escape the URI for git commands # Escape the URI for git commands
@ -230,27 +220,32 @@ module Bundler
@git ? @git.allow_git_ops? : true @git ? @git.allow_git_ops? : true
end end
def in_path(&blk) def with_path(&blk)
checkout unless path.exist? checkout unless path.exist?
_ = URICredentialsFilter # load it before we chdir blk.call
SharedHelpers.chdir(path, &blk)
end end
def allowed_in_path def allowed_with_path
return in_path { yield } if allow? return with_path { yield } if allow?
raise GitError, "The git source #{uri} is not yet checked out. Please run `bundle install` before trying to start your application" raise GitError, "The git source #{uri} is not yet checked out. Please run `bundle install` before trying to start your application"
end end
def capture_and_filter_stderr(uri, cmd) def check_allowed(command)
command_with_no_credentials = URICredentialsFilter.credential_filtered_string(command, uri)
raise GitNotAllowedError.new(command_with_no_credentials) unless allow?
command_with_no_credentials
end
def capture_and_filter_stderr(uri, cmd, chdir: SharedHelpers.pwd)
require "open3" require "open3"
return_value, captured_err, status = Open3.capture3(cmd) return_value, captured_err, status = Open3.capture3(cmd, :chdir => chdir)
Bundler.ui.warn URICredentialsFilter.credential_filtered_string(captured_err, uri) if uri && !captured_err.empty? Bundler.ui.warn URICredentialsFilter.credential_filtered_string(captured_err, uri) if uri && !captured_err.empty?
[return_value, status] [return_value, status]
end end
def capture_and_ignore_stderr(cmd) def capture_and_ignore_stderr(cmd, chdir: SharedHelpers.pwd)
require "open3" require "open3"
return_value, _, status = Open3.capture3(cmd) return_value, _, status = Open3.capture3(cmd, :chdir => chdir)
[return_value, status] [return_value, status]
end end
end end

View file

@ -132,7 +132,11 @@ module Bundler
end end
def expand(somepath) def expand(somepath)
somepath.expand_path(root_path) if Bundler.current_ruby.jruby? # TODO: Unify when https://github.com/rubygems/bundler/issues/7598 fixed upstream and all supported jrubies include the fix
somepath.expand_path(root_path).expand_path
else
somepath.expand_path(root_path)
end
rescue ArgumentError => e rescue ArgumentError => e
Bundler.ui.debug(e) Bundler.ui.debug(e)
raise PathError, "There was an error while trying to use the path " \ raise PathError, "There was an error while trying to use the path " \

View file

@ -26,18 +26,16 @@ module Bundler
end end
def post_install def post_install
SharedHelpers.chdir(@gem_dir) do run_hooks(:pre_install)
run_hooks(:pre_install)
unless @disable_extensions unless @disable_extensions
build_extensions build_extensions
run_hooks(:post_build) run_hooks(:post_build)
end
generate_bin unless spec.executables.nil? || spec.executables.empty?
run_hooks(:post_install)
end end
generate_bin unless spec.executables.nil? || spec.executables.empty?
run_hooks(:post_install)
ensure ensure
Bundler.rm_rf(@tmp_dir) if Bundler.requires_sudo? Bundler.rm_rf(@tmp_dir) if Bundler.requires_sudo?
end end

View file

@ -2,73 +2,83 @@
## Our Pledge ## Our Pledge
In the interest of fostering an open and welcoming environment, we as We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
## Our Standards ## Our Standards
Examples of behavior that contributes to creating a positive environment Examples of behavior that contributes to a positive environment for our community include:
include:
* Using welcoming and inclusive language * Demonstrating empathy and kindness toward other people
* Being respectful of differing viewpoints and experiences * Being respectful of differing opinions, viewpoints, and experiences
* Gracefully accepting constructive criticism * Giving and gracefully accepting constructive feedback
* Focusing on what is best for the community * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Showing empathy towards other community members * Focusing on what is best not just for us as individuals, but for the overall community
Examples of unacceptable behavior by participants include: Examples of unacceptable behavior include:
* The use of sexualized language or imagery and unwelcome sexual attention or * The use of sexualized language or imagery, and sexual attention or
advances advances of any kind
* Trolling, insulting/derogatory comments, and personal or political attacks * Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment * Public or private harassment
* Publishing others' private information, such as a physical or electronic * Publishing others' private information, such as a physical or email
address, without explicit permission address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a * Other conduct which could reasonably be considered inappropriate in a
professional setting professional setting
## Our Responsibilities ## Enforcement Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope ## Scope
This Code of Conduct applies both within project spaces and in public spaces This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement ## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at <%= config[:email] %>. All complaints will be reviewed and investigated promptly and fairly.
reported by contacting the project team at <%= config[:email] %>. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good All community leaders are obligated to respect the privacy and security of the reporter of any incident.
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership. ## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of actions.
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the community.
## Attribution ## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
available at [https://contributor-covenant.org/version/1/4][version] available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
[homepage]: https://contributor-covenant.org Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
[version]: https://contributor-covenant.org/version/1/4/
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

View file

@ -3,10 +3,13 @@ source "https://rubygems.org"
# Specify your gem's dependencies in <%= config[:name] %>.gemspec # Specify your gem's dependencies in <%= config[:name] %>.gemspec
gemspec gemspec
gem "rake", "~> 12.0" gem "rake", "~> 13.0"
<%- if config[:ext] -%> <%- if config[:ext] -%>
gem "rake-compiler" gem "rake-compiler"
<%- end -%> <%- end -%>
<%- if config[:test] -%> <%- if config[:test] -%>
gem "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>" gem "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>"
<%- end -%> <%- end -%>
<%- if config[:rubocop] -%>
gem "rubocop"
<%- end -%>

View file

@ -1,5 +1,7 @@
require "bundler/gem_tasks" require "bundler/gem_tasks"
<% if config[:test] == "minitest" -%> <% default_task_names = [config[:test_task]].compact -%>
<% case config[:test] -%>
<% when "minitest", "test-unit" -%>
require "rake/testtask" require "rake/testtask"
Rake::TestTask.new(:test) do |t| Rake::TestTask.new(:test) do |t|
@ -8,13 +10,21 @@ Rake::TestTask.new(:test) do |t|
t.test_files = FileList["test/**/*_test.rb"] t.test_files = FileList["test/**/*_test.rb"]
end end
<% elsif config[:test] == "rspec" -%> <% when "rspec" -%>
require "rspec/core/rake_task" require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec) RSpec::Core::RakeTask.new(:spec)
<% end -%>
<% if config[:rubocop] -%>
<% default_task_names << :rubocop -%>
require "rubocop/rake_task"
RuboCop::RakeTask.new
<% end -%> <% end -%>
<% if config[:ext] -%> <% if config[:ext] -%>
<% default_task_names.unshift(:clobber, :compile) -%>
require "rake/extensiontask" require "rake/extensiontask"
task :build => :compile task :build => :compile
@ -23,7 +33,5 @@ Rake::ExtensionTask.new("<%= config[:underscored_name] %>") do |ext|
ext.lib_dir = "lib/<%= config[:namespaced_path] %>" ext.lib_dir = "lib/<%= config[:namespaced_path] %>"
end end
task :default => [:clobber, :compile, :<%= config[:test_task] %>]
<% else -%>
task :default => :<%= config[:test_task] %>
<% end -%> <% end -%>
task :default => <%= default_task_names.size == 1 ? default_task_names.first.inspect : default_task_names.inspect %>

View file

@ -1,4 +1,4 @@
require_relative 'lib/<%=config[:namespaced_path]%>/version' require_relative "lib/<%=config[:namespaced_path]%>/version"
Gem::Specification.new do |spec| Gem::Specification.new do |spec|
spec.name = <%= config[:name].inspect %> spec.name = <%= config[:name].inspect %>
@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
# Specify which files should be added to the gem when it is released. # Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git. # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
end end
spec.bindir = "exe" spec.bindir = "exe"

View file

@ -0,0 +1,11 @@
require "test_helper"
class <%= config[:constant_name] %>Test < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::<%= config[:constant_name] %>::VERSION
end
def test_it_does_something_useful
assert false
end
end

View file

@ -0,0 +1,4 @@
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "<%= config[:namespaced_path] %>"
require "minitest/autorun"

View file

@ -0,0 +1,13 @@
require "test_helper"
class <%= config[:constant_name] %>Test < Test::Unit::TestCase
test "VERSION" do
assert do
::<%= config[:constant_name] %>.const_defined?(:VERSION)
end
end
test "something useful" do
assert_equal("expected", "actual")
end
end

View file

@ -0,0 +1,4 @@
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "<%= config[:namespaced_path] %>"
require "test-unit"

View file

@ -12,15 +12,11 @@ autoload :OpenSSL, 'openssl'
# servers you wish to talk to. For each host:port you communicate with a # servers you wish to talk to. For each host:port you communicate with a
# single persistent connection is created. # single persistent connection is created.
# #
# Multiple Bundler::Persistent::Net::HTTP::Persistent objects will share the same set of # Connections will be shared across threads through a connection pool to
# connections. # increase reuse of connections.
# #
# For each thread you start a new connection will be created. A # You can shut down any remaining HTTP connections when done by calling
# Bundler::Persistent::Net::HTTP::Persistent connection will not be shared across threads. # #shutdown.
#
# You can shut down the HTTP connections when done by calling #shutdown. You
# should name your Bundler::Persistent::Net::HTTP::Persistent object if you intend to call this
# method.
# #
# Example: # Example:
# #
@ -28,7 +24,7 @@ autoload :OpenSSL, 'openssl'
# #
# uri = Bundler::URI 'http://example.com/awesome/web/service' # uri = Bundler::URI 'http://example.com/awesome/web/service'
# #
# http = Bundler::Persistent::Net::HTTP::Persistent.new name: 'my_app_name' # http = Bundler::Persistent::Net::HTTP::Persistent.new
# #
# # perform a GET # # perform a GET
# response = http.request uri # response = http.request uri
@ -50,14 +46,14 @@ autoload :OpenSSL, 'openssl'
# to use Bundler::URI#request_uri not Bundler::URI#path. The request_uri contains the query # to use Bundler::URI#request_uri not Bundler::URI#path. The request_uri contains the query
# params which are sent in the body for other requests. # params which are sent in the body for other requests.
# #
# == SSL # == TLS/SSL
# #
# SSL connections are automatically created depending upon the scheme of the # TLS connections are automatically created depending upon the scheme of the
# Bundler::URI. SSL connections are automatically verified against the default # Bundler::URI. TLS connections are automatically verified against the default
# certificate store for your computer. You can override this by changing # certificate store for your computer. You can override this by changing
# verify_mode or by specifying an alternate cert_store. # verify_mode or by specifying an alternate cert_store.
# #
# Here are the SSL settings, see the individual methods for documentation: # Here are the TLS settings, see the individual methods for documentation:
# #
# #certificate :: This client's certificate # #certificate :: This client's certificate
# #ca_file :: The certificate-authorities # #ca_file :: The certificate-authorities
@ -67,7 +63,7 @@ autoload :OpenSSL, 'openssl'
# #private_key :: The client's SSL private key # #private_key :: The client's SSL private key
# #reuse_ssl_sessions :: Reuse a previously opened SSL session for a new # #reuse_ssl_sessions :: Reuse a previously opened SSL session for a new
# connection # connection
# #ssl_timeout :: SSL session lifetime # #ssl_timeout :: Session lifetime
# #ssl_version :: Which specific SSL version to use # #ssl_version :: Which specific SSL version to use
# #verify_callback :: For server certificate verification # #verify_callback :: For server certificate verification
# #verify_depth :: Depth of certificate verification # #verify_depth :: Depth of certificate verification
@ -96,14 +92,15 @@ autoload :OpenSSL, 'openssl'
# #
# === Segregation # === Segregation
# #
# By providing an application name to ::new you can separate your connections # Each Bundler::Persistent::Net::HTTP::Persistent instance has its own pool of connections. There
# from the connections of other applications. # is no sharing with other instances (as was true in earlier versions).
# #
# === Idle Timeout # === Idle Timeout
# #
# If a connection hasn't been used for this number of seconds it will automatically be # If a connection hasn't been used for this number of seconds it will
# reset upon the next use to avoid attempting to send to a closed connection. # automatically be reset upon the next use to avoid attempting to send to a
# The default value is 5 seconds. nil means no timeout. Set through #idle_timeout. # closed connection. The default value is 5 seconds. nil means no timeout.
# Set through #idle_timeout.
# #
# Reducing this value may help avoid the "too many connection resets" error # Reducing this value may help avoid the "too many connection resets" error
# when sending non-idempotent requests while increasing this value will cause # when sending non-idempotent requests while increasing this value will cause
@ -118,8 +115,9 @@ autoload :OpenSSL, 'openssl'
# #
# The number of requests that should be made before opening a new connection. # The number of requests that should be made before opening a new connection.
# Typically many keep-alive capable servers tune this to 100 or less, so the # Typically many keep-alive capable servers tune this to 100 or less, so the
# 101st request will fail with ECONNRESET. If unset (default), this value has no # 101st request will fail with ECONNRESET. If unset (default), this value has
# effect, if set, connections will be reset on the request after max_requests. # no effect, if set, connections will be reset on the request after
# max_requests.
# #
# === Open Timeout # === Open Timeout
# #
@ -131,45 +129,6 @@ autoload :OpenSSL, 'openssl'
# Socket options may be set on newly-created connections. See #socket_options # Socket options may be set on newly-created connections. See #socket_options
# for details. # for details.
# #
# === Non-Idempotent Requests
#
# By default non-idempotent requests will not be retried per RFC 2616. By
# setting retry_change_requests to true requests will automatically be retried
# once.
#
# Only do this when you know that retrying a POST or other non-idempotent
# request is safe for your application and will not create duplicate
# resources.
#
# The recommended way to handle non-idempotent requests is the following:
#
# require 'bundler/vendor/net-http-persistent/lib/net/http/persistent'
#
# uri = Bundler::URI 'http://example.com/awesome/web/service'
# post_uri = uri + 'create'
#
# http = Bundler::Persistent::Net::HTTP::Persistent.new name: 'my_app_name'
#
# post = Net::HTTP::Post.new post_uri.path
# # ... fill in POST request
#
# begin
# response = http.request post_uri, post
# rescue Bundler::Persistent::Net::HTTP::Persistent::Error
#
# # POST failed, make a new request to verify the server did not process
# # the request
# exists_uri = uri + '...'
# response = http.get exists_uri
#
# # Retry if it failed
# retry if response.code == '404'
# end
#
# The method of determining if the resource was created or not is unique to
# the particular service you are using. Of course, you will want to add
# protection from infinite looping.
#
# === Connection Termination # === Connection Termination
# #
# If you are done using the Bundler::Persistent::Net::HTTP::Persistent instance you may shut down # If you are done using the Bundler::Persistent::Net::HTTP::Persistent instance you may shut down
@ -195,33 +154,20 @@ class Bundler::Persistent::Net::HTTP::Persistent
HAVE_OPENSSL = defined? OpenSSL::SSL # :nodoc: HAVE_OPENSSL = defined? OpenSSL::SSL # :nodoc:
## ##
# The default connection pool size is 1/4 the allowed open files. # The default connection pool size is 1/4 the allowed open files
# (<code>ulimit -n</code>) or 256 if your OS does not support file handle
# limits (typically windows).
if Gem.win_platform? then if Process.const_defined? :RLIMIT_NOFILE
DEFAULT_POOL_SIZE = 256
else
DEFAULT_POOL_SIZE = Process.getrlimit(Process::RLIMIT_NOFILE).first / 4 DEFAULT_POOL_SIZE = Process.getrlimit(Process::RLIMIT_NOFILE).first / 4
else
DEFAULT_POOL_SIZE = 256
end end
## ##
# The version of Bundler::Persistent::Net::HTTP::Persistent you are using # The version of Bundler::Persistent::Net::HTTP::Persistent you are using
VERSION = '3.1.0' VERSION = '4.0.0'
##
# Exceptions rescued for automatic retry on ruby 2.0.0. This overlaps with
# the exception list for ruby 1.x.
RETRIED_EXCEPTIONS = [ # :nodoc:
(Net::ReadTimeout if Net.const_defined? :ReadTimeout),
IOError,
EOFError,
Errno::ECONNRESET,
Errno::ECONNABORTED,
Errno::EPIPE,
(OpenSSL::SSL::SSLError if HAVE_OPENSSL),
Timeout::Error,
].compact
## ##
# Error class for errors raised by Bundler::Persistent::Net::HTTP::Persistent. Various # Error class for errors raised by Bundler::Persistent::Net::HTTP::Persistent. Various
@ -348,6 +294,13 @@ class Bundler::Persistent::Net::HTTP::Persistent
attr_accessor :max_requests attr_accessor :max_requests
##
# Number of retries to perform if a request fails.
#
# See also #max_retries=, Net::HTTP#max_retries=.
attr_reader :max_retries
## ##
# The value sent in the Keep-Alive header. Defaults to 30. Not needed for # The value sent in the Keep-Alive header. Defaults to 30. Not needed for
# HTTP/1.1 servers. # HTTP/1.1 servers.
@ -360,8 +313,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
attr_accessor :keep_alive attr_accessor :keep_alive
## ##
# A name for this connection. Allows you to keep your connections apart # The name for this collection of persistent connections.
# from everybody else's.
attr_reader :name attr_reader :name
@ -490,23 +442,11 @@ class Bundler::Persistent::Net::HTTP::Persistent
attr_reader :verify_mode attr_reader :verify_mode
##
# Enable retries of non-idempotent requests that change data (e.g. POST
# requests) when the server has disconnected.
#
# This will in the worst case lead to multiple requests with the same data,
# but it may be useful for some applications. Take care when enabling
# this option to ensure it is safe to POST or perform other non-idempotent
# requests to the server.
attr_accessor :retry_change_requests
## ##
# Creates a new Bundler::Persistent::Net::HTTP::Persistent. # Creates a new Bundler::Persistent::Net::HTTP::Persistent.
# #
# Set +name+ to keep your connections apart from everybody else's. Not # Set a +name+ for fun. Your library name should be good enough, but this
# required currently, but highly recommended. Your library name should be # otherwise has no purpose.
# good enough. This parameter will be required in a future version.
# #
# +proxy+ may be set to a Bundler::URI::HTTP or :ENV to pick up proxy options from # +proxy+ may be set to a Bundler::URI::HTTP or :ENV to pick up proxy options from
# the environment. See proxy_from_env for details. # the environment. See proxy_from_env for details.
@ -519,8 +459,9 @@ class Bundler::Persistent::Net::HTTP::Persistent
# proxy.password = 'hunter2' # proxy.password = 'hunter2'
# #
# Set +pool_size+ to limit the maximum number of connections allowed. # Set +pool_size+ to limit the maximum number of connections allowed.
# Defaults to 1/4 the number of allowed file handles. You can have no more # Defaults to 1/4 the number of allowed file handles or 256 if your OS does
# than this many threads with active HTTP transactions. # not support a limit on allowed file handles. You can have no more than
# this many threads with active HTTP transactions.
def initialize name: nil, proxy: nil, pool_size: DEFAULT_POOL_SIZE def initialize name: nil, proxy: nil, pool_size: DEFAULT_POOL_SIZE
@name = name @name = name
@ -537,6 +478,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
@write_timeout = nil @write_timeout = nil
@idle_timeout = 5 @idle_timeout = 5
@max_requests = nil @max_requests = nil
@max_retries = 1
@socket_options = [] @socket_options = []
@ssl_generation = 0 # incremented when SSL session variables change @ssl_generation = 0 # incremented when SSL session variables change
@ -568,8 +510,6 @@ class Bundler::Persistent::Net::HTTP::Persistent
@reuse_ssl_sessions = OpenSSL::SSL.const_defined? :Session @reuse_ssl_sessions = OpenSSL::SSL.const_defined? :Session
end end
@retry_change_requests = false
self.proxy = proxy if proxy self.proxy = proxy if proxy
end end
@ -630,7 +570,9 @@ class Bundler::Persistent::Net::HTTP::Persistent
net_http_args = [uri.hostname, uri.port] net_http_args = [uri.hostname, uri.port]
if @proxy_uri and not proxy_bypass? uri.hostname, uri.port then # I'm unsure if uri.host or uri.hostname should be checked against
# the proxy bypass list.
if @proxy_uri and not proxy_bypass? uri.host, uri.port then
net_http_args.concat @proxy_args net_http_args.concat @proxy_args
else else
net_http_args.concat [nil, nil, nil, nil] net_http_args.concat [nil, nil, nil, nil]
@ -650,9 +592,11 @@ class Bundler::Persistent::Net::HTTP::Persistent
reset connection reset connection
end end
http.read_timeout = @read_timeout if @read_timeout http.keep_alive_timeout = @idle_timeout if @idle_timeout
http.write_timeout = @write_timeout if @write_timeout && http.respond_to?(:write_timeout=) http.max_retries = @max_retries if http.respond_to?(:max_retries=)
http.keep_alive_timeout = @idle_timeout if @idle_timeout http.read_timeout = @read_timeout if @read_timeout
http.write_timeout = @write_timeout if
@write_timeout && http.respond_to?(:write_timeout=)
return yield connection return yield connection
rescue Errno::ECONNREFUSED rescue Errno::ECONNREFUSED
@ -670,27 +614,14 @@ class Bundler::Persistent::Net::HTTP::Persistent
end end
## ##
# Returns an error message containing the number of requests performed on # CGI::escape wrapper
# this connection
def error_message connection
connection.requests -= 1 # fixup
age = Time.now - connection.last_use
"after #{connection.requests} requests on #{connection.http.object_id}, " \
"last used #{age} seconds ago"
end
##
# Bundler::URI::escape wrapper
def escape str def escape str
CGI.escape str if str CGI.escape str if str
end end
## ##
# Bundler::URI::unescape wrapper # CGI::unescape wrapper
def unescape str def unescape str
CGI.unescape str if str CGI.unescape str if str
@ -733,6 +664,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
def finish connection def finish connection
connection.finish connection.finish
connection.http.instance_variable_set :@last_communicated, nil
connection.http.instance_variable_set :@ssl_session, nil unless connection.http.instance_variable_set :@ssl_session, nil unless
@reuse_ssl_sessions @reuse_ssl_sessions
end end
@ -741,24 +673,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
# Returns the HTTP protocol version for +uri+ # Returns the HTTP protocol version for +uri+
def http_version uri def http_version uri
@http_versions["#{uri.host}:#{uri.port}"] @http_versions["#{uri.hostname}:#{uri.port}"]
end
##
# Is +req+ idempotent according to RFC 2616?
def idempotent? req
case req.method
when 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PUT', 'TRACE' then
true
end
end
##
# Is the request +req+ idempotent or is retry_change_requests allowed.
def can_retry? req
@retry_change_requests && !idempotent?(req)
end end
## ##
@ -768,6 +683,23 @@ class Bundler::Persistent::Net::HTTP::Persistent
(uri =~ /^https?:/) ? uri : "http://#{uri}" (uri =~ /^https?:/) ? uri : "http://#{uri}"
end end
##
# Set the maximum number of retries for a request.
#
# Defaults to one retry.
#
# Set this to 0 to disable retries.
def max_retries= retries
retries = retries.to_int
raise ArgumentError, "max_retries must be positive" if retries < 0
@max_retries = retries
reconnect
end
## ##
# Sets this client's SSL private key # Sets this client's SSL private key
@ -806,7 +738,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
if @proxy_uri then if @proxy_uri then
@proxy_args = [ @proxy_args = [
@proxy_uri.host, @proxy_uri.hostname,
@proxy_uri.port, @proxy_uri.port,
unescape(@proxy_uri.user), unescape(@proxy_uri.user),
unescape(@proxy_uri.password), unescape(@proxy_uri.password),
@ -881,14 +813,15 @@ class Bundler::Persistent::Net::HTTP::Persistent
end end
## ##
# Forces reconnection of HTTP connections. # Forces reconnection of all HTTP connections, including TLS/SSL
# connections.
def reconnect def reconnect
@generation += 1 @generation += 1
end end
## ##
# Forces reconnection of SSL connections. # Forces reconnection of only TLS/SSL connections.
def reconnect_ssl def reconnect_ssl
@ssl_generation += 1 @ssl_generation += 1
@ -921,14 +854,8 @@ class Bundler::Persistent::Net::HTTP::Persistent
# the response will not have been read). # the response will not have been read).
# #
# +req+ must be a Net::HTTPGenericRequest subclass (see Net::HTTP for a list). # +req+ must be a Net::HTTPGenericRequest subclass (see Net::HTTP for a list).
#
# If there is an error and the request is idempotent according to RFC 2616
# it will be retried automatically.
def request uri, req = nil, &block def request uri, req = nil, &block
retried = false
bad_response = false
uri = Bundler::URI uri uri = Bundler::URI uri
req = request_setup req || uri req = request_setup req || uri
response = nil response = nil
@ -942,37 +869,12 @@ class Bundler::Persistent::Net::HTTP::Persistent
response = http.request req, &block response = http.request req, &block
if req.connection_close? or if req.connection_close? or
(response.http_version <= '1.0' and (response.http_version <= '1.0' and
not response.connection_keep_alive?) or not response.connection_keep_alive?) or
response.connection_close? then response.connection_close? then
finish connection finish connection
end end
rescue Net::HTTPBadResponse => e rescue Exception # make sure to close the connection when it was interrupted
message = error_message connection
finish connection
raise Error, "too many bad responses #{message}" if
bad_response or not can_retry? req
bad_response = true
retry
rescue *RETRIED_EXCEPTIONS => e
request_failed e, req, connection if
retried or not can_retry? req
reset connection
retried = true
retry
rescue Errno::EINVAL, Errno::ETIMEDOUT => e # not retried on ruby 2
request_failed e, req, connection if retried or not can_retry? req
reset connection
retried = true
retry
rescue Exception => e
finish connection finish connection
raise raise
@ -981,26 +883,11 @@ class Bundler::Persistent::Net::HTTP::Persistent
end end
end end
@http_versions["#{uri.host}:#{uri.port}"] ||= response.http_version @http_versions["#{uri.hostname}:#{uri.port}"] ||= response.http_version
response response
end end
##
# Raises an Error for +exception+ which resulted from attempting the request
# +req+ on the +connection+.
#
# Finishes the +connection+.
def request_failed exception, req, connection # :nodoc:
due_to = "(due to #{exception.message} - #{exception.class})"
message = "too many connection resets #{due_to} #{error_message connection}"
finish connection
raise Error, message, exception.backtrace
end
## ##
# Creates a GET request if +req_or_uri+ is a Bundler::URI and adds headers to the # Creates a GET request if +req_or_uri+ is a Bundler::URI and adds headers to the
# request. # request.
@ -1008,7 +895,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
# Returns the request. # Returns the request.
def request_setup req_or_uri # :nodoc: def request_setup req_or_uri # :nodoc:
req = if Bundler::URI === req_or_uri then req = if req_or_uri.respond_to? 'request_uri' then
Net::HTTP::Get.new req_or_uri.request_uri Net::HTTP::Get.new req_or_uri.request_uri
else else
req_or_uri req_or_uri
@ -1172,7 +1059,6 @@ application:
reconnect_ssl reconnect_ssl
end end
end end
require_relative 'persistent/connection' require_relative 'persistent/connection'

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-BINSTUBS" "1" "January 2020" "" "" .TH "BUNDLE\-BINSTUBS" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-binstubs\fR \- Install the binstubs of the listed gems \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems

View file

@ -1,4 +1,4 @@
BUNDLE-BINSTUBS(1) BUNDLE-BINSTUBS(1) BUNDLE-BINSTUBS(1) BUNDLE-BINSTUBS(1)
@ -13,8 +13,8 @@ DESCRIPTION
small Ruby file (a binstub) that loads Bundler, runs the command, and small Ruby file (a binstub) that loads Bundler, runs the command, and
puts it into bin/. Binstubs are a shortcut-or alternative- to always 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 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 applica- one that will always run the correct gem version used by the
tion. application.
For example, if you run bundle binstubs rspec-core, Bundler will create 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, the file bin/rspec. That file will contain enough code to load Bundler,
@ -26,18 +26,18 @@ DESCRIPTION
OPTIONS OPTIONS
--force --force
Overwrite existing binstubs if they exist. Overwrite existing binstubs if they exist.
--path The location to install the specified binstubs to. This defaults --path The location to install the specified binstubs to. This defaults
to bin. to bin.
--standalone --standalone
Makes binstubs that can work without depending on Rubygems or Makes binstubs that can work without depending on Rubygems or
Bundler at runtime. Bundler at runtime.
--shebang --shebang
Specify a different shebang executable name than the default Specify a different shebang executable name than the default
(default 'ruby') (default 'ruby')
BUNDLE INSTALL --BINSTUBS BUNDLE INSTALL --BINSTUBS
To create binstubs for all the gems in the bundle you can use the To create binstubs for all the gems in the bundle you can use the
@ -45,4 +45,4 @@ BUNDLE INSTALL --BINSTUBS
January 2020 BUNDLE-BINSTUBS(1) May 2020 BUNDLE-BINSTUBS(1)

View file

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

View file

@ -1,4 +1,4 @@
BUNDLE-CACHE(1) BUNDLE-CACHE(1) BUNDLE-CACHE(1) BUNDLE-CACHE(1)
@ -9,19 +9,19 @@ SYNOPSIS
bundle cache bundle cache
DESCRIPTION DESCRIPTION
Copy all of the .gem files needed to run the application into the ven- Copy all of the .gem files needed to run the application into the
dor/cache directory. In the future, when running [bundle vendor/cache directory. In the future, when running [bundle
install(1)][bundle-install], use the gems in the cache in preference to install(1)][bundle-install], use the gems in the cache in preference to
the ones on rubygems.org. the ones on rubygems.org.
GIT AND PATH GEMS GIT AND PATH GEMS
The bundle cache command can also package :git and :path dependencies The bundle cache command can also package :git and :path dependencies
besides .gem files. This needs to be explicitly enabled via the --all besides .gem files. This needs to be explicitly enabled via the --all
option. Once used, the --all option will be remembered. option. Once used, the --all option will be remembered.
SUPPORT FOR MULTIPLE PLATFORMS SUPPORT FOR MULTIPLE PLATFORMS
When using gems that have different packages for different platforms, When using gems that have different packages for different platforms,
Bundler supports caching of gems for other platforms where the Gemfile Bundler supports caching of gems for other platforms where the Gemfile
has been resolved (i.e. present in the lockfile) in vendor/cache. This 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 needs to be enabled via the --all-platforms option. This setting will
be remembered in your local bundler configuration. be remembered in your local bundler configuration.
@ -36,9 +36,9 @@ REMOTE FETCHING
source "https://rubygems.org" source "https://rubygems.org"
gem "nokogiri" gem "nokogiri"
@ -50,22 +50,22 @@ REMOTE FETCHING
Even though the nokogiri gem for the Ruby platform is technically 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. 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 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 check whether it has a version of one of your gems more specific to
your platform. your platform.
This problem is also not limited to the "java" platform. A similar This problem is also not limited to the "java" platform. A similar
(common) problem can happen when developing on Windows and deploying to (common) problem can happen when developing on Windows and deploying to
Linux, or even when developing on OSX and deploying to Linux. Linux, or even when developing on OSX and deploying to Linux.
If you know for sure that the gems packaged in vendor/cache are appro- If you know for sure that the gems packaged in vendor/cache are
priate for the platform you are on, you can run bundle install --local appropriate for the platform you are on, you can run bundle install
to skip checking for more appropriate gems, and use the ones in ven- --local to skip checking for more appropriate gems, and use the ones in
dor/cache. vendor/cache.
One way to be sure that you have the right platformed versions of all 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 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 stag- the gems. For instance, you can run bundle cache on an identical
ing box during your staging process, and check in the vendor/cache staging box during your staging process, and check in the vendor/cache
before deploying to production. before deploying to production.
By default, bundle cache(1) bundle-cache.1.html fetches and also By default, bundle cache(1) bundle-cache.1.html fetches and also
@ -75,4 +75,4 @@ REMOTE FETCHING
January 2020 BUNDLE-CACHE(1) May 2020 BUNDLE-CACHE(1)

View file

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

View file

@ -1,4 +1,4 @@
BUNDLE-CHECK(1) BUNDLE-CHECK(1) BUNDLE-CHECK(1) BUNDLE-CHECK(1)
@ -17,17 +17,17 @@ DESCRIPTION
OPTIONS OPTIONS
--dry-run --dry-run
Locks the [Gemfile(5)][Gemfile(5)] before running the command. Locks the [Gemfile(5)][Gemfile(5)] before running the command.
--gemfile --gemfile
Use the specified gemfile instead of the [Gemfile(5)][Gem- Use the specified gemfile instead of the
file(5)]. [Gemfile(5)][Gemfile(5)].
--path Specify a different path than the system default ($BUNDLE_PATH --path Specify a different path than the system default ($BUNDLE_PATH
or $GEM_HOME). Bundler will remember this value for future or $GEM_HOME). Bundler will remember this value for future
installs on this machine. installs on this machine.
January 2020 BUNDLE-CHECK(1) May 2020 BUNDLE-CHECK(1)

View file

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

View file

@ -1,4 +1,4 @@
BUNDLE-CLEAN(1) BUNDLE-CLEAN(1) BUNDLE-CLEAN(1) BUNDLE-CLEAN(1)
@ -10,17 +10,17 @@ SYNOPSIS
DESCRIPTION DESCRIPTION
This command will remove all unused gems in your bundler directory. This command will remove all unused gems in your bundler directory.
This is useful when you have made many changes to your gem dependen- This is useful when you have made many changes to your gem
cies. dependencies.
OPTIONS OPTIONS
--dry-run --dry-run
Print the changes, but do not clean the unused gems. Print the changes, but do not clean the unused gems.
--force --force
Force a clean even if --path is not set. Force a clean even if --path is not set.
January 2020 BUNDLE-CLEAN(1) May 2020 BUNDLE-CLEAN(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-CONFIG" "1" "January 2020" "" "" .TH "BUNDLE\-CONFIG" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-config\fR \- Set bundler configuration options \fBbundle\-config\fR \- Set bundler configuration options
@ -16,7 +16,7 @@ This command allows you to interact with Bundler\'s configuration system\.
Bundler loads configuration settings in this order: Bundler loads configuration settings in this order:
. .
.IP "1." 4 .IP "1." 4
Local config (\fBapp/\.bundle/config\fR) Local config (\fB<project_root>/\.bundle/config\fR or \fB$BUNDLE_APP_CONFIG/config\fR)
. .
.IP "2." 4 .IP "2." 4
Environmental variables (\fBENV\fR) Environmental variables (\fBENV\fR)
@ -42,7 +42,7 @@ Executing \fBbundle config set <name> <value>\fR will set that configuration to
Executing \fBbundle config set \-\-global <name> <value>\fR works the same as above\. Executing \fBbundle config set \-\-global <name> <value>\fR works the same as above\.
. .
.P .P
Executing \fBbundle config set \-\-local <name> <value>\fR will set that configuration to the local application\. The configuration will be stored in \fBapp/\.bundle/config\fR\. Executing \fBbundle config set \-\-local <name> <value>\fR will set that configuration in the directory for the local application\. The configuration will be stored in \fB<project_root>/\.bundle/config\fR\. If \fBBUNDLE_APP_CONFIG\fR is set, the configuration will be stored in \fB$BUNDLE_APP_CONFIG/config\fR\.
. .
.P .P
Executing \fBbundle config unset <name>\fR will delete the configuration in both local and global sources\. Executing \fBbundle config unset <name>\fR will delete the configuration in both local and global sources\.
@ -187,9 +187,6 @@ The following is a list of all configuration keys and their purpose\. You can le
\fBdisable_multisource\fR (\fBBUNDLE_DISABLE_MULTISOURCE\fR): When set, Gemfiles containing multiple sources will produce errors instead of warnings\. Use \fBbundle config unset disable_multisource\fR to unset\. \fBdisable_multisource\fR (\fBBUNDLE_DISABLE_MULTISOURCE\fR): When set, Gemfiles containing multiple sources will produce errors instead of warnings\. Use \fBbundle config unset disable_multisource\fR to unset\.
. .
.IP "\(bu" 4 .IP "\(bu" 4
\fBdisable_platform_warnings\fR (\fBBUNDLE_DISABLE_PLATFORM_WARNINGS\fR): Disable warnings during bundle install when a dependency is unused on the current platform\.
.
.IP "\(bu" 4
\fBdisable_shared_gems\fR (\fBBUNDLE_DISABLE_SHARED_GEMS\fR): Stop Bundler from accessing gems installed to RubyGems\' normal location\. \fBdisable_shared_gems\fR (\fBBUNDLE_DISABLE_SHARED_GEMS\fR): Stop Bundler from accessing gems installed to RubyGems\' normal location\.
. .
.IP "\(bu" 4 .IP "\(bu" 4

View file

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

View file

@ -11,7 +11,7 @@ This command allows you to interact with Bundler's configuration system.
Bundler loads configuration settings in this order: Bundler loads configuration settings in this order:
1. Local config (`app/.bundle/config`) 1. Local config (`<project_root>/.bundle/config` or `$BUNDLE_APP_CONFIG/config`)
2. Environmental variables (`ENV`) 2. Environmental variables (`ENV`)
3. Global config (`~/.bundle/config`) 3. Global config (`~/.bundle/config`)
4. Bundler default config 4. Bundler default config
@ -30,8 +30,10 @@ overridden and user will be warned.
Executing `bundle config set --global <name> <value>` works the same as above. Executing `bundle config set --global <name> <value>` works the same as above.
Executing `bundle config set --local <name> <value>` will set that configuration to Executing `bundle config set --local <name> <value>` will set that configuration
the local application. The configuration will be stored in `app/.bundle/config`. 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 Executing `bundle config unset <name>` will delete the configuration in both
local and global sources. local and global sources.
@ -179,8 +181,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
When set, Gemfiles containing multiple sources will produce errors When set, Gemfiles containing multiple sources will produce errors
instead of warnings. instead of warnings.
Use `bundle config unset disable_multisource` to unset. Use `bundle config unset disable_multisource` to unset.
* `disable_platform_warnings` (`BUNDLE_DISABLE_PLATFORM_WARNINGS`):
Disable warnings during bundle install when a dependency is unused on the current platform.
* `disable_shared_gems` (`BUNDLE_DISABLE_SHARED_GEMS`): * `disable_shared_gems` (`BUNDLE_DISABLE_SHARED_GEMS`):
Stop Bundler from accessing gems installed to RubyGems' normal location. Stop Bundler from accessing gems installed to RubyGems' normal location.
* `disable_version_check` (`BUNDLE_DISABLE_VERSION_CHECK`): * `disable_version_check` (`BUNDLE_DISABLE_VERSION_CHECK`):
@ -396,4 +396,3 @@ outlines the available environment variables and their default values
BUNDLE_USER_CACHE : $BUNDLE_USER_HOME/cache BUNDLE_USER_CACHE : $BUNDLE_USER_HOME/cache
BUNDLE_USER_CONFIG : $BUNDLE_USER_HOME/config BUNDLE_USER_CONFIG : $BUNDLE_USER_HOME/config
BUNDLE_USER_PLUGIN : $BUNDLE_USER_HOME/plugin BUNDLE_USER_PLUGIN : $BUNDLE_USER_HOME/plugin

View file

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

View file

@ -1,4 +1,4 @@
BUNDLE-DOCTOR(1) BUNDLE-DOCTOR(1) BUNDLE-DOCTOR(1) BUNDLE-DOCTOR(1)
@ -10,7 +10,7 @@ SYNOPSIS
DESCRIPTION DESCRIPTION
Checks your Gemfile and gem environment for common problems. If issues Checks your Gemfile and gem environment for common problems. If issues
are detected, Bundler prints them and exits status 1. Otherwise, are detected, Bundler prints them and exits status 1. Otherwise,
Bundler prints a success message and exits status 0. Bundler prints a success message and exits status 0.
Examples of common problems caught by bundle-doctor include: Examples of common problems caught by bundle-doctor include:
@ -29,16 +29,16 @@ DESCRIPTION
OPTIONS OPTIONS
--quiet --quiet
Only output warnings and errors. Only output warnings and errors.
--gemfile=<gemfile> --gemfile=<gemfile>
The location of the Gemfile(5) which Bundler should use. This The location of the Gemfile(5) which Bundler should use. This
defaults to a Gemfile(5) in the current working directory. In defaults to a Gemfile(5) in the current working directory. In
general, Bundler will assume that the location of the Gemfile(5) general, Bundler will assume that the location of the Gemfile(5)
is also the project's root and will try to find Gemfile.lock and is also the project's root and will try to find Gemfile.lock and
vendor/cache relative to this location. vendor/cache relative to this location.
January 2020 BUNDLE-DOCTOR(1) May 2020 BUNDLE-DOCTOR(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-EXEC" "1" "January 2020" "" "" .TH "BUNDLE\-EXEC" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-exec\fR \- Execute a command in the context of the bundle \fBbundle\-exec\fR \- Execute a command in the context of the bundle

View file

@ -1,4 +1,4 @@
BUNDLE-EXEC(1) BUNDLE-EXEC(1) BUNDLE-EXEC(1) BUNDLE-EXEC(1)
@ -9,47 +9,48 @@ SYNOPSIS
bundle exec [--keep-file-descriptors] command bundle exec [--keep-file-descriptors] command
DESCRIPTION DESCRIPTION
This command executes the command, making all gems specified in the This command executes the command, making all gems specified in the
[Gemfile(5)][Gemfile(5)] available to require in Ruby programs. [Gemfile(5)][Gemfile(5)] available to require in Ruby programs.
Essentially, if you would normally have run something like rspec Essentially, if you would normally have run something like rspec
spec/my_spec.rb, and you want to use the gems specified in the [Gem- spec/my_spec.rb, and you want to use the gems specified in the
file(5)][Gemfile(5)] and installed via bundle install(1) bun- [Gemfile(5)][Gemfile(5)] and installed via bundle install(1)
dle-install.1.html, you should run bundle exec rspec spec/my_spec.rb. bundle-install.1.html, you should run bundle exec rspec
spec/my_spec.rb.
Note that bundle exec does not require that an executable is available Note that bundle exec does not require that an executable is available
on your shell's $PATH. on your shell's $PATH.
OPTIONS OPTIONS
--keep-file-descriptors --keep-file-descriptors
Exec in Ruby 2.0 began discarding non-standard file descriptors. Exec in Ruby 2.0 began discarding non-standard file descriptors.
When this flag is passed, exec will revert to the 1.9 behaviour When this flag is passed, exec will revert to the 1.9 behaviour
of passing all file descriptors to the new process. of passing all file descriptors to the new process.
BUNDLE INSTALL --BINSTUBS BUNDLE INSTALL --BINSTUBS
If you use the --binstubs flag in bundle install(1) bun- If you use the --binstubs flag in bundle install(1)
dle-install.1.html, Bundler will automatically create a directory bundle-install.1.html, Bundler will automatically create a directory
(which defaults to app_root/bin) containing all of the executables (which defaults to app_root/bin) containing all of the executables
available from gems in the bundle. available from gems in the bundle.
After using --binstubs, bin/rspec spec/my_spec.rb is identical to bun- After using --binstubs, bin/rspec spec/my_spec.rb is identical to
dle exec rspec spec/my_spec.rb. bundle exec rspec spec/my_spec.rb.
ENVIRONMENT MODIFICATIONS ENVIRONMENT MODIFICATIONS
bundle exec makes a number of changes to the shell environment, then bundle exec makes a number of changes to the shell environment, then
executes the command you specify in full. executes the command you specify in full.
o make sure that it's still possible to shell out to bundle from o make sure that it's still possible to shell out to bundle from
inside a command invoked by bundle exec (using $BUNDLE_BIN_PATH) inside a command invoked by bundle exec (using $BUNDLE_BIN_PATH)
o put the directory containing executables (like rails, rspec, o put the directory containing executables (like rails, rspec,
rackup) for your bundle on $PATH rackup) for your bundle on $PATH
o make sure that if bundler is invoked in the subshell, it uses the o make sure that if bundler is invoked in the subshell, it uses the
same Gemfile (by setting BUNDLE_GEMFILE) same Gemfile (by setting BUNDLE_GEMFILE)
o add -rbundler/setup to $RUBYOPT, which makes sure that Ruby pro- o add -rbundler/setup to $RUBYOPT, which makes sure that Ruby
grams invoked in the subshell can see the gems in the bundle programs invoked in the subshell can see the gems in the bundle
@ -57,122 +58,124 @@ ENVIRONMENT MODIFICATIONS
o disallow loading additional gems not in the bundle o disallow loading additional gems not in the bundle
o modify the gem method to be a no-op if a gem matching the require- o modify the gem method to be a no-op if a gem matching the
ments is in the bundle, and to raise a Gem::LoadError if it's not requirements is in the bundle, and to raise a Gem::LoadError if
it's not
o Define Gem.refresh to be a no-op, since the source index is always o Define Gem.refresh to be a no-op, since the source index is always
frozen when using bundler, and to prevent gems from the system frozen when using bundler, and to prevent gems from the system
leaking into the environment leaking into the environment
o Override Gem.bin_path to use the gems in the bundle, making system o Override Gem.bin_path to use the gems in the bundle, making system
executables work executables work
o Add all gems in the bundle into Gem.loaded_specs o Add all gems in the bundle into Gem.loaded_specs
Finally, bundle exec also implicitly modifies Gemfile.lock if the lock- Finally, bundle exec also implicitly modifies Gemfile.lock if the
file and the Gemfile do not match. Bundler needs the Gemfile to deter- lockfile and the Gemfile do not match. Bundler needs the Gemfile to
mine things such as a gem's groups, autorequire, and platforms, etc., determine things such as a gem's groups, autorequire, and platforms,
and that information isn't stored in the lockfile. The Gemfile and etc., and that information isn't stored in the lockfile. The Gemfile
lockfile must be synced in order to bundle exec successfully, so bundle and lockfile must be synced in order to bundle exec successfully, so
exec updates the lockfile beforehand. bundle exec updates the lockfile beforehand.
Loading Loading
By default, when attempting to bundle exec to a file with a ruby she- By default, when attempting to bundle exec to a file with a ruby
bang, Bundler will Kernel.load that file instead of using Kernel.exec. shebang, Bundler will Kernel.load that file instead of using
For the vast majority of cases, this is a performance improvement. In a Kernel.exec. For the vast majority of cases, this is a performance
rare few cases, this could cause some subtle side-effects (such as improvement. In a rare few cases, this could cause some subtle
dependence on the exact contents of $0 or __FILE__) and the optimiza- side-effects (such as dependence on the exact contents of $0 or
tion can be disabled by enabling the disable_exec_load setting. __FILE__) and the optimization can be disabled by enabling the
disable_exec_load setting.
Shelling out Shelling out
Any Ruby code that opens a subshell (like system, backticks, or %x{}) Any Ruby code that opens a subshell (like system, backticks, or %x{})
will automatically use the current Bundler environment. If you need to will automatically use the current Bundler environment. If you need to
shell out to a Ruby command that is not part of your current bundle, shell out to a Ruby command that is not part of your current bundle,
use the with_clean_env method with a block. Any subshells created use the with_clean_env method with a block. Any subshells created
inside the block will be given the environment present before Bundler inside the block will be given the environment present before Bundler
was activated. For example, Homebrew commands run Ruby, but don't work was activated. For example, Homebrew commands run Ruby, but don't work
inside a bundle: inside a bundle:
Bundler.with_clean_env do Bundler.with_clean_env do
`brew install wget` `brew install wget`
end end
Using with_clean_env is also necessary if you are shelling out to a Using with_clean_env is also necessary if you are shelling out to a
different bundle. Any Bundler commands run in a subshell will inherit different bundle. Any Bundler commands run in a subshell will inherit
the current Gemfile, so commands that need to run in the context of a the current Gemfile, so commands that need to run in the context of a
different bundle also need to use with_clean_env. different bundle also need to use with_clean_env.
Bundler.with_clean_env do Bundler.with_clean_env do
Dir.chdir "/other/bundler/project" do Dir.chdir "/other/bundler/project" do
`bundle exec ./script` `bundle exec ./script`
end end
end end
Bundler provides convenience helpers that wrap system and exec, and Bundler provides convenience helpers that wrap system and exec, and
they can be used like this: they can be used like this:
Bundler.clean_system('brew install wget') Bundler.clean_system('brew install wget')
Bundler.clean_exec('brew install wget') Bundler.clean_exec('brew install wget')
RUBYGEMS PLUGINS RUBYGEMS PLUGINS
At present, the Rubygems plugin system requires all files named At present, the Rubygems plugin system requires all files named
rubygems_plugin.rb on the load path of any installed gem when any Ruby rubygems_plugin.rb on the load path of any installed gem when any Ruby
code requires rubygems.rb. This includes executables installed into the code requires rubygems.rb. This includes executables installed into the
system, like rails, rackup, and rspec. system, like rails, rackup, and rspec.
Since Rubygems plugins can contain arbitrary Ruby code, they commonly Since Rubygems plugins can contain arbitrary Ruby code, they commonly
end up activating themselves or their dependencies. end up activating themselves or their dependencies.
For instance, the gemcutter 0.5 gem depended on json_pure. If you had For instance, the gemcutter 0.5 gem depended on json_pure. If you had
that version of gemcutter installed (even if you also had a newer ver- that version of gemcutter installed (even if you also had a newer
sion without this problem), Rubygems would activate gemcutter 0.5 and version without this problem), Rubygems would activate gemcutter 0.5
json_pure <latest>. and json_pure <latest>.
If your Gemfile(5) also contained json_pure (or a gem with a dependency If your Gemfile(5) also contained json_pure (or a gem with a dependency
on json_pure), the latest version on your system might conflict with on json_pure), the latest version on your system might conflict with
the version in your Gemfile(5), or the snapshot version in your Gem- the version in your Gemfile(5), or the snapshot version in your
file.lock. Gemfile.lock.
If this happens, bundler will say: If this happens, bundler will say:
You have already activated json_pure 1.4.6 but your Gemfile You have already activated json_pure 1.4.6 but your Gemfile
requires json_pure 1.4.3. Consider using bundle exec. requires json_pure 1.4.3. Consider using bundle exec.
In this situation, you almost certainly want to remove the underlying In this situation, you almost certainly want to remove the underlying
gem with the problematic gem plugin. In general, the authors of these gem with the problematic gem plugin. In general, the authors of these
plugins (in this case, the gemcutter gem) have released newer versions plugins (in this case, the gemcutter gem) have released newer versions
that are more careful in their plugins. that are more careful in their plugins.
You can find a list of all the gems containing gem plugins by running You can find a list of all the gems containing gem plugins by running
ruby -rrubygems -e "puts Gem.find_files('rubygems_plugin.rb')" ruby -rrubygems -e "puts Gem.find_files('rubygems_plugin.rb')"
At the very least, you should remove all but the newest version of each At the very least, you should remove all but the newest version of each
gem plugin, and also remove all gem plugins that you aren't using (gem gem plugin, and also remove all gem plugins that you aren't using (gem
uninstall gem_name). uninstall gem_name).
January 2020 BUNDLE-EXEC(1) May 2020 BUNDLE-EXEC(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-GEM" "1" "January 2020" "" "" .TH "BUNDLE\-GEM" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
@ -64,8 +64,8 @@ Add an MIT license to a \fBLICENSE\.txt\fR file in the root of the generated pro
Do not create a \fBLICENSE\.txt\fR (overrides \fB\-\-mit\fR specified in the global config)\. Do not create a \fBLICENSE\.txt\fR (overrides \fB\-\-mit\fR specified in the global config)\.
. .
.TP .TP
\fB\-t\fR, \fB\-\-test=minitest\fR, \fB\-\-test=rspec\fR \fB\-t\fR, \fB\-\-test=minitest\fR, \fB\-\-test=rspec\fR, \fB\-\-test=test\-unit\fR
Specify the test framework that Bundler should use when generating the project\. Acceptable values are \fBminitest\fR and \fBrspec\fR\. The \fBGEM_NAME\.gemspec\fR will be configured and a skeleton test/spec directory will be created based on this option\. If this option is unspecified, an interactive prompt will be displayed and the answer will be saved in Bundler\'s global config for future \fBbundle gem\fR use\. If no option is specified, the default testing framework is RSpec\. Specify the test framework that Bundler should use when generating the project\. Acceptable values are \fBminitest\fR, \fBrspec\fR and \fBtest\-unit\fR\. The \fBGEM_NAME\.gemspec\fR will be configured and a skeleton test/spec directory will be created based on this option\. If this option is unspecified, an interactive prompt will be displayed and the answer will be saved in Bundler\'s global config for future \fBbundle gem\fR use\. If no option is specified, the default testing framework is RSpec\.
. .
.TP .TP
\fB\-e\fR, \fB\-\-edit[=EDITOR]\fR \fB\-e\fR, \fB\-\-edit[=EDITOR]\fR

View file

@ -1,4 +1,4 @@
BUNDLE-GEM(1) BUNDLE-GEM(1) BUNDLE-GEM(1) BUNDLE-GEM(1)
@ -16,8 +16,8 @@ DESCRIPTION
Run rake -T in the resulting project for a list of Rake tasks that can Run rake -T in the resulting project for a list of Rake tasks that can
be used to test and publish the gem to rubygems.org. be used to test and publish the gem to rubygems.org.
The generated project skeleton can be customized with OPTIONS, as The generated project skeleton can be customized with OPTIONS, as
explained below. Note that these options can also be specified via explained below. Note that these options can also be specified via
Bundler's global configuration file using the following names: Bundler's global configuration file using the following names:
o gem.coc o gem.coc
@ -30,55 +30,55 @@ DESCRIPTION
OPTIONS OPTIONS
--exe or -b or --bin --exe or -b or --bin
Specify that Bundler should create a binary executable (as Specify that Bundler should create a binary executable (as
exe/GEM_NAME) in the generated rubygem project. This binary will exe/GEM_NAME) in the generated rubygem project. This binary will
also be added to the GEM_NAME.gemspec manifest. This behavior is also be added to the GEM_NAME.gemspec manifest. This behavior is
disabled by default. disabled by default.
--no-exe --no-exe
Do not create a binary (overrides --exe specified in the global Do not create a binary (overrides --exe specified in the global
config). config).
--coc Add a CODE_OF_CONDUCT.md file to the root of the generated --coc Add a CODE_OF_CONDUCT.md file to the root of the generated
project. If this option is unspecified, an interactive prompt project. If this option is unspecified, an interactive prompt
will be displayed and the answer will be saved in Bundler's will be displayed and the answer will be saved in Bundler's
global config for future bundle gem use. global config for future bundle gem use.
--no-coc --no-coc
Do not create a CODE_OF_CONDUCT.md (overrides --coc specified in Do not create a CODE_OF_CONDUCT.md (overrides --coc specified in
the global config). the global config).
--ext Add boilerplate for C extension code to the generated project. --ext Add boilerplate for C extension code to the generated project.
This behavior is disabled by default. This behavior is disabled by default.
--no-ext --no-ext
Do not add C extension code (overrides --ext specified in the Do not add C extension code (overrides --ext specified in the
global config). global config).
--mit Add an MIT license to a LICENSE.txt file in the root of the gen- --mit Add an MIT license to a LICENSE.txt file in the root of the
erated project. Your name from the global git config is used for generated project. Your name from the global git config is used
the copyright statement. If this option is unspecified, an for the copyright statement. If this option is unspecified, an
interactive prompt will be displayed and the answer will be interactive prompt will be displayed and the answer will be
saved in Bundler's global config for future bundle gem use. saved in Bundler's global config for future bundle gem use.
--no-mit --no-mit
Do not create a LICENSE.txt (overrides --mit specified in the Do not create a LICENSE.txt (overrides --mit specified in the
global config). global config).
-t, --test=minitest, --test=rspec -t, --test=minitest, --test=rspec, --test=test-unit
Specify the test framework that Bundler should use when generat- Specify the test framework that Bundler should use when
ing the project. Acceptable values are minitest and rspec. The generating the project. Acceptable values are minitest, rspec
GEM_NAME.gemspec will be configured and a skeleton test/spec and test-unit. The GEM_NAME.gemspec will be configured and a
directory will be created based on this option. If this option skeleton test/spec directory will be created based on this
is unspecified, an interactive prompt will be displayed and the option. If this option is unspecified, an interactive prompt
answer will be saved in Bundler's global config for future bun- will be displayed and the answer will be saved in Bundler's
dle gem use. If no option is specified, the default testing global config for future bundle gem use. If no option is
framework is RSpec. specified, the default testing framework is RSpec.
-e, --edit[=EDITOR] -e, --edit[=EDITOR]
Open the resulting GEM_NAME.gemspec in EDITOR, or the default Open the resulting GEM_NAME.gemspec in EDITOR, or the default
editor if not specified. The default is $BUNDLER_EDITOR, $VIS- editor if not specified. The default is $BUNDLER_EDITOR,
UAL, or $EDITOR. $VISUAL, or $EDITOR.
SEE ALSO SEE ALSO
o bundle config(1) bundle-config.1.html o bundle config(1) bundle-config.1.html
@ -88,4 +88,4 @@ SEE ALSO
January 2020 BUNDLE-GEM(1) May 2020 BUNDLE-GEM(1)

View file

@ -60,13 +60,13 @@ configuration file using the following names:
Do not create a `LICENSE.txt` (overrides `--mit` specified in the global Do not create a `LICENSE.txt` (overrides `--mit` specified in the global
config). config).
* `-t`, `--test=minitest`, `--test=rspec`: * `-t`, `--test=minitest`, `--test=rspec`, `--test=test-unit`:
Specify the test framework that Bundler should use when generating the Specify the test framework that Bundler should use when generating the
project. Acceptable values are `minitest` and `rspec`. The `GEM_NAME.gemspec` project. Acceptable values are `minitest`, `rspec` and `test-unit`. The
will be configured and a skeleton test/spec directory will be created based `GEM_NAME.gemspec` will be configured and a skeleton test/spec directory will
on this option. If this option is unspecified, an interactive prompt will be be created based on this option. If this option is unspecified, an interactive
displayed and the answer will be saved in Bundler's global config for future prompt will be displayed and the answer will be saved in Bundler's global
`bundle gem` use. config for future `bundle gem` use.
If no option is specified, the default testing framework is RSpec. If no option is specified, the default testing framework is RSpec.
* `-e`, `--edit[=EDITOR]`: * `-e`, `--edit[=EDITOR]`:

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-INFO" "1" "January 2020" "" "" .TH "BUNDLE\-INFO" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-info\fR \- Show information for the given gem in your bundle \fBbundle\-info\fR \- Show information for the given gem in your bundle

View file

@ -1,4 +1,4 @@
BUNDLE-INFO(1) BUNDLE-INFO(1) BUNDLE-INFO(1) BUNDLE-INFO(1)
@ -18,4 +18,4 @@ OPTIONS
January 2020 BUNDLE-INFO(1) May 2020 BUNDLE-INFO(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-INIT" "1" "January 2020" "" "" .TH "BUNDLE\-INIT" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-init\fR \- Generates a Gemfile into the current working directory \fBbundle\-init\fR \- Generates a Gemfile into the current working directory

View file

@ -1,4 +1,4 @@
BUNDLE-INIT(1) BUNDLE-INIT(1) BUNDLE-INIT(1) BUNDLE-INIT(1)
@ -9,16 +9,16 @@ SYNOPSIS
bundle init [--gemspec=FILE] bundle init [--gemspec=FILE]
DESCRIPTION DESCRIPTION
Init generates a default [Gemfile(5)][Gemfile(5)] in the current work- Init generates a default [Gemfile(5)][Gemfile(5)] in the current
ing directory. When adding a [Gemfile(5)][Gemfile(5)] to a gem with a working directory. When adding a [Gemfile(5)][Gemfile(5)] to a gem with
gemspec, the --gemspec option will automatically add each dependency a gemspec, the --gemspec option will automatically add each dependency
listed in the gemspec file to the newly created [Gemfile(5)][Gem- listed in the gemspec file to the newly created
file(5)]. [Gemfile(5)][Gemfile(5)].
OPTIONS OPTIONS
--gemspec --gemspec
Use the specified .gemspec to create the [Gemfile(5)][Gem- Use the specified .gemspec to create the
file(5)] [Gemfile(5)][Gemfile(5)]
FILES FILES
Included in the default [Gemfile(5)][Gemfile(5)] generated is the line Included in the default [Gemfile(5)][Gemfile(5)] generated is the line
@ -31,4 +31,4 @@ SEE ALSO
January 2020 BUNDLE-INIT(1) May 2020 BUNDLE-INIT(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-INJECT" "1" "January 2020" "" "" .TH "BUNDLE\-INJECT" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile

View file

@ -1,4 +1,4 @@
BUNDLE-INJECT(1) BUNDLE-INJECT(1) BUNDLE-INJECT(1) BUNDLE-INJECT(1)
@ -19,8 +19,8 @@ DESCRIPTION
bundle install bundle install
bundle inject 'rack' '> 0' bundle inject 'rack' '> 0'
@ -29,4 +29,4 @@ DESCRIPTION
January 2020 BUNDLE-INJECT(1) May 2020 BUNDLE-INJECT(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-INSTALL" "1" "January 2020" "" "" .TH "BUNDLE\-INSTALL" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-install\fR \- Install the dependencies specified in your Gemfile \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile

View file

@ -1,4 +1,4 @@
BUNDLE-INSTALL(1) BUNDLE-INSTALL(1) BUNDLE-INSTALL(1) BUNDLE-INSTALL(1)
@ -6,22 +6,22 @@ NAME
bundle-install - Install the dependencies specified in your Gemfile bundle-install - Install the dependencies specified in your Gemfile
SYNOPSIS SYNOPSIS
bundle install [--binstubs[=DIRECTORY]] [--clean] [--deployment] bundle install [--binstubs[=DIRECTORY]] [--clean] [--deployment]
[--frozen] [--full-index] [--gemfile=GEMFILE] [--jobs=NUMBER] [--local] [--frozen] [--full-index] [--gemfile=GEMFILE] [--jobs=NUMBER] [--local]
[--no-cache] [--no-prune] [--path PATH] [--quiet] [--redownload] [--no-cache] [--no-prune] [--path PATH] [--quiet] [--redownload]
[--retry=NUMBER] [--shebang] [--standalone[=GROUP[ GROUP...]]] [--sys- [--retry=NUMBER] [--shebang] [--standalone[=GROUP[ GROUP...]]]
tem] [--trust-policy=POLICY] [--with=GROUP[ GROUP...]] [--with- [--system] [--trust-policy=POLICY] [--with=GROUP[ GROUP...]]
out=GROUP[ GROUP...]] [--without=GROUP[ GROUP...]]
DESCRIPTION DESCRIPTION
Install the gems specified in your Gemfile(5). If this is the first Install the gems specified in your Gemfile(5). If this is the first
time you run bundle install (and a Gemfile.lock does not exist), time you run bundle install (and a Gemfile.lock does not exist),
Bundler will fetch all remote sources, resolve dependencies and install Bundler will fetch all remote sources, resolve dependencies and install
all needed gems. all needed gems.
If a Gemfile.lock does exist, and you have not updated your Gemfile(5), If a Gemfile.lock does exist, and you have not updated your Gemfile(5),
Bundler will fetch all remote sources, but use the dependencies speci- Bundler will fetch all remote sources, but use the dependencies
fied in the Gemfile.lock instead of resolving dependencies. specified in the Gemfile.lock instead of resolving dependencies.
If a Gemfile.lock does exist, and you have updated your Gemfile(5), If a Gemfile.lock does exist, and you have updated your Gemfile(5),
Bundler will use the dependencies in the Gemfile.lock for all gems that Bundler will use the dependencies in the Gemfile.lock for all gems that
@ -34,122 +34,122 @@ OPTIONS
time bundle install is run, use bundle config (see bundle-config(1)). time bundle install is run, use bundle config (see bundle-config(1)).
--binstubs[=<directory>] --binstubs[=<directory>]
Binstubs are scripts that wrap around executables. Bundler cre- Binstubs are scripts that wrap around executables. Bundler
ates a small Ruby file (a binstub) that loads Bundler, runs the creates a small Ruby file (a binstub) that loads Bundler, runs
command, and puts it in bin/. This lets you link the binstub the command, and puts it in bin/. This lets you link the binstub
inside of an application to the exact gem version the applica- inside of an application to the exact gem version the
tion needs. application needs.
Creates a directory (defaults to ~/bin) and places any executa- Creates a directory (defaults to ~/bin) and places any
bles from the gem there. These executables run in Bundler's con- executables from the gem there. These executables run in
text. If used, you might add this directory to your environ- Bundler's context. If used, you might add this directory to your
ment's PATH variable. For instance, if the rails gem comes with environment's PATH variable. For instance, if the rails gem
a rails executable, this flag will create a bin/rails executable comes with a rails executable, this flag will create a bin/rails
that ensures that all referred dependencies will be resolved executable that ensures that all referred dependencies will be
using the bundled gems. resolved using the bundled gems.
--clean --clean
On finishing the installation Bundler is going to remove any On finishing the installation Bundler is going to remove any
gems not present in the current Gemfile(5). Don't worry, gems gems not present in the current Gemfile(5). Don't worry, gems
currently in use will not be removed. currently in use will not be removed.
--deployment --deployment
In deployment mode, Bundler will 'roll-out' the bundle for pro- In deployment mode, Bundler will 'roll-out' the bundle for
duction or CI use. Please check carefully if you want to have production or CI use. Please check carefully if you want to have
this option enabled in your development environment. this option enabled in your development environment.
--redownload --redownload
Force download every gem, even if the required versions are Force download every gem, even if the required versions are
already available locally. already available locally.
--frozen --frozen
Do not allow the Gemfile.lock to be updated after this install. Do not allow the Gemfile.lock to be updated after this install.
Exits non-zero if there are going to be changes to the Gem- Exits non-zero if there are going to be changes to the
file.lock. Gemfile.lock.
--full-index --full-index
Bundler will not call Rubygems' API endpoint (default) but down- Bundler will not call Rubygems' API endpoint (default) but
load and cache a (currently big) index file of all gems. Perfor- download and cache a (currently big) index file of all gems.
mance can be improved for large bundles that seldom change by Performance can be improved for large bundles that seldom change
enabling this option. by enabling this option.
--gemfile=<gemfile> --gemfile=<gemfile>
The location of the Gemfile(5) which Bundler should use. This The location of the Gemfile(5) which Bundler should use. This
defaults to a Gemfile(5) in the current working directory. In defaults to a Gemfile(5) in the current working directory. In
general, Bundler will assume that the location of the Gemfile(5) general, Bundler will assume that the location of the Gemfile(5)
is also the project's root and will try to find Gemfile.lock and is also the project's root and will try to find Gemfile.lock and
vendor/cache relative to this location. vendor/cache relative to this location.
--jobs=[<number>], -j[<number>] --jobs=[<number>], -j[<number>]
The maximum number of parallel download and install jobs. The The maximum number of parallel download and install jobs. The
default is 1. default is 1.
--local --local
Do not attempt to connect to rubygems.org. Instead, Bundler will Do not attempt to connect to rubygems.org. Instead, Bundler will
use the gems already present in Rubygems' cache or in ven- use the gems already present in Rubygems' cache or in
dor/cache. Note that if a appropriate platform-specific gem vendor/cache. Note that if a appropriate platform-specific gem
exists on rubygems.org it will not be found. exists on rubygems.org it will not be found.
--no-cache --no-cache
Do not update the cache in vendor/cache with the newly bundled Do not update the cache in vendor/cache with the newly bundled
gems. This does not remove any gems in the cache but keeps the gems. This does not remove any gems in the cache but keeps the
newly bundled gems from being cached during the install. newly bundled gems from being cached during the install.
--no-prune --no-prune
Don't remove stale gems from the cache when the installation Don't remove stale gems from the cache when the installation
finishes. finishes.
--path=<path> --path=<path>
The location to install the specified gems to. This defaults to The location to install the specified gems to. This defaults to
Rubygems' setting. Bundler shares this location with Rubygems, Rubygems' setting. Bundler shares this location with Rubygems,
gem install ... will have gem installed there, too. Therefore, gem install ... will have gem installed there, too. Therefore,
gems installed without a --path ... setting will show up by gems installed without a --path ... setting will show up by
calling gem list. Accordingly, gems installed to other locations calling gem list. Accordingly, gems installed to other locations
will not get listed. will not get listed.
--quiet --quiet
Do not print progress information to the standard output. Do not print progress information to the standard output.
Instead, Bundler will exit using a status code ($?). Instead, Bundler will exit using a status code ($?).
--retry=[<number>] --retry=[<number>]
Retry failed network or git requests for number times. Retry failed network or git requests for number times.
--shebang=<ruby-executable> --shebang=<ruby-executable>
Uses the specified ruby executable (usually ruby) to execute the Uses the specified ruby executable (usually ruby) to execute the
scripts created with --binstubs. In addition, if you use --bin- scripts created with --binstubs. In addition, if you use
stubs together with --shebang jruby these executables will be --binstubs together with --shebang jruby these executables will
changed to execute jruby instead. be changed to execute jruby instead.
--standalone[=<list>] --standalone[=<list>]
Makes a bundle that can work without depending on Rubygems or Makes a bundle that can work without depending on Rubygems or
Bundler at runtime. A space separated list of groups to install Bundler at runtime. A space separated list of groups to install
has to be specified. Bundler creates a directory named bundle has to be specified. Bundler creates a directory named bundle
and installs the bundle there. It also generates a bun- and installs the bundle there. It also generates a
dle/bundler/setup.rb file to replace Bundler's own setup in the bundle/bundler/setup.rb file to replace Bundler's own setup in
manner required. Using this option implicitly sets path, which the manner required. Using this option implicitly sets path,
is a [remembered option][REMEMBERED OPTIONS]. which is a [remembered option][REMEMBERED OPTIONS].
--system --system
Installs the gems specified in the bundle to the system's Installs the gems specified in the bundle to the system's
Rubygems location. This overrides any previous configuration of Rubygems location. This overrides any previous configuration of
--path. --path.
--trust-policy=[<policy>] --trust-policy=[<policy>]
Apply the Rubygems security policy policy, where policy is one Apply the Rubygems security policy policy, where policy is one
of HighSecurity, MediumSecurity, LowSecurity, AlmostNoSecurity, of HighSecurity, MediumSecurity, LowSecurity, AlmostNoSecurity,
or NoSecurity. For more details, please see the Rubygems signing or NoSecurity. For more details, please see the Rubygems signing
documentation linked below in SEE ALSO. documentation linked below in SEE ALSO.
--with=<list> --with=<list>
A space-separated list of groups referencing gems to install. If A space-separated list of groups referencing gems to install. If
an optional group is given it is installed. If a group is given an optional group is given it is installed. If a group is given
that is in the remembered list of groups given to --without, it that is in the remembered list of groups given to --without, it
is removed from that list. is removed from that list.
--without=<list> --without=<list>
A space-separated list of groups referencing gems to skip during A space-separated list of groups referencing gems to skip during
installation. If a group is given that is in the remembered list installation. If a group is given that is in the remembered list
of groups given to --with, it is removed from that list. of groups given to --with, it is removed from that list.
DEPLOYMENT MODE DEPLOYMENT MODE
Bundler's defaults are optimized for development. To switch to defaults Bundler's defaults are optimized for development. To switch to defaults
@ -159,36 +159,36 @@ DEPLOYMENT MODE
1. A Gemfile.lock is required. 1. A Gemfile.lock is required.
To ensure that the same versions of the gems you developed with and To ensure that the same versions of the gems you developed with and
tested with are also used in deployments, a Gemfile.lock is tested with are also used in deployments, a Gemfile.lock is
required. required.
This is mainly to ensure that you remember to check your Gem- This is mainly to ensure that you remember to check your
file.lock into version control. Gemfile.lock into version control.
2. The Gemfile.lock must be up to date 2. The Gemfile.lock must be up to date
In development, you can modify your Gemfile(5) and re-run bundle In development, you can modify your Gemfile(5) and re-run bundle
install to conservatively update your Gemfile.lock snapshot. install to conservatively update your Gemfile.lock snapshot.
In deployment, your Gemfile.lock should be up-to-date with changes In deployment, your Gemfile.lock should be up-to-date with changes
made in your Gemfile(5). made in your Gemfile(5).
3. Gems are installed to vendor/bundle not your default system loca- 3. Gems are installed to vendor/bundle not your default system
tion location
In development, it's convenient to share the gems used in your In development, it's convenient to share the gems used in your
application with other applications and other scripts that run on application with other applications and other scripts that run on
the system. the system.
In deployment, isolation is a more important default. In addition, In deployment, isolation is a more important default. In addition,
the user deploying the application may not have permission to the user deploying the application may not have permission to
install gems to the system, or the web server may not have permis- install gems to the system, or the web server may not have
sion to read them. permission to read them.
As a result, bundle install --deployment installs gems to the ven- As a result, bundle install --deployment installs gems to the
dor/bundle directory in the application. This may be overridden vendor/bundle directory in the application. This may be overridden
using the --path option. using the --path option.
@ -197,7 +197,7 @@ SUDO USAGE
In some cases, that location may not be writable by your Unix user. In In some cases, that location may not be writable by your Unix user. In
that case, Bundler will stage everything in a temporary directory, then that case, Bundler will stage everything in a temporary directory, then
ask you for your sudo password in order to copy the gems into their ask you for your sudo password in order to copy the gems into their
system location. system location.
From your perspective, this is identical to installing the gems From your perspective, this is identical to installing the gems
@ -216,8 +216,8 @@ SUDO USAGE
Of these three, the first two could theoretically be performed by Of these three, the first two could theoretically be performed by
chowning the resulting files to $SUDO_USER. The third, however, can chowning the resulting files to $SUDO_USER. The third, however, can
only be performed by invoking the git command as the current user. only be performed by invoking the git command as the current user.
Therefore, git gems are downloaded and installed into ~/.bundle rather Therefore, git gems are downloaded and installed into ~/.bundle rather
than $GEM_HOME or $BUNDLE_PATH. than $GEM_HOME or $BUNDLE_PATH.
As a result, you should run bundle install as the current user, and As a result, you should run bundle install as the current user, and
@ -232,9 +232,9 @@ INSTALLING GROUPS
groups with the --without option. This option takes a space-separated groups with the --without option. This option takes a space-separated
list of groups. list of groups.
While the --without option will skip installing the gems in the speci- While the --without option will skip installing the gems in the
fied groups, it will still download those gems and use them to resolve specified groups, it will still download those gems and use them to
the dependencies of every gem in your Gemfile(5). resolve the dependencies of every gem in your Gemfile(5).
This is so that installing a different set of groups on another machine This is so that installing a different set of groups on another machine
(such as a production server) will not change the gems and versions (such as a production server) will not change the gems and versions
@ -244,24 +244,24 @@ INSTALLING GROUPS
running in development and testing is also the third-party code you are running in development and testing is also the third-party code you are
running in production. You can choose to exclude some of that code in running in production. You can choose to exclude some of that code in
different environments, but you will never be caught flat-footed by different environments, but you will never be caught flat-footed by
different versions of third-party code being used in different environ- different versions of third-party code being used in different
ments. environments.
For a simple illustration, consider the following Gemfile(5): For a simple illustration, consider the following Gemfile(5):
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'sinatra' gem 'sinatra'
group :production do group :production do
gem 'rack-perftools-profiler' gem 'rack-perftools-profiler'
end end
In this case, sinatra depends on any version of Rack (>= 1.0), while In this case, sinatra depends on any version of Rack (>= 1.0), while
rack-perftools-profiler depends on 1.x (~> 1.0). rack-perftools-profiler depends on 1.x (~> 1.0).
When you run bundle install --without production in development, we When you run bundle install --without production in development, we
@ -271,14 +271,14 @@ INSTALLING GROUPS
when the production group is used. when the production group is used.
This should not cause any problems in practice, because we do not This should not cause any problems in practice, because we do not
attempt to install the gems in the excluded groups, and only evaluate attempt to install the gems in the excluded groups, and only evaluate
as part of the dependency resolution process. as part of the dependency resolution process.
This also means that you cannot include different versions of the same This also means that you cannot include different versions of the same
gem in different groups, because doing so would result in different gem in different groups, because doing so would result in different
sets of dependencies used in development and production. Because of the sets of dependencies used in development and production. Because of the
vagaries of the dependency resolution process, this usually affects vagaries of the dependency resolution process, this usually affects
more than the gems you list in your Gemfile(5), and can (surprisingly) more than the gems you list in your Gemfile(5), and can (surprisingly)
radically change the gems you are using. radically change the gems you are using.
THE GEMFILE.LOCK THE GEMFILE.LOCK
@ -287,12 +287,12 @@ THE GEMFILE.LOCK
specified in the Gemfile(5)) into a file called Gemfile.lock. specified in the Gemfile(5)) into a file called Gemfile.lock.
Bundler uses this file in all subsequent calls to bundle install, which Bundler uses this file in all subsequent calls to bundle install, which
guarantees that you always use the same exact code, even as your appli- guarantees that you always use the same exact code, even as your
cation moves across machines. application moves across machines.
Because of the way dependency resolution works, even a seemingly small Because of the way dependency resolution works, even a seemingly small
change (for instance, an update to a point-release of a dependency of a change (for instance, an update to a point-release of a dependency of a
gem in your Gemfile(5)) can result in radically different gems being gem in your Gemfile(5)) can result in radically different gems being
needed to satisfy all dependencies. needed to satisfy all dependencies.
As a result, you SHOULD check your Gemfile.lock into version control, As a result, you SHOULD check your Gemfile.lock into version control,
@ -302,15 +302,15 @@ THE GEMFILE.LOCK
third-party code being used if any of the gems in the Gemfile(5) or any third-party code being used if any of the gems in the Gemfile(5) or any
of their dependencies have been updated. of their dependencies have been updated.
When Bundler first shipped, the Gemfile.lock was included in the .git- When Bundler first shipped, the Gemfile.lock was included in the
ignore file included with generated gems. Over time, however, it became .gitignore file included with generated gems. Over time, however, it
clear that this practice forces the pain of broken dependencies onto became clear that this practice forces the pain of broken dependencies
new contributors, while leaving existing contributors potentially onto new contributors, while leaving existing contributors potentially
unaware of the problem. Since bundle install is usually the first step unaware of the problem. Since bundle install is usually the first step
towards a contribution, the pain of broken dependencies would discour- towards a contribution, the pain of broken dependencies would
age new contributors from contributing. As a result, we have revised discourage new contributors from contributing. As a result, we have
our guidance for gem authors to now recommend checking in the lock for revised our guidance for gem authors to now recommend checking in the
gems. lock for gems.
CONSERVATIVE UPDATING CONSERVATIVE UPDATING
When you make a change to the Gemfile(5) and then run bundle install, When you make a change to the Gemfile(5) and then run bundle install,
@ -324,19 +324,19 @@ CONSERVATIVE UPDATING
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'actionpack', '2.3.8' gem 'actionpack', '2.3.8'
gem 'activemerchant' gem 'activemerchant'
In this case, both actionpack and activemerchant depend on activesup- In this case, both actionpack and activemerchant depend on
port. The actionpack gem depends on activesupport 2.3.8 and rack ~> activesupport. The actionpack gem depends on activesupport 2.3.8 and
1.1.0, while the activemerchant gem depends on activesupport >= 2.3.2, rack ~> 1.1.0, while the activemerchant gem depends on activesupport >=
braintree >= 2.0.0, and builder >= 2.0.0. 2.3.2, braintree >= 2.0.0, and builder >= 2.0.0.
When the dependencies are first resolved, Bundler will select When the dependencies are first resolved, Bundler will select
activesupport 2.3.8, which satisfies the requirements of both gems in activesupport 2.3.8, which satisfies the requirements of both gems in
your Gemfile(5). your Gemfile(5).
@ -344,52 +344,52 @@ CONSERVATIVE UPDATING
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'actionpack', '3.0.0.rc' gem 'actionpack', '3.0.0.rc'
gem 'activemerchant' gem 'activemerchant'
The actionpack 3.0.0.rc gem has a number of new dependencies, and The actionpack 3.0.0.rc gem has a number of new dependencies, and
updates the activesupport dependency to = 3.0.0.rc and the rack depen- updates the activesupport dependency to = 3.0.0.rc and the rack
dency to ~> 1.2.1. dependency to ~> 1.2.1.
When you run bundle install, Bundler notices that you changed the When you run bundle install, Bundler notices that you changed the
actionpack gem, but not the activemerchant gem. It evaluates the gems actionpack gem, but not the activemerchant gem. It evaluates the gems
currently being used to satisfy its requirements: currently being used to satisfy its requirements:
activesupport 2.3.8 activesupport 2.3.8
also used to satisfy a dependency in activemerchant, which is also used to satisfy a dependency in activemerchant, which is
not being updated not being updated
rack ~> 1.1.0 rack ~> 1.1.0
not currently being used to satisfy another dependency not currently being used to satisfy another dependency
Because you did not explicitly ask to update activemerchant, you would Because you did not explicitly ask to update activemerchant, you would
not expect it to suddenly stop working after updating actionpack. How- not expect it to suddenly stop working after updating actionpack.
ever, satisfying the new activesupport 3.0.0.rc dependency of action- However, satisfying the new activesupport 3.0.0.rc dependency of
pack requires updating one of its dependencies. actionpack requires updating one of its dependencies.
Even though activemerchant declares a very loose dependency that theo- Even though activemerchant declares a very loose dependency that
retically matches activesupport 3.0.0.rc, Bundler treats gems in your theoretically matches activesupport 3.0.0.rc, Bundler treats gems in
Gemfile(5) that have not changed as an atomic unit together with their your Gemfile(5) that have not changed as an atomic unit together with
dependencies. In this case, the activemerchant dependency is treated as their dependencies. In this case, the activemerchant dependency is
activemerchant 1.7.1 + activesupport 2.3.8, so bundle install will treated as activemerchant 1.7.1 + activesupport 2.3.8, so bundle
report that it cannot update actionpack. install will report that it cannot update actionpack.
To explicitly update actionpack, including its dependencies which other To explicitly update actionpack, including its dependencies which other
gems in the Gemfile(5) still depend on, run bundle update actionpack gems in the Gemfile(5) still depend on, run bundle update actionpack
(see bundle update(1)). (see bundle update(1)).
Summary: In general, after making a change to the Gemfile(5) , you Summary: In general, after making a change to the Gemfile(5) , you
should first try to run bundle install, which will guarantee that no should first try to run bundle install, which will guarantee that no
other gem in the Gemfile(5) is impacted by the change. If that does not other gem in the Gemfile(5) is impacted by the change. If that does not
work, run bundle update(1) bundle-update.1.html. work, run bundle update(1) bundle-update.1.html.
SEE ALSO SEE ALSO
o Gem install docs o Gem install docs
http://guides.rubygems.org/rubygems-basics/#installing-gems http://guides.rubygems.org/rubygems-basics/#installing-gems
o Rubygems signing docs http://guides.rubygems.org/security/ o Rubygems signing docs http://guides.rubygems.org/security/
@ -398,4 +398,4 @@ SEE ALSO
January 2020 BUNDLE-INSTALL(1) May 2020 BUNDLE-INSTALL(1)

View file

@ -1,13 +1,13 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-LIST" "1" "January 2020" "" "" .TH "BUNDLE\-LIST" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-list\fR \- List all the gems in the bundle \fBbundle\-list\fR \- List all the gems in the bundle
. .
.SH "SYNOPSIS" .SH "SYNOPSIS"
\fBbundle list\fR [\-\-name\-only] [\-\-paths] [\-\-without\-group=GROUP] [\-\-only\-group=GROUP] \fBbundle list\fR [\-\-name\-only] [\-\-paths] [\-\-without\-group=GROUP[ GROUP\.\.\.]] [\-\-only\-group=GROUP[ GROUP\.\.\.]]
. .
.SH "DESCRIPTION" .SH "DESCRIPTION"
Prints a list of all the gems in the bundle including their version\. Prints a list of all the gems in the bundle including their version\.
@ -28,7 +28,7 @@ bundle list \-\-without\-group test
bundle list \-\-only\-group dev bundle list \-\-only\-group dev
. .
.P .P
bundle list \-\-only\-group dev \-\-paths bundle list \-\-only\-group dev test \-\-paths
. .
.SH "OPTIONS" .SH "OPTIONS"
. .
@ -41,10 +41,10 @@ Print only the name of each gem\.
Print the path to each gem in the bundle\. Print the path to each gem in the bundle\.
. .
.TP .TP
\fB\-\-without\-group\fR \fB\-\-without\-group=<list>\fR
Print all gems expect from a group\. A space\-separated list of groups of gems to skip during printing\.
. .
.TP .TP
\fB\-\-only\-group\fR \fB\-\-only\-group=<list>\fR
Print gems from a particular group\. A space\-separated list of groups of gems to print\.

View file

@ -1,4 +1,4 @@
BUNDLE-LIST(1) BUNDLE-LIST(1) BUNDLE-LIST(1) BUNDLE-LIST(1)
@ -6,8 +6,8 @@ NAME
bundle-list - List all the gems in the bundle bundle-list - List all the gems in the bundle
SYNOPSIS SYNOPSIS
bundle list [--name-only] [--paths] [--without-group=GROUP] bundle list [--name-only] [--paths] [--without-group=GROUP[ GROUP...]]
[--only-group=GROUP] [--only-group=GROUP[ GROUP...]]
DESCRIPTION DESCRIPTION
Prints a list of all the gems in the bundle including their version. Prints a list of all the gems in the bundle including their version.
@ -22,22 +22,23 @@ DESCRIPTION
bundle list --only-group dev bundle list --only-group dev
bundle list --only-group dev --paths bundle list --only-group dev test --paths
OPTIONS OPTIONS
--name-only --name-only
Print only the name of each gem. Print only the name of each gem.
--paths --paths
Print the path to each gem in the bundle. Print the path to each gem in the bundle.
--without-group --without-group=<list>
Print all gems expect from a group. A space-separated list of groups of gems to skip during
printing.
--only-group --only-group=<list>
Print gems from a particular group. A space-separated list of groups of gems to print.
January 2020 BUNDLE-LIST(1) May 2020 BUNDLE-LIST(1)

View file

@ -3,7 +3,7 @@ bundle-list(1) -- List all the gems in the bundle
## SYNOPSIS ## SYNOPSIS
`bundle list` [--name-only] [--paths] [--without-group=GROUP] [--only-group=GROUP] `bundle list` [--name-only] [--paths] [--without-group=GROUP[ GROUP...]] [--only-group=GROUP[ GROUP...]]
## DESCRIPTION ## DESCRIPTION
@ -19,7 +19,7 @@ bundle list --without-group test
bundle list --only-group dev bundle list --only-group dev
bundle list --only-group dev --paths bundle list --only-group dev test --paths
## OPTIONS ## OPTIONS
@ -27,7 +27,7 @@ bundle list --only-group dev --paths
Print only the name of each gem. Print only the name of each gem.
* `--paths`: * `--paths`:
Print the path to each gem in the bundle. Print the path to each gem in the bundle.
* `--without-group`: * `--without-group=<list>`:
Print all gems expect from a group. A space-separated list of groups of gems to skip during printing.
* `--only-group`: * `--only-group=<list>`:
Print gems from a particular group. A space-separated list of groups of gems to print.

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-LOCK" "1" "January 2020" "" "" .TH "BUNDLE\-LOCK" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-lock\fR \- Creates / Updates a lockfile without installing \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing

View file

@ -1,4 +1,4 @@
BUNDLE-LOCK(1) BUNDLE-LOCK(1) BUNDLE-LOCK(1) BUNDLE-LOCK(1)
@ -6,7 +6,7 @@ NAME
bundle-lock - Creates / Updates a lockfile without installing bundle-lock - Creates / Updates a lockfile without installing
SYNOPSIS SYNOPSIS
bundle lock [--update] [--local] [--print] [--lockfile=PATH] bundle lock [--update] [--local] [--print] [--lockfile=PATH]
[--full-index] [--add-platform] [--remove-platform] [--patch] [--minor] [--full-index] [--add-platform] [--remove-platform] [--patch] [--minor]
[--major] [--strict] [--conservative] [--major] [--strict] [--conservative]
@ -15,52 +15,52 @@ DESCRIPTION
OPTIONS OPTIONS
--update=<*gems> --update=<*gems>
Ignores the existing lockfile. Resolve then updates lockfile. Ignores the existing lockfile. Resolve then updates lockfile.
Taking a list of gems or updating all gems if no list is given. Taking a list of gems or updating all gems if no list is given.
--local --local
Do not attempt to connect to rubygems.org. Instead, Bundler will Do not attempt to connect to rubygems.org. Instead, Bundler will
use the gems already present in Rubygems' cache or in ven- use the gems already present in Rubygems' cache or in
dor/cache. Note that if a appropriate platform-specific gem vendor/cache. Note that if a appropriate platform-specific gem
exists on rubygems.org it will not be found. exists on rubygems.org it will not be found.
--print --print
Prints the lockfile to STDOUT instead of writing to the file Prints the lockfile to STDOUT instead of writing to the file
system. system.
--lockfile=<path> --lockfile=<path>
The path where the lockfile should be written to. The path where the lockfile should be written to.
--full-index --full-index
Fall back to using the single-file index of all gems. Fall back to using the single-file index of all gems.
--add-platform --add-platform
Add a new platform to the lockfile, re-resolving for the addi- Add a new platform to the lockfile, re-resolving for the
tion of that platform. addition of that platform.
--remove-platform --remove-platform
Remove a platform from the lockfile. Remove a platform from the lockfile.
--patch --patch
If updating, prefer updating only to next patch version. If updating, prefer updating only to next patch version.
--minor --minor
If updating, prefer updating only to next minor version. If updating, prefer updating only to next minor version.
--major --major
If updating, prefer updating to next major version (default). If updating, prefer updating to next major version (default).
--strict --strict
If updating, do not allow any gem to be updated past latest If updating, do not allow any gem to be updated past latest
--patch | --minor | --major. --patch | --minor | --major.
--conservative --conservative
If updating, use bundle install conservative update behavior and If updating, use bundle install conservative update behavior and
do not allow shared dependencies to be updated. do not allow shared dependencies to be updated.
UPDATING ALL GEMS UPDATING ALL GEMS
If you run bundle lock with --update option without list of gems, If you run bundle lock with --update option without list of gems,
bundler will ignore any previously installed gems and resolve all bundler will ignore any previously installed gems and resolve all
dependencies again based on the latest versions of all gems available dependencies again based on the latest versions of all gems available
in the sources. in the sources.
@ -69,12 +69,12 @@ UPDATING A LIST OF GEMS
the rest of the gems that you specified locked to the versions in the the rest of the gems that you specified locked to the versions in the
Gemfile.lock. Gemfile.lock.
For instance, you only want to update nokogiri, run bundle lock For instance, you only want to update nokogiri, run bundle lock
--update nokogiri. --update nokogiri.
Bundler will update nokogiri and any of its dependencies, but leave the Bundler will update nokogiri and any of its dependencies, but leave the
rest of the gems that you specified locked to the versions in the Gem- rest of the gems that you specified locked to the versions in the
file.lock. Gemfile.lock.
SUPPORTING OTHER PLATFORMS SUPPORTING OTHER PLATFORMS
If you want your bundle to support platforms other than the one you're If you want your bundle to support platforms other than the one you're
@ -90,4 +90,4 @@ PATCH LEVEL OPTIONS
January 2020 BUNDLE-LOCK(1) May 2020 BUNDLE-LOCK(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-OPEN" "1" "January 2020" "" "" .TH "BUNDLE\-OPEN" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-open\fR \- Opens the source directory for a gem in your bundle \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle

View file

@ -1,4 +1,4 @@
BUNDLE-OPEN(1) BUNDLE-OPEN(1) BUNDLE-OPEN(1) BUNDLE-OPEN(1)
@ -18,7 +18,7 @@ DESCRIPTION
bundle open 'rack' bundle open 'rack'
@ -26,4 +26,4 @@ DESCRIPTION
January 2020 BUNDLE-OPEN(1) May 2020 BUNDLE-OPEN(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-OUTDATED" "1" "January 2020" "" "" .TH "BUNDLE\-OUTDATED" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-outdated\fR \- List installed gems with newer versions available \fBbundle\-outdated\fR \- List installed gems with newer versions available

View file

@ -1,4 +1,4 @@
BUNDLE-OUTDATED(1) BUNDLE-OUTDATED(1) BUNDLE-OUTDATED(1) BUNDLE-OUTDATED(1)
@ -6,10 +6,10 @@ NAME
bundle-outdated - List installed gems with newer versions available bundle-outdated - List installed gems with newer versions available
SYNOPSIS SYNOPSIS
bundle outdated [GEM] [--local] [--pre] [--source] [--strict] bundle outdated [GEM] [--local] [--pre] [--source] [--strict]
[--parseable | --porcelain] [--group=GROUP] [--groups] [--parseable | --porcelain] [--group=GROUP] [--groups]
[--update-strict] [--patch|--minor|--major] [--filter-major] [--fil- [--update-strict] [--patch|--minor|--major] [--filter-major]
ter-minor] [--filter-patch] [--only-explicit] [--filter-minor] [--filter-patch] [--only-explicit]
DESCRIPTION DESCRIPTION
Outdated lists the names and versions of gems that have a newer version Outdated lists the names and versions of gems that have a newer version
@ -20,56 +20,56 @@ DESCRIPTION
OPTIONS OPTIONS
--local --local
Do not attempt to fetch gems remotely and use the gem cache Do not attempt to fetch gems remotely and use the gem cache
instead. instead.
--pre Check for newer pre-release gems. --pre Check for newer pre-release gems.
--source --source
Check against a specific source. Check against a specific source.
--strict --strict
Only list newer versions allowed by your Gemfile requirements. Only list newer versions allowed by your Gemfile requirements.
--parseable, --porcelain --parseable, --porcelain
Use minimal formatting for more parseable output. Use minimal formatting for more parseable output.
--group --group
List gems from a specific group. List gems from a specific group.
--groups --groups
List gems organized by groups. List gems organized by groups.
--update-strict --update-strict
Strict conservative resolution, do not allow any gem to be Strict conservative resolution, do not allow any gem to be
updated past latest --patch | --minor| --major. updated past latest --patch | --minor| --major.
--minor --minor
Prefer updating only to next minor version. Prefer updating only to next minor version.
--major --major
Prefer updating to next major version (default). Prefer updating to next major version (default).
--patch --patch
Prefer updating only to next patch version. Prefer updating only to next patch version.
--filter-major --filter-major
Only list major newer versions. Only list major newer versions.
--filter-minor --filter-minor
Only list minor newer versions. Only list minor newer versions.
--filter-patch --filter-patch
Only list patch newer versions. Only list patch newer versions.
--only-explicit --only-explicit
Only list gems specified in your Gemfile, not their dependen- Only list gems specified in your Gemfile, not their
cies. dependencies.
PATCH LEVEL OPTIONS PATCH LEVEL OPTIONS
See bundle update(1) bundle-update.1.html for details. See bundle update(1) bundle-update.1.html for details.
One difference between the patch level options in bundle update and One difference between the patch level options in bundle update and
here is the --strict option. --strict was already an option on outdated here is the --strict option. --strict was already an option on outdated
before the patch level options were added. --strict wasn't altered, and before the patch level options were added. --strict wasn't altered, and
the --update-strict option on outdated reflects what --strict does on the --update-strict option on outdated reflects what --strict does on
@ -83,9 +83,9 @@ FILTERING OUTPUT
* faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test" * faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test"
* hashie (newest 3.4.6, installed 1.2.0, requested = 1.2.0) in groups "default" * hashie (newest 3.4.6, installed 1.2.0, requested = 1.2.0) in groups "default"
* headless (newest 2.3.1, installed 2.2.3) in groups "test" * headless (newest 2.3.1, installed 2.2.3) in groups "test"
@ -93,7 +93,7 @@ FILTERING OUTPUT
* hashie (newest 3.4.6, installed 1.2.0, requested = 1.2.0) in groups "default" * hashie (newest 3.4.6, installed 1.2.0, requested = 1.2.0) in groups "default"
@ -101,7 +101,7 @@ FILTERING OUTPUT
* headless (newest 2.3.1, installed 2.2.3) in groups "test" * headless (newest 2.3.1, installed 2.2.3) in groups "test"
@ -109,7 +109,7 @@ FILTERING OUTPUT
* faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test" * faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test"
@ -118,14 +118,14 @@ FILTERING OUTPUT
* faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test" * faker (newest 1.6.6, installed 1.6.5, requested ~> 1.4) in groups "development, test"
* headless (newest 2.3.1, installed 2.2.3) in groups "test" * headless (newest 2.3.1, installed 2.2.3) in groups "test"
Combining all three filter options would be the same result as provid- Combining all three filter options would be the same result as
ing none of them. providing none of them.
January 2020 BUNDLE-OUTDATED(1) May 2020 BUNDLE-OUTDATED(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-PLATFORM" "1" "January 2020" "" "" .TH "BUNDLE\-PLATFORM" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-platform\fR \- Displays platform compatibility information \fBbundle\-platform\fR \- Displays platform compatibility information

View file

@ -1,4 +1,4 @@
BUNDLE-PLATFORM(1) BUNDLE-PLATFORM(1) BUNDLE-PLATFORM(1) BUNDLE-PLATFORM(1)
@ -16,11 +16,11 @@ DESCRIPTION
source "https://rubygems.org" source "https://rubygems.org"
ruby "1.9.3" ruby "1.9.3"
gem "rack" gem "rack"
@ -29,29 +29,29 @@ DESCRIPTION
Your platform is: x86_64-linux Your platform is: x86_64-linux
Your app has gems that work on these platforms: Your app has gems that work on these platforms:
* ruby * ruby
Your Gemfile specifies a Ruby version requirement: Your Gemfile specifies a Ruby version requirement:
* ruby 1.9.3 * ruby 1.9.3
Your current platform satisfies the Ruby version requirement. Your current platform satisfies the Ruby version requirement.
platform will list all the platforms in your Gemfile.lock as well as platform will list all the platforms in your Gemfile.lock as well as
the ruby directive if applicable from your Gemfile(5). It will also let the ruby directive if applicable from your Gemfile(5). It will also let
you know if the ruby directive requirement has been met. If ruby direc- you know if the ruby directive requirement has been met. If ruby
tive doesn't match the running Ruby VM, it will tell you what part does directive doesn't match the running Ruby VM, it will tell you what part
not. does not.
OPTIONS OPTIONS
--ruby It will display the ruby directive information, so you don't --ruby It will display the ruby directive information, so you don't
have to parse it from the Gemfile(5). have to parse it from the Gemfile(5).
January 2020 BUNDLE-PLATFORM(1) May 2020 BUNDLE-PLATFORM(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-PRISTINE" "1" "January 2020" "" "" .TH "BUNDLE\-PRISTINE" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-pristine\fR \- Restores installed gems to their pristine condition \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition

View file

@ -1,4 +1,4 @@
BUNDLE-PRISTINE(1) BUNDLE-PRISTINE(1) BUNDLE-PRISTINE(1) BUNDLE-PRISTINE(1)
@ -9,7 +9,7 @@ SYNOPSIS
bundle pristine bundle pristine
DESCRIPTION DESCRIPTION
pristine restores the installed gems in the bundle to their pristine pristine restores the installed gems in the bundle to their pristine
condition using the local gem cache from RubyGems. For git gems, a condition using the local gem cache from RubyGems. For git gems, a
forced checkout will be performed. forced checkout will be performed.
@ -18,8 +18,8 @@ DESCRIPTION
gem's git repository as if one were installing from scratch. gem's git repository as if one were installing from scratch.
Note: the Bundler gem cannot be restored to its original state with Note: the Bundler gem cannot be restored to its original state with
pristine. One also cannot use bundle pristine on gems with a 'path' pristine. One also cannot use bundle pristine on gems with a 'path'
option in the Gemfile, because bundler has no original copy it can option in the Gemfile, because bundler has no original copy it can
restore from. restore from.
When is it practical to use bundle pristine? When is it practical to use bundle pristine?
@ -35,10 +35,10 @@ DESCRIPTION
--all cleans all installed gems for that Ruby version. --all cleans all installed gems for that Ruby version.
If a developer forgets which gems in their project they might have been If a developer forgets which gems in their project they might have been
debugging, the Rubygems gem pristine [GEMNAME] command may be inconve- debugging, the Rubygems gem pristine [GEMNAME] command may be
nient. One can avoid waiting for gem pristine --all, and instead run inconvenient. One can avoid waiting for gem pristine --all, and instead
bundle pristine. run bundle pristine.
January 2020 BUNDLE-PRISTINE(1) May 2020 BUNDLE-PRISTINE(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-REMOVE" "1" "January 2020" "" "" .TH "BUNDLE\-REMOVE" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-remove\fR \- Removes gems from the Gemfile \fBbundle\-remove\fR \- Removes gems from the Gemfile

View file

@ -1,4 +1,4 @@
BUNDLE-REMOVE(1) BUNDLE-REMOVE(1) BUNDLE-REMOVE(1) BUNDLE-REMOVE(1)
@ -9,17 +9,17 @@ SYNOPSIS
bundle remove [GEM [GEM ...]] [--install] bundle remove [GEM [GEM ...]] [--install]
DESCRIPTION DESCRIPTION
Removes the given gems from the Gemfile while ensuring that the result- Removes the given gems from the Gemfile while ensuring that the
ing Gemfile is still valid. If a gem cannot be removed, a warning is resulting Gemfile is still valid. If a gem cannot be removed, a warning
printed. If a gem is already absent from the Gemfile, and error is is printed. If a gem is already absent from the Gemfile, and error is
raised. raised.
OPTIONS OPTIONS
--install --install
Runs bundle install after the given gems have been removed from Runs bundle install after the given gems have been removed from
the Gemfile, which ensures that both the lockfile and the the Gemfile, which ensures that both the lockfile and the
installed gems on disk are also updated to remove the given installed gems on disk are also updated to remove the given
gem(s). gem(s).
Example: Example:
@ -31,4 +31,4 @@ OPTIONS
January 2020 BUNDLE-REMOVE(1) May 2020 BUNDLE-REMOVE(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-SHOW" "1" "January 2020" "" "" .TH "BUNDLE\-SHOW" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem

View file

@ -1,4 +1,4 @@
BUNDLE-SHOW(1) BUNDLE-SHOW(1) BUNDLE-SHOW(1) BUNDLE-SHOW(1)
@ -9,19 +9,19 @@ SYNOPSIS
bundle show [GEM] [--paths] bundle show [GEM] [--paths]
DESCRIPTION DESCRIPTION
Without the [GEM] option, show will print a list of the names and ver- Without the [GEM] option, show will print a list of the names and
sions of all gems that are required by your [Gemfile(5)][Gemfile(5)], versions of all gems that are required by your
sorted by name. [Gemfile(5)][Gemfile(5)], sorted by name.
Calling show with [GEM] will list the exact location of that gem on Calling show with [GEM] will list the exact location of that gem on
your machine. your machine.
OPTIONS OPTIONS
--paths --paths
List the paths of all gems that are required by your [Gem- List the paths of all gems that are required by your
file(5)][Gemfile(5)], sorted by gem name. [Gemfile(5)][Gemfile(5)], sorted by gem name.
January 2020 BUNDLE-SHOW(1) May 2020 BUNDLE-SHOW(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-UPDATE" "1" "January 2020" "" "" .TH "BUNDLE\-UPDATE" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-update\fR \- Update your gems to the latest available versions \fBbundle\-update\fR \- Update your gems to the latest available versions

View file

@ -1,4 +1,4 @@
BUNDLE-UPDATE(1) BUNDLE-UPDATE(1) BUNDLE-UPDATE(1) BUNDLE-UPDATE(1)
@ -12,9 +12,9 @@ SYNOPSIS
DESCRIPTION DESCRIPTION
Update the gems specified (all gems, if --all flag is used), ignoring Update the gems specified (all gems, if --all flag is used), ignoring
the previously installed gems specified in the Gemfile.lock. In gen- the previously installed gems specified in the Gemfile.lock. In
eral, you should use bundle install(1) bundle-install.1.html to install general, you should use bundle install(1) bundle-install.1.html to
the same exact gems and versions across machines. install the same exact gems and versions across machines.
You would use bundle update to explicitly update the version of a gem. You would use bundle update to explicitly update the version of a gem.
@ -22,114 +22,114 @@ OPTIONS
--all Update all gems specified in Gemfile. --all Update all gems specified in Gemfile.
--group=<name>, -g=[<name>] --group=<name>, -g=[<name>]
Only update the gems in the specified group. For instance, you Only update the gems in the specified group. For instance, you
can update all gems in the development group with bundle update can update all gems in the development group with bundle update
--group development. You can also call bundle update rails --group development. You can also call bundle update rails
--group test to update the rails gem and all gems in the test --group test to update the rails gem and all gems in the test
group, for example. group, for example.
--source=<name> --source=<name>
The name of a :git or :path source used in the Gemfile(5). For The name of a :git or :path source used in the Gemfile(5). For
instance, with a :git source of instance, with a :git source of
http://github.com/rails/rails.git, you would call bundle update http://github.com/rails/rails.git, you would call bundle update
--source rails --source rails
--local --local
Do not attempt to fetch gems remotely and use the gem cache Do not attempt to fetch gems remotely and use the gem cache
instead. instead.
--ruby Update the locked version of Ruby to the current version of --ruby Update the locked version of Ruby to the current version of
Ruby. Ruby.
--bundler --bundler
Update the locked version of bundler to the invoked bundler ver- Update the locked version of bundler to the invoked bundler
sion. version.
--full-index --full-index
Fall back to using the single-file index of all gems. Fall back to using the single-file index of all gems.
--jobs=[<number>], -j[<number>] --jobs=[<number>], -j[<number>]
Specify the number of jobs to run in parallel. The default is 1. Specify the number of jobs to run in parallel. The default is 1.
--retry=[<number>] --retry=[<number>]
Retry failed network or git requests for number times. Retry failed network or git requests for number times.
--quiet --quiet
Only output warnings and errors. Only output warnings and errors.
--redownload --redownload
Force downloading every gem. Force downloading every gem.
--patch --patch
Prefer updating only to next patch version. Prefer updating only to next patch version.
--minor --minor
Prefer updating only to next minor version. Prefer updating only to next minor version.
--major --major
Prefer updating to next major version (default). Prefer updating to next major version (default).
--strict --strict
Do not allow any gem to be updated past latest --patch | --minor Do not allow any gem to be updated past latest --patch | --minor
| --major. | --major.
--conservative --conservative
Use bundle install conservative update behavior and do not allow Use bundle install conservative update behavior and do not allow
shared dependencies to be updated. shared dependencies to be updated.
UPDATING ALL GEMS UPDATING ALL GEMS
If you run bundle update --all, bundler will ignore any previously If you run bundle update --all, bundler will ignore any previously
installed gems and resolve all dependencies again based on the latest installed gems and resolve all dependencies again based on the latest
versions of all gems available in the sources. versions of all gems available in the sources.
Consider the following Gemfile(5): Consider the following Gemfile(5):
source "https://rubygems.org" source "https://rubygems.org"
gem "rails", "3.0.0.rc" gem "rails", "3.0.0.rc"
gem "nokogiri" gem "nokogiri"
When you run bundle install(1) bundle-install.1.html the first time, When you run bundle install(1) bundle-install.1.html the first time,
bundler will resolve all of the dependencies, all the way down, and bundler will resolve all of the dependencies, all the way down, and
install what you need: install what you need:
Fetching gem metadata from https://rubygems.org/......... Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies... Resolving dependencies...
Installing builder 2.1.2 Installing builder 2.1.2
Installing abstract 1.0.0 Installing abstract 1.0.0
Installing rack 1.2.8 Installing rack 1.2.8
Using bundler 1.7.6 Using bundler 1.7.6
Installing rake 10.4.0 Installing rake 10.4.0
Installing polyglot 0.3.5 Installing polyglot 0.3.5
Installing mime-types 1.25.1 Installing mime-types 1.25.1
Installing i18n 0.4.2 Installing i18n 0.4.2
Installing mini_portile 0.6.1 Installing mini_portile 0.6.1
Installing tzinfo 0.3.42 Installing tzinfo 0.3.42
Installing rack-mount 0.6.14 Installing rack-mount 0.6.14
Installing rack-test 0.5.7 Installing rack-test 0.5.7
Installing treetop 1.4.15 Installing treetop 1.4.15
Installing thor 0.14.6 Installing thor 0.14.6
Installing activesupport 3.0.0.rc Installing activesupport 3.0.0.rc
Installing erubis 2.6.6 Installing erubis 2.6.6
Installing activemodel 3.0.0.rc Installing activemodel 3.0.0.rc
Installing arel 0.4.0 Installing arel 0.4.0
Installing mail 2.2.20 Installing mail 2.2.20
Installing activeresource 3.0.0.rc Installing activeresource 3.0.0.rc
Installing actionpack 3.0.0.rc Installing actionpack 3.0.0.rc
Installing activerecord 3.0.0.rc Installing activerecord 3.0.0.rc
Installing actionmailer 3.0.0.rc Installing actionmailer 3.0.0.rc
Installing railties 3.0.0.rc Installing railties 3.0.0.rc
Installing rails 3.0.0.rc Installing rails 3.0.0.rc
Installing nokogiri 1.6.5 Installing nokogiri 1.6.5
Bundle complete! 2 Gemfile dependencies, 26 gems total. Bundle complete! 2 Gemfile dependencies, 26 gems total.
Use `bundle show [gemname]` to see where a bundled gem is installed. Use `bundle show [gemname]` to see where a bundled gem is installed.
@ -146,13 +146,13 @@ UPDATING ALL GEMS
use. use.
However, from time to time, you might want to update the gems you are However, from time to time, you might want to update the gems you are
using to the newest versions that still match the gems in your Gem- using to the newest versions that still match the gems in your
file(5). Gemfile(5).
To do this, run bundle update --all, which will ignore the Gem- To do this, run bundle update --all, which will ignore the
file.lock, and resolve all the dependencies again. Keep in mind that Gemfile.lock, and resolve all the dependencies again. Keep in mind that
this process can result in a significantly different set of the 25 this process can result in a significantly different set of the 25
gems, based on the requirements of new gems that the gem authors gems, based on the requirements of new gems that the gem authors
released since the last time you ran bundle update --all. released since the last time you ran bundle update --all.
UPDATING A LIST OF GEMS UPDATING A LIST OF GEMS
@ -164,7 +164,7 @@ UPDATING A LIST OF GEMS
version 1.4.4, and you want to update it without updating Rails and all version 1.4.4, and you want to update it without updating Rails and all
of its dependencies. To do this, run bundle update nokogiri. of its dependencies. To do this, run bundle update nokogiri.
Bundler will update nokogiri and any of its dependencies, but leave Bundler will update nokogiri and any of its dependencies, but leave
alone Rails and its dependencies. alone Rails and its dependencies.
OVERLAPPING DEPENDENCIES OVERLAPPING DEPENDENCIES
@ -174,34 +174,34 @@ OVERLAPPING DEPENDENCIES
source "https://rubygems.org" source "https://rubygems.org"
gem "thin" gem "thin"
gem "rack-perftools-profiler" gem "rack-perftools-profiler"
The thin gem depends on rack >= 1.0, while rack-perftools-profiler The thin gem depends on rack >= 1.0, while rack-perftools-profiler
depends on rack ~> 1.0. If you run bundle install, you get: depends on rack ~> 1.0. If you run bundle install, you get:
Fetching source index for https://rubygems.org/ Fetching source index for https://rubygems.org/
Installing daemons (1.1.0) Installing daemons (1.1.0)
Installing eventmachine (0.12.10) with native extensions Installing eventmachine (0.12.10) with native extensions
Installing open4 (1.0.1) Installing open4 (1.0.1)
Installing perftools.rb (0.4.7) with native extensions Installing perftools.rb (0.4.7) with native extensions
Installing rack (1.2.1) Installing rack (1.2.1)
Installing rack-perftools_profiler (0.0.2) Installing rack-perftools_profiler (0.0.2)
Installing thin (1.2.7) with native extensions Installing thin (1.2.7) with native extensions
Using bundler (1.0.0.rc.3) Using bundler (1.0.0.rc.3)
In this case, the two gems have their own set of dependencies, but they In this case, the two gems have their own set of dependencies, but they
share rack in common. If you run bundle update thin, bundler will share rack in common. If you run bundle update thin, bundler will
update daemons, eventmachine and rack, which are dependencies of thin, update daemons, eventmachine and rack, which are dependencies of thin,
but not open4 or perftools.rb, which are dependencies of but not open4 or perftools.rb, which are dependencies of
rack-perftools_profiler. Note that bundle update thin will update rack rack-perftools_profiler. Note that bundle update thin will update rack
even though it's also a dependency of rack-perftools_profiler. even though it's also a dependency of rack-perftools_profiler.
@ -210,85 +210,85 @@ OVERLAPPING DEPENDENCIES
are also dependencies of another gem. are also dependencies of another gem.
To prevent updating shared dependencies, prior to version 1.14 the only To prevent updating shared dependencies, prior to version 1.14 the only
option was the CONSERVATIVE UPDATING behavior in bundle install(1) bun- option was the CONSERVATIVE UPDATING behavior in bundle install(1)
dle-install.1.html: bundle-install.1.html:
In this scenario, updating the thin version manually in the Gemfile(5), In this scenario, updating the thin version manually in the Gemfile(5),
and then running bundle install(1) bundle-install.1.html will only and then running bundle install(1) bundle-install.1.html will only
update daemons and eventmachine, but not rack. For more information, update daemons and eventmachine, but not rack. For more information,
see the CONSERVATIVE UPDATING section of bundle install(1) bun- see the CONSERVATIVE UPDATING section of bundle install(1)
dle-install.1.html. bundle-install.1.html.
Starting with 1.14, specifying the --conservative option will also pre- Starting with 1.14, specifying the --conservative option will also
vent shared dependencies from being updated. prevent shared dependencies from being updated.
PATCH LEVEL OPTIONS PATCH LEVEL OPTIONS
Version 1.14 introduced 4 patch-level options that will influence how Version 1.14 introduced 4 patch-level options that will influence how
gem versions are resolved. One of the following options can be used: gem versions are resolved. One of the following options can be used:
--patch, --minor or --major. --strict can be added to further influence --patch, --minor or --major. --strict can be added to further influence
resolution. resolution.
--patch --patch
Prefer updating only to next patch version. Prefer updating only to next patch version.
--minor --minor
Prefer updating only to next minor version. Prefer updating only to next minor version.
--major --major
Prefer updating to next major version (default). Prefer updating to next major version (default).
--strict --strict
Do not allow any gem to be updated past latest --patch | --minor Do not allow any gem to be updated past latest --patch | --minor
| --major. | --major.
When Bundler is resolving what versions to use to satisfy declared When Bundler is resolving what versions to use to satisfy declared
requirements in the Gemfile or in parent gems, it looks up all avail- requirements in the Gemfile or in parent gems, it looks up all
able versions, filters out any versions that don't satisfy the require- available versions, filters out any versions that don't satisfy the
ment, and then, by default, sorts them from newest to oldest, consider- requirement, and then, by default, sorts them from newest to oldest,
ing them in that order. considering them in that order.
Providing one of the patch level options (e.g. --patch) changes the Providing one of the patch level options (e.g. --patch) changes the
sort order of the satisfying versions, causing Bundler to consider the sort order of the satisfying versions, causing Bundler to consider the
latest --patch or --minor version available before other versions. Note latest --patch or --minor version available before other versions. Note
that versions outside the stated patch level could still be resolved to that versions outside the stated patch level could still be resolved to
if necessary to find a suitable dependency graph. if necessary to find a suitable dependency graph.
For example, if gem 'foo' is locked at 1.0.2, with no gem requirement For example, if gem 'foo' is locked at 1.0.2, with no gem requirement
defined in the Gemfile, and versions 1.0.3, 1.0.4, 1.1.0, 1.1.1, 2.0.0 defined in the Gemfile, and versions 1.0.3, 1.0.4, 1.1.0, 1.1.1, 2.0.0
all exist, the default order of preference by default (--major) will be all exist, the default order of preference by default (--major) will be
"2.0.0, 1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2". "2.0.0, 1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2".
If the --patch option is used, the order of preference will change to If the --patch option is used, the order of preference will change to
"1.0.4, 1.0.3, 1.0.2, 1.1.1, 1.1.0, 2.0.0". "1.0.4, 1.0.3, 1.0.2, 1.1.1, 1.1.0, 2.0.0".
If the --minor option is used, the order of preference will change to If the --minor option is used, the order of preference will change to
"1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2, 2.0.0". "1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2, 2.0.0".
Combining the --strict option with any of the patch level options will Combining the --strict option with any of the patch level options will
remove any versions beyond the scope of the patch level option, to remove any versions beyond the scope of the patch level option, to
ensure that no gem is updated that far. ensure that no gem is updated that far.
To continue the previous example, if both --patch and --strict options To continue the previous example, if both --patch and --strict options
are used, the available versions for resolution would be "1.0.4, 1.0.3, are used, the available versions for resolution would be "1.0.4, 1.0.3,
1.0.2". If --minor and --strict are used, it would be "1.1.1, 1.1.0, 1.0.2". If --minor and --strict are used, it would be "1.1.1, 1.1.0,
1.0.4, 1.0.3, 1.0.2". 1.0.4, 1.0.3, 1.0.2".
Gem requirements as defined in the Gemfile will still be the first Gem requirements as defined in the Gemfile will still be the first
determining factor for what versions are available. If the gem require- determining factor for what versions are available. If the gem
ment for foo in the Gemfile is '~> 1.0', that will accomplish the same requirement for foo in the Gemfile is '~> 1.0', that will accomplish
thing as providing the --minor and --strict options. the same thing as providing the --minor and --strict options.
PATCH LEVEL EXAMPLES PATCH LEVEL EXAMPLES
Given the following gem specifications: Given the following gem specifications:
foo 1.4.3, requires: ~> bar 2.0 foo 1.4.3, requires: ~> bar 2.0
foo 1.4.4, requires: ~> bar 2.0 foo 1.4.4, requires: ~> bar 2.0
foo 1.4.5, requires: ~> bar 2.1 foo 1.4.5, requires: ~> bar 2.1
foo 1.5.0, requires: ~> bar 2.1 foo 1.5.0, requires: ~> bar 2.1
foo 1.5.1, requires: ~> bar 3.0 foo 1.5.1, requires: ~> bar 3.0
bar with versions 2.0.3, 2.0.4, 2.1.0, 2.1.1, 3.0.0 bar with versions 2.0.3, 2.0.4, 2.1.0, 2.1.1, 3.0.0
@ -296,7 +296,7 @@ PATCH LEVEL EXAMPLES
gem 'foo' gem 'foo'
@ -304,9 +304,9 @@ PATCH LEVEL EXAMPLES
foo (1.4.3) foo (1.4.3)
bar (~> 2.0) bar (~> 2.0)
bar (2.0.3) bar (2.0.3)
@ -314,13 +314,13 @@ PATCH LEVEL EXAMPLES
# Command Line Result # Command Line Result
------------------------------------------------------------ ------------------------------------------------------------
1 bundle update --patch 'foo 1.4.5', 'bar 2.1.1' 1 bundle update --patch 'foo 1.4.5', 'bar 2.1.1'
2 bundle update --patch foo 'foo 1.4.5', 'bar 2.1.1' 2 bundle update --patch foo 'foo 1.4.5', 'bar 2.1.1'
3 bundle update --minor 'foo 1.5.1', 'bar 3.0.0' 3 bundle update --minor 'foo 1.5.1', 'bar 3.0.0'
4 bundle update --minor --strict 'foo 1.5.0', 'bar 2.1.1' 4 bundle update --minor --strict 'foo 1.5.0', 'bar 2.1.1'
5 bundle update --patch --strict 'foo 1.4.4', 'bar 2.0.4' 5 bundle update --patch --strict 'foo 1.4.4', 'bar 2.0.4'
@ -348,43 +348,44 @@ RECOMMENDED WORKFLOW
o After you create your Gemfile(5) for the first time, run o After you create your Gemfile(5) for the first time, run
$ bundle install $ bundle install
o Check the resulting Gemfile.lock into version control o Check the resulting Gemfile.lock into version control
$ git add Gemfile.lock $ git add Gemfile.lock
o When checking out this repository on another development machine, o When checking out this repository on another development machine,
run run
$ bundle install $ bundle install
o When checking out this repository on a deployment machine, run o When checking out this repository on a deployment machine, run
$ bundle install --deployment $ bundle install --deployment
o After changing the Gemfile(5) to reflect a new or update depen- o After changing the Gemfile(5) to reflect a new or update
dency, run dependency, run
$ bundle install $ bundle install
o Make sure to check the updated Gemfile.lock into version control o Make sure to check the updated Gemfile.lock into version control
$ git add Gemfile.lock $ git add Gemfile.lock
o If bundle install(1) bundle-install.1.html reports a conflict, man- o If bundle install(1) bundle-install.1.html reports a conflict,
ually update the specific gems that you changed in the Gemfile(5) manually update the specific gems that you changed in the
Gemfile(5)
$ bundle update rails thin $ bundle update rails thin
o If you want to update all the gems to the latest possible versions o If you want to update all the gems to the latest possible versions
that still match the gems listed in the Gemfile(5), run that still match the gems listed in the Gemfile(5), run
$ bundle update --all $ bundle update --all
January 2020 BUNDLE-UPDATE(1) May 2020 BUNDLE-UPDATE(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-VIZ" "1" "January 2020" "" "" .TH "BUNDLE\-VIZ" "1" "May 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile

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