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:
parent
68224651a4
commit
0e60b59d58
Notes:
git
2020-05-13 07:55:16 +09:00
226 changed files with 4605 additions and 3751 deletions
|
@ -34,9 +34,9 @@ require_relative "bundler/build_metadata"
|
|||
# of loaded and required modules.
|
||||
#
|
||||
module Bundler
|
||||
environment_preserver = EnvironmentPreserver.new(ENV, EnvironmentPreserver::BUNDLER_KEYS)
|
||||
environment_preserver = EnvironmentPreserver.from_env
|
||||
ORIGINAL_ENV = environment_preserver.restore
|
||||
ENV.replace(environment_preserver.backup)
|
||||
environment_preserver.replace_with_backup
|
||||
SUDO_MUTEX = Mutex.new
|
||||
|
||||
autoload :Definition, File.expand_path("bundler/definition", __dir__)
|
||||
|
@ -285,7 +285,13 @@ module Bundler
|
|||
|
||||
def app_config_path
|
||||
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
|
||||
root.join(".bundle")
|
||||
end
|
||||
|
@ -451,6 +457,10 @@ EOF
|
|||
Bundler.settings[:system_bindir] || Bundler.rubygems.gem_bindir
|
||||
end
|
||||
|
||||
def preferred_gemfile_name
|
||||
Bundler.settings[:init_gems_rb] ? "gems.rb" : "Gemfile"
|
||||
end
|
||||
|
||||
def use_system_gems?
|
||||
configured_bundle_path.use_system_gems?
|
||||
end
|
||||
|
@ -512,7 +522,8 @@ EOF
|
|||
Your user account isn't allowed to install to the system RubyGems.
|
||||
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
|
||||
and install the bundled gems to RubyGems using sudo.
|
||||
|
|
|
@ -24,21 +24,24 @@ Gem::Specification.new do |s|
|
|||
|
||||
if s.respond_to?(:metadata=)
|
||||
s.metadata = {
|
||||
"bug_tracker_uri" => "https://github.com/bundler/bundler/issues",
|
||||
"changelog_uri" => "https://github.com/bundler/bundler/blob/master/CHANGELOG.md",
|
||||
"bug_tracker_uri" => "https://github.com/rubygems/bundler/issues",
|
||||
"changelog_uri" => "https://github.com/rubygems/bundler/blob/master/CHANGELOG.md",
|
||||
"homepage_uri" => "https://bundler.io/",
|
||||
"source_code_uri" => "https://github.com/bundler/bundler/",
|
||||
"source_code_uri" => "https://github.com/rubygems/bundler/",
|
||||
}
|
||||
end
|
||||
|
||||
s.required_ruby_version = ">= 2.3.0"
|
||||
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.require_paths = ["lib"]
|
||||
end
|
||||
|
|
|
@ -345,8 +345,8 @@ module Bundler
|
|||
|
||||
desc "list", "List all gems in the bundle"
|
||||
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 "without-group", :type => :string, :banner => "print all gems except from a group"
|
||||
method_option "only-group", :type => :array, :default => [], :banner => "print gems from a given set of groups"
|
||||
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"
|
||||
def 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 :git, :type => :boolean, :default => true, :desc => "Initialize a git repo inside your library."
|
||||
method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set gem.mit true`."
|
||||
method_option :rubocop, :type => :boolean, :desc => "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set gem.rubocop true`."
|
||||
method_option :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)
|
||||
end
|
||||
|
||||
|
@ -815,7 +816,7 @@ module Bundler
|
|||
option = current_command.options[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
|
||||
|
||||
value = options[name]
|
||||
|
|
|
@ -12,7 +12,7 @@ module Bundler
|
|||
Bundler::SharedHelpers.major_deprecation 2, "bundle console will be replaced " \
|
||||
"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
|
||||
|
||||
console = get_console(Bundler.settings[:console] || "irb")
|
||||
|
|
|
@ -12,6 +12,7 @@ module Bundler
|
|||
TEST_FRAMEWORK_VERSIONS = {
|
||||
"rspec" => "3.0",
|
||||
"minitest" => "5.0",
|
||||
"test-unit" => "3.0",
|
||||
}.freeze
|
||||
|
||||
attr_reader :options, :gem_name, :thor, :name, :target
|
||||
|
@ -62,7 +63,7 @@ module Bundler
|
|||
ensure_safe_gem_name(name, constant_array)
|
||||
|
||||
templates = {
|
||||
"Gemfile.tt" => "Gemfile",
|
||||
"#{Bundler.preferred_gemfile_name}.tt" => Bundler.preferred_gemfile_name,
|
||||
"lib/newgem.rb.tt" => "lib/#{namespaced_path}.rb",
|
||||
"lib/newgem/version.rb.tt" => "lib/#{namespaced_path}/version.rb",
|
||||
"newgem.gemspec.tt" => "#{name}.gemspec",
|
||||
|
@ -92,16 +93,22 @@ module Bundler
|
|||
"spec/spec_helper.rb.tt" => "spec/spec_helper.rb",
|
||||
"spec/newgem_spec.rb.tt" => "spec/#{namespaced_path}_spec.rb"
|
||||
)
|
||||
config[:test_task] = :spec
|
||||
when "minitest"
|
||||
templates.merge!(
|
||||
"test/test_helper.rb.tt" => "test/test_helper.rb",
|
||||
"test/newgem_test.rb.tt" => "test/#{namespaced_path}_test.rb"
|
||||
"test/minitest/test_helper.rb.tt" => "test/test_helper.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
|
||||
|
||||
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?",
|
||||
"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 " \
|
||||
|
@ -124,6 +131,15 @@ module Bundler
|
|||
templates.merge!("CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md")
|
||||
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]
|
||||
|
||||
if options[:ext]
|
||||
|
@ -199,9 +215,9 @@ module Bundler
|
|||
|
||||
if test_framework.nil?
|
||||
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 " \
|
||||
"in the future. rspec/minitest/(none):"
|
||||
if result =~ /rspec|minitest/
|
||||
result = Bundler.ui.ask "Type 'rspec', 'minitest' or 'test-unit' to generate those test files now and " \
|
||||
"in the future. rspec/minitest/test-unit/(none):"
|
||||
if result =~ /rspec|minitest|test-unit/
|
||||
test_framework = result
|
||||
else
|
||||
test_framework = false
|
||||
|
|
|
@ -50,10 +50,17 @@ module Bundler
|
|||
end
|
||||
|
||||
def print_gem_info(spec)
|
||||
metadata = spec.metadata
|
||||
gem_info = String.new
|
||||
gem_info << " * #{spec.name} (#{spec.version}#{spec.git_version})\n"
|
||||
gem_info << "\tSummary: #{spec.summary}\n" if spec.summary
|
||||
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 << "\tDefault Gem: yes" if spec.respond_to?(:default_gem?) && spec.default_gem?
|
||||
Bundler.ui.info gem_info
|
||||
|
|
|
@ -41,7 +41,7 @@ module Bundler
|
|||
private
|
||||
|
||||
def gemfile
|
||||
@gemfile ||= Bundler.settings[:init_gems_rb] ? "gems.rb" : "Gemfile"
|
||||
@gemfile ||= Bundler.preferred_gemfile_name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,7 +10,7 @@ module Bundler
|
|||
be sure to check out these resources:
|
||||
|
||||
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
|
||||
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
|
||||
that we can diagnose and help fix the problem you're having. Please
|
||||
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
|
||||
|
||||
|
|
|
@ -4,14 +4,16 @@ module Bundler
|
|||
class CLI::List
|
||||
def initialize(options)
|
||||
@options = options
|
||||
@without_group = options["without-group"].map(&:to_sym)
|
||||
@only_group = options["only-group"].map(&:to_sym)
|
||||
end
|
||||
|
||||
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]
|
||||
|
||||
specs = if @options["only-group"] || @options["without-group"]
|
||||
specs = if @only_group.any? || @without_group.any?
|
||||
filtered_specs_by_groups
|
||||
else
|
||||
Bundler.load.specs
|
||||
|
@ -32,9 +34,9 @@ module Bundler
|
|||
private
|
||||
|
||||
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)
|
||||
|
||||
raise InvalidOption, "`#{@options["only-group"]}` group could not be found." if @options["only-group"] && !groups.include?(@options["only-group"].to_sym)
|
||||
(@without_group + @only_group).each do |group|
|
||||
raise InvalidOption, "`#{group}` group could not be found." unless groups.include?(group)
|
||||
end
|
||||
end
|
||||
|
||||
def filtered_specs_by_groups
|
||||
|
@ -44,10 +46,10 @@ module Bundler
|
|||
verify_group_exists(groups)
|
||||
|
||||
show_groups =
|
||||
if @options["without-group"]
|
||||
groups.reject {|g| g == @options["without-group"].to_sym }
|
||||
elsif @options["only-group"]
|
||||
groups.select {|g| g == @options["only-group"].to_sym }
|
||||
if @without_group.any?
|
||||
groups.reject {|g| @without_group.include?(g) }
|
||||
elsif @only_group.any?
|
||||
groups.select {|g| @only_group.include?(g) }
|
||||
else
|
||||
groups
|
||||
end.map(&:to_sym)
|
||||
|
|
|
@ -3,18 +3,16 @@
|
|||
module Bundler
|
||||
class CLI::Outdated
|
||||
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)
|
||||
@options = options
|
||||
@gems = gems
|
||||
@sources = Array(options[:source])
|
||||
|
||||
@filter_options_patch = options.keys &
|
||||
%w[filter-major filter-minor filter-patch]
|
||||
@filter_options_patch = options.keys & %w[filter-major filter-minor filter-patch]
|
||||
|
||||
@outdated_gems_by_groups = {}
|
||||
@outdated_gems_list = []
|
||||
@outdated_gems = []
|
||||
|
||||
@options_include_groups = [:group, :groups].any? do |v|
|
||||
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
|
||||
# sense otherwise.
|
||||
@strict = options["filter-strict"] ||
|
||||
Bundler::CLI::Common.patch_level_options(options).any?
|
||||
@strict = options["filter-strict"] || Bundler::CLI::Common.patch_level_options(options).any?
|
||||
end
|
||||
|
||||
def run
|
||||
|
@ -76,58 +73,54 @@ module Bundler
|
|||
end
|
||||
|
||||
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)
|
||||
next unless active_spec
|
||||
|
||||
next if active_spec.nil?
|
||||
next if filter_options_patch.any? &&
|
||||
!update_present_via_semver_portions(current_spec, active_spec, options)
|
||||
next unless filter_options_patch.empty? || update_present_via_semver_portions(current_spec, active_spec, options)
|
||||
|
||||
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)
|
||||
groups = nil
|
||||
|
||||
dependency = current_dependencies[current_spec.name]
|
||||
groups = ""
|
||||
if dependency && !options[:parseable]
|
||||
groups = dependency.groups.join(", ")
|
||||
end
|
||||
|
||||
outdated_gems_list << { :active_spec => active_spec,
|
||||
outdated_gems << {
|
||||
:active_spec => active_spec,
|
||||
:current_spec => current_spec,
|
||||
:dependency => dependency,
|
||||
:groups => groups }
|
||||
|
||||
outdated_gems_by_groups[groups] ||= []
|
||||
outdated_gems_by_groups[groups] << outdated_gems_list[-1]
|
||||
:groups => groups,
|
||||
}
|
||||
end
|
||||
|
||||
if outdated_gems_list.empty?
|
||||
display_nothing_outdated_message
|
||||
else
|
||||
if outdated_gems.empty?
|
||||
unless options[:parseable]
|
||||
Bundler.ui.info(header_outdated_message)
|
||||
Bundler.ui.info(nothing_outdated_message)
|
||||
end
|
||||
|
||||
else
|
||||
if options_include_groups
|
||||
ordered_groups = outdated_gems_by_groups.keys.compact.sort
|
||||
ordered_groups.insert(0, nil).each do |groups|
|
||||
gems = outdated_gems_by_groups[groups]
|
||||
contains_group = if groups
|
||||
groups.split(", ").include?(options[:group])
|
||||
else
|
||||
options[:group] == "group"
|
||||
end
|
||||
relevant_outdated_gems = outdated_gems.group_by {|g| g[:groups] }.sort.flat_map do |groups, gems|
|
||||
contains_group = groups.split(", ").include?(options[:group])
|
||||
next unless options[:groups] || contains_group
|
||||
|
||||
next if (!options[:groups] && !contains_group) || gems.nil?
|
||||
|
||||
unless options[:parseable]
|
||||
Bundler.ui.info(header_group_message(groups))
|
||||
end
|
||||
gems
|
||||
end.compact
|
||||
|
||||
if options[:parseable]
|
||||
relevant_outdated_gems.each do |gems|
|
||||
print_gems(gems)
|
||||
end
|
||||
else
|
||||
print_gems(outdated_gems_list)
|
||||
print_gems_table(relevant_outdated_gems)
|
||||
end
|
||||
elsif options[:parseable]
|
||||
print_gems(outdated_gems)
|
||||
else
|
||||
print_gems_table(outdated_gems)
|
||||
end
|
||||
|
||||
exit 1
|
||||
|
@ -140,22 +133,6 @@ module Bundler
|
|||
"#{group_text}#{groups.split(",").size > 1 ? "s" : ""} \"#{groups}\""
|
||||
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
|
||||
if filter_options_patch.any?
|
||||
display = filter_options_patch.map do |o|
|
||||
|
@ -169,6 +146,8 @@ module Bundler
|
|||
end
|
||||
|
||||
def retrieve_active_spec(definition, current_spec)
|
||||
return unless current_spec.match_platform(Bundler.local_platform)
|
||||
|
||||
if strict
|
||||
active_spec = definition.find_resolved_spec(current_spec)
|
||||
else
|
||||
|
@ -182,12 +161,6 @@ module Bundler
|
|||
active_spec
|
||||
end
|
||||
|
||||
def display_nothing_outdated_message
|
||||
unless options[:parseable]
|
||||
Bundler.ui.info(nothing_outdated_message)
|
||||
end
|
||||
end
|
||||
|
||||
def print_gems(gems_list)
|
||||
gems_list.each do |gem|
|
||||
print_gem(
|
||||
|
@ -199,6 +172,19 @@ module Bundler
|
|||
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)
|
||||
spec_version = "#{active_spec.version}#{active_spec.git_version}"
|
||||
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]
|
||||
spec_outdated_info.to_s
|
||||
elsif options_include_groups || !groups
|
||||
elsif options_include_groups || groups.empty?
|
||||
" * #{spec_outdated_info}"
|
||||
else
|
||||
" * #{spec_outdated_info} in #{groups_text("group", groups)}"
|
||||
|
@ -222,6 +208,16 @@ module Bundler
|
|||
Bundler.ui.info output_message.rstrip
|
||||
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!
|
||||
return unless Bundler.frozen_bundle?
|
||||
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.to_a[0].to_i
|
||||
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
|
||||
|
|
|
@ -23,6 +23,16 @@ module Bundler
|
|||
Bundler::Plugin.install(plugins, options)
|
||||
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"
|
||||
def list
|
||||
Bundler::Plugin.list
|
||||
|
|
|
@ -29,6 +29,11 @@ module Bundler
|
|||
|
||||
FileUtils.rm_rf spec.full_gem_path
|
||||
when Source::Git
|
||||
if source.local?
|
||||
Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is locally overriden.")
|
||||
next
|
||||
end
|
||||
|
||||
source.remote!
|
||||
if extension_cache_path = source.extension_cache_path(spec)
|
||||
FileUtils.rm_rf extension_cache_path
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require_relative "gem_parser"
|
||||
|
||||
module Bundler
|
||||
class CompactIndexClient
|
||||
class Cache
|
||||
|
@ -92,19 +94,9 @@ module Bundler
|
|||
header ? lines[header + 1..-1] : lines
|
||||
end
|
||||
|
||||
def parse_gem(string)
|
||||
version_and_platform, rest = string.split(" ", 2)
|
||||
version, platform = version_and_platform.split("-", 2)
|
||||
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
|
||||
def parse_gem(line)
|
||||
@gem_parser ||= GemParser.new
|
||||
@gem_parser.parse(line)
|
||||
end
|
||||
|
||||
def info_roots
|
||||
|
|
66
lib/bundler/compact_index_client/gem_parser.rb
Normal file
66
lib/bundler/compact_index_client/gem_parser.rb
Normal 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
|
|
@ -77,12 +77,17 @@ module Bundler
|
|||
@locked_bundler_version = nil
|
||||
@locked_ruby_version = nil
|
||||
@locked_specs_incomplete_for_platform = false
|
||||
@new_platform = nil
|
||||
|
||||
if lockfile && File.exist?(lockfile)
|
||||
@lockfile_contents = Bundler.read_file(lockfile)
|
||||
@locked_gems = LockfileParser.new(@lockfile_contents)
|
||||
@locked_platforms = @locked_gems.platforms
|
||||
if Bundler.settings[:force_ruby_platform]
|
||||
@platforms = [Gem::Platform::RUBY]
|
||||
else
|
||||
@platforms = @locked_platforms.dup
|
||||
end
|
||||
@locked_bundler_version = @locked_gems.bundler_version
|
||||
@locked_ruby_version = @locked_gems.ruby_version
|
||||
|
||||
|
@ -113,7 +118,7 @@ module Bundler
|
|||
end
|
||||
@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
|
||||
@path_changes = converge_paths
|
||||
|
@ -228,12 +233,13 @@ module Bundler
|
|||
end
|
||||
|
||||
def current_dependencies
|
||||
dependencies.select(&:should_include?)
|
||||
dependencies.select do |d|
|
||||
d.should_include? && !d.gem_platforms(@platforms).empty?
|
||||
end
|
||||
end
|
||||
|
||||
def specs_for(groups)
|
||||
deps = dependencies.select {|d| (d.groups & groups).any? }
|
||||
deps.delete_if {|d| !d.should_include? }
|
||||
deps = dependencies_for(groups)
|
||||
specs.for(expand_dependencies(deps))
|
||||
end
|
||||
|
||||
|
@ -450,9 +456,9 @@ module Bundler
|
|||
@locked_deps.each {|name, d| both_sources[name][1] = d.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"
|
||||
lockfile_source_name = lock_source || "no specified source"
|
||||
lockfile_source_name = lock_source
|
||||
changed << "* #{name} from `#{gemfile_source_name}` to `#{lockfile_source_name}`"
|
||||
end
|
||||
|
||||
|
@ -518,10 +524,6 @@ module Bundler
|
|||
raise InvalidOption, "Unable to remove the platform `#{platform}` since the only platforms are #{@platforms.join ", "}"
|
||||
end
|
||||
|
||||
def add_current_platform
|
||||
current_platforms.each {|platform| add_platform(platform) }
|
||||
end
|
||||
|
||||
def find_resolved_spec(current_spec)
|
||||
specs.find_by_name_and_platform(current_spec.name, current_spec.platform)
|
||||
end
|
||||
|
@ -543,6 +545,12 @@ module Bundler
|
|||
|
||||
private
|
||||
|
||||
def add_platforms
|
||||
(@dependencies.flat_map(&:expanded_platforms) + current_platforms).uniq.each do |platform|
|
||||
add_platform(platform)
|
||||
end
|
||||
end
|
||||
|
||||
def current_platforms
|
||||
current_platform = Bundler.local_platform
|
||||
[].tap do |platforms|
|
||||
|
@ -706,9 +714,6 @@ module Bundler
|
|||
elsif dep.source
|
||||
dep.source = sources.get(dep.source)
|
||||
end
|
||||
if dep.source.is_a?(Source::Gemspec)
|
||||
dep.platforms.concat(@platforms.map {|p| Dependency::REVERSE_PLATFORM_MAP[p] }.flatten(1)).uniq!
|
||||
end
|
||||
end
|
||||
|
||||
changes = false
|
||||
|
@ -858,8 +863,8 @@ module Bundler
|
|||
@metadata_dependencies ||= begin
|
||||
ruby_versions = concat_ruby_version_requirements(@ruby_version)
|
||||
if ruby_versions.empty? || !@ruby_version.exact?
|
||||
concat_ruby_version_requirements(RubyVersion.system)
|
||||
concat_ruby_version_requirements(locked_ruby_version_object) unless @unlock[:ruby]
|
||||
concat_ruby_version_requirements(RubyVersion.system, ruby_versions)
|
||||
concat_ruby_version_requirements(locked_ruby_version_object, ruby_versions) unless @unlock[:ruby]
|
||||
end
|
||||
[
|
||||
Dependency.new("Ruby\0", ruby_versions),
|
||||
|
@ -890,27 +895,23 @@ module Bundler
|
|||
dependencies.each do |dep|
|
||||
dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
|
||||
next if !remote && !dep.current_platform?
|
||||
platforms = dep.gem_platforms(sorted_platforms)
|
||||
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|
|
||||
dep.gem_platforms(sorted_platforms).each do |p|
|
||||
deps << DepProxy.new(dep, p) if remote || p == generic_local_platform
|
||||
end
|
||||
end
|
||||
deps
|
||||
end
|
||||
|
||||
def dependencies_for(groups)
|
||||
current_dependencies.reject do |d|
|
||||
(d.groups & groups).empty?
|
||||
end
|
||||
end
|
||||
|
||||
def requested_dependencies
|
||||
groups = requested_groups
|
||||
groups.map!(&:to_sym)
|
||||
dependencies.reject {|d| !d.should_include? || (d.groups & groups).empty? }
|
||||
dependencies_for(groups)
|
||||
end
|
||||
|
||||
def source_requirements
|
||||
|
|
|
@ -74,15 +74,6 @@ module Bundler
|
|||
:x64_mingw_26 => Gem::Platform::X64_MINGW,
|
||||
}.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)
|
||||
type = options["type"] || :runtime
|
||||
super(name, version, type)
|
||||
|
|
|
@ -75,8 +75,7 @@ module Bundler
|
|||
|
||||
@gemspecs << spec
|
||||
|
||||
gem_platforms = Bundler::Dependency::REVERSE_PLATFORM_MAP[Bundler::GemHelpers.generic_local_platform]
|
||||
gem spec.name, :name => spec.name, :path => path, :glob => glob, :platforms => gem_platforms
|
||||
gem spec.name, :name => spec.name, :path => path, :glob => glob
|
||||
|
||||
group(development_group) do
|
||||
spec.development_dependencies.each do |dep|
|
||||
|
|
|
@ -17,14 +17,38 @@ module Bundler
|
|||
].map(&:freeze).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>]
|
||||
def initialize(env, keys)
|
||||
@original = env.to_hash
|
||||
@original = env
|
||||
@keys = keys
|
||||
@prefix = BUNDLER_PREFIX
|
||||
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]
|
||||
def backup
|
||||
env = @original.clone
|
||||
|
|
|
@ -56,6 +56,7 @@ module Bundler
|
|||
class SudoNotPermittedError < BundlerError; status_code(30); end
|
||||
class ThreadCreationError < BundlerError; status_code(33); end
|
||||
class APIResponseMismatchError < BundlerError; status_code(34); end
|
||||
class APIResponseInvalidDependenciesError < BundlerError; status_code(35); end
|
||||
class GemfileEvalError < GemfileError; end
|
||||
class MarshalError < StandardError; end
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ module Bundler
|
|||
settings_flag(:allow_bundler_dependency_conflicts) { bundler_3_mode? }
|
||||
settings_flag(:allow_offline_install) { 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(:default_install_uses_path) { bundler_3_mode? }
|
||||
settings_flag(:deployment_means_frozen) { bundler_3_mode? }
|
||||
|
|
|
@ -229,6 +229,7 @@ module Bundler
|
|||
"BUILDBOX" => "buildbox",
|
||||
"GO_SERVER_URL" => "go",
|
||||
"SNAP_CI" => "snap",
|
||||
"GITLAB_CI" => "gitlab",
|
||||
"CI_NAME" => ENV["CI_NAME"],
|
||||
"CI" => "ci",
|
||||
}
|
||||
|
|
|
@ -23,13 +23,7 @@ module Bundler
|
|||
Bundler.ui.error error.message
|
||||
when LoadError
|
||||
raise error unless error.message =~ /cannot load such file -- openssl|openssl.so|libcrypto.so/
|
||||
Bundler.ui.error "\nCould not load OpenSSL."
|
||||
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
|
||||
Bundler.ui.error "\nCould not load OpenSSL. #{error.class}: #{error}\n#{error.backtrace.join("\n ")}"
|
||||
when Interrupt
|
||||
Bundler.ui.error "\nQuitting..."
|
||||
Bundler.ui.trace error
|
||||
|
@ -82,7 +76,7 @@ module Bundler
|
|||
|
||||
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)}
|
||||
|
||||
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
|
||||
end
|
||||
|
||||
|
@ -114,7 +108,7 @@ module Bundler
|
|||
message = exception.message.lines.first.tr(":", " ").chomp
|
||||
message = message.split("-").first if exception.is_a?(Errno)
|
||||
require "cgi"
|
||||
"https://github.com/bundler/bundler/search?q=" \
|
||||
"https://github.com/rubygems/bundler/search?q=" \
|
||||
"#{CGI.escape(message)}&type=Issues"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -25,8 +25,8 @@ module Bundler
|
|||
attr_reader :spec_path, :base, :gemspec
|
||||
|
||||
def initialize(base = nil, name = nil)
|
||||
@base = (base ||= SharedHelpers.pwd)
|
||||
gemspecs = name ? [File.join(base, "#{name}.gemspec")] : Dir[File.join(base, "{,*}.gemspec")]
|
||||
@base = File.expand_path(base || SharedHelpers.pwd)
|
||||
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
|
||||
@spec_path = gemspecs.first
|
||||
@gemspec = Bundler.load_gemspec(@spec_path)
|
||||
|
@ -73,7 +73,7 @@ module Bundler
|
|||
|
||||
def build_gem
|
||||
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)
|
||||
SharedHelpers.filesystem_access(File.join(base, "pkg")) {|p| FileUtils.mkdir_p(p) }
|
||||
FileUtils.mv(built_gem_path, "pkg")
|
||||
|
@ -84,9 +84,9 @@ module Bundler
|
|||
|
||||
def install_gem(built_gem_path = nil, local = false)
|
||||
built_gem_path ||= build_gem
|
||||
cmd = "#{gem_command} install #{built_gem_path}"
|
||||
cmd += " --local" if local
|
||||
_, status = sh_with_status(cmd.shellsplit)
|
||||
cmd = [*gem_command, "install", built_gem_path.to_s]
|
||||
cmd << "--local" if local
|
||||
_, status = sh_with_status(cmd)
|
||||
unless status.success?
|
||||
raise "Couldn't install gem, run `gem install #{built_gem_path}' for more detailed output"
|
||||
end
|
||||
|
@ -96,11 +96,11 @@ module Bundler
|
|||
protected
|
||||
|
||||
def rubygem_push(path)
|
||||
cmd = %W[#{gem_command} push #{path}]
|
||||
cmd = [*gem_command, "push", path]
|
||||
cmd << "--key" << gem_key if gem_key
|
||||
cmd << "--host" << allowed_push_host if allowed_push_host
|
||||
unless allowed_push_host || Bundler.user_home.join(".gem/credentials").file?
|
||||
raise "Your rubygems.org credentials aren't set. Run `gem push` to set them."
|
||||
raise "Your rubygems.org credentials aren't set. Run `gem signin` to set them."
|
||||
end
|
||||
sh_with_input(cmd)
|
||||
Bundler.ui.confirm "Pushed #{name} #{version} to #{gem_push_host}"
|
||||
|
@ -210,7 +210,7 @@ module Bundler
|
|||
end
|
||||
|
||||
def gem_command
|
||||
ENV["GEM_COMMAND"] ? ENV["GEM_COMMAND"] : "gem"
|
||||
ENV["GEM_COMMAND"]&.shellsplit || ["gem"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,7 +7,7 @@ module Bundler
|
|||
# available dependency versions as found in its index, before returning it to
|
||||
# to the resolution engine to select the best version.
|
||||
class GemVersionPromoter
|
||||
DEBUG = ENV["DEBUG_RESOLVER"]
|
||||
DEBUG = ENV["BUNDLER_DEBUG_RESOLVER"] || ENV["DEBUG_RESOLVER"]
|
||||
|
||||
attr_reader :level, :locked_specs, :unlock_gems
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ def gemfile(install = false, options = {}, &gemfile)
|
|||
|
||||
Bundler.ui = install ? ui : Bundler::UI::Silent.new
|
||||
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.post_install_messages.each do |name, message|
|
||||
Bundler.ui.info "Post-install message from #{name}:\n#{message}"
|
||||
|
|
|
@ -204,18 +204,7 @@ module Bundler
|
|||
|
||||
return 1 unless can_install_in_parallel?
|
||||
|
||||
auto_config_jobs = Bundler.feature_flag.auto_config_jobs?
|
||||
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
|
||||
Bundler.settings[:jobs] || processor_count
|
||||
end
|
||||
|
||||
def processor_count
|
||||
|
|
|
@ -19,11 +19,11 @@ module Bundler
|
|||
Bundler.ui.debug "#{worker}: #{spec.name} (#{spec.version}) from #{spec.loaded_from}"
|
||||
generate_executable_stubs
|
||||
return true, post_install_message
|
||||
rescue Bundler::InstallHookError, Bundler::SecurityError, APIResponseMismatchError
|
||||
rescue Bundler::InstallHookError, Bundler::SecurityError, Bundler::APIResponseMismatchError
|
||||
raise
|
||||
rescue Errno::ENOSPC
|
||||
return false, out_of_space_message
|
||||
rescue StandardError => e
|
||||
rescue Bundler::BundlerError, Gem::InstallError, Bundler::APIResponseInvalidDependenciesError => e
|
||||
return false, specific_failure_message(e)
|
||||
end
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ module Bundler
|
|||
install_serially
|
||||
end
|
||||
|
||||
handle_error if @specs.any?(&:failed?)
|
||||
handle_error if failed_specs.any?
|
||||
@specs
|
||||
ensure
|
||||
worker_pool && worker_pool.stop
|
||||
|
@ -132,6 +132,10 @@ module Bundler
|
|||
|
||||
private
|
||||
|
||||
def failed_specs
|
||||
@specs.select(&:failed?)
|
||||
end
|
||||
|
||||
def install_with_worker
|
||||
enqueue_specs
|
||||
process_specs until finished_installing?
|
||||
|
@ -156,11 +160,7 @@ module Bundler
|
|||
gem_installer = Bundler::GemInstaller.new(
|
||||
spec_install.spec, @installer, @standalone, worker_num, @force
|
||||
)
|
||||
success, message = begin
|
||||
gem_installer.install_from_spec
|
||||
rescue RuntimeError => e
|
||||
raise e, "#{e}\n\n#{require_tree_for_spec(spec_install.spec)}"
|
||||
end
|
||||
success, message = gem_installer.install_from_spec
|
||||
if success
|
||||
spec_install.state = :installed
|
||||
spec_install.post_install_message = message unless message.nil?
|
||||
|
@ -190,11 +190,11 @@ module Bundler
|
|||
end
|
||||
|
||||
def handle_error
|
||||
errors = @specs.select(&:failed?).map(&:error)
|
||||
errors = failed_specs.map(&:error)
|
||||
if exception = errors.find {|e| e.is_a?(Bundler::BundlerError) }
|
||||
raise exception
|
||||
end
|
||||
raise Bundler::InstallError, errors.map(&:to_s).join("\n\n")
|
||||
raise Bundler::InstallError, errors.join("\n\n")
|
||||
end
|
||||
|
||||
def require_tree_for_spec(spec)
|
||||
|
|
|
@ -46,6 +46,14 @@ module Bundler
|
|||
identifier == other.identifier
|
||||
end
|
||||
|
||||
def eql?(other)
|
||||
identifier.eql?(other.identifier)
|
||||
end
|
||||
|
||||
def hash
|
||||
identifier.hash
|
||||
end
|
||||
|
||||
def satisfies?(dependency)
|
||||
@name == dependency.name && dependency.requirement.satisfied_by?(Gem::Version.new(@version))
|
||||
end
|
||||
|
@ -72,8 +80,13 @@ module Bundler
|
|||
@specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name
|
||||
source.gemspec.tap {|s| s.source = source }
|
||||
else
|
||||
search = source.specs.search(search_object).last
|
||||
if search && Gem::Platform.new(search.platform) != Gem::Platform.new(platform) && !search.runtime_dependencies.-(dependencies.reject {|d| d.type == :development }).empty?
|
||||
platform_object = Gem::Platform.new(platform)
|
||||
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}) " \
|
||||
"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."
|
||||
|
|
|
@ -47,6 +47,32 @@ module Bundler
|
|||
Bundler.ui.error "Failed to install plugin #{name}: #{e.message}\n #{e.backtrace.join("\n ")}"
|
||||
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
|
||||
#
|
||||
def list
|
||||
|
|
|
@ -71,6 +71,15 @@ module Bundler
|
|||
raise
|
||||
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
|
||||
def index_file
|
||||
Plugin.root.join("index")
|
||||
|
|
|
@ -26,12 +26,3 @@ module Bundler
|
|||
YamlLibrarySyntaxError = ::ArgumentError
|
||||
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
|
||||
|
|
|
@ -50,6 +50,8 @@ module Bundler
|
|||
# once the remote gem is downloaded, the backend specification will
|
||||
# be swapped out.
|
||||
def __swap__(spec)
|
||||
raise APIResponseInvalidDependenciesError unless spec.dependencies.all? {|d| d.is_a?(Gem::Dependency) }
|
||||
|
||||
SharedHelpers.ensure_same_dependencies(self, dependencies, spec.dependencies)
|
||||
@_remote_specification = spec
|
||||
end
|
||||
|
@ -76,7 +78,8 @@ module Bundler
|
|||
deps = method_missing(:dependencies)
|
||||
|
||||
# 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
|
||||
|
|
|
@ -75,12 +75,17 @@ module Bundler
|
|||
return unless debug?
|
||||
debug_info = yield
|
||||
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
|
||||
|
||||
def debug?
|
||||
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
|
||||
|
||||
def before_resolution
|
||||
|
@ -146,7 +151,26 @@ module Bundler
|
|||
@gem_version_promoter.sort_versions(dependency, spec_groups)
|
||||
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
|
||||
|
||||
def index_for(dependency)
|
||||
|
@ -183,9 +207,7 @@ module Bundler
|
|||
end
|
||||
|
||||
def requirement_satisfied_by?(requirement, activated, spec)
|
||||
return false unless requirement.matches_spec?(spec) || spec.source.is_a?(Source::Gemspec)
|
||||
spec.activate_platform!(requirement.__platform) if !@platforms || @platforms.include?(requirement.__platform)
|
||||
true
|
||||
requirement.matches_spec?(spec) || spec.source.is_a?(Source::Gemspec)
|
||||
end
|
||||
|
||||
def relevant_sources_for_vertex(vertex)
|
||||
|
@ -223,8 +245,9 @@ module Bundler
|
|||
end
|
||||
|
||||
def self.platform_sort_key(platform)
|
||||
return ["", "", ""] if Gem::Platform::RUBY == platform
|
||||
platform.to_a.map {|part| part || "" }
|
||||
# Prefer specific platform to not specific platform
|
||||
return ["99-LAST", "", "", ""] if Gem::Platform::RUBY == platform
|
||||
["00", *platform.to_a.map {|part| part || "" }]
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -9,6 +9,7 @@ module Bundler
|
|||
attr_accessor :ignores_bundler_dependencies
|
||||
|
||||
def initialize(all_specs)
|
||||
@all_specs = all_specs
|
||||
raise ArgumentError, "cannot initialize with an empty value" unless exemplary_spec = all_specs.first
|
||||
@name = exemplary_spec.name
|
||||
@version = exemplary_spec.version
|
||||
|
@ -28,7 +29,7 @@ module Bundler
|
|||
lazy_spec = LazySpecification.new(name, version, s.platform, source)
|
||||
lazy_spec.dependencies.replace s.dependencies
|
||||
lazy_spec
|
||||
end.compact
|
||||
end.compact.uniq
|
||||
end
|
||||
|
||||
def activate_platform!(platform)
|
||||
|
@ -37,13 +38,25 @@ module Bundler
|
|||
@activated_platforms << platform
|
||||
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)
|
||||
spec = @specs[platform]
|
||||
!spec.nil?
|
||||
!spec_for(platform).nil?
|
||||
end
|
||||
|
||||
def to_s
|
||||
@to_s ||= "#{name} (#{version})"
|
||||
activated_platforms_string = sorted_activated_platforms.join(", ")
|
||||
"#{name} (#{version}) (#{activated_platforms_string})"
|
||||
end
|
||||
|
||||
def dependencies_for_activated_platforms
|
||||
|
@ -58,6 +71,7 @@ module Bundler
|
|||
return unless other.is_a?(SpecGroup)
|
||||
name == other.name &&
|
||||
version == other.version &&
|
||||
sorted_activated_platforms == other.sorted_activated_platforms &&
|
||||
source == other.source
|
||||
end
|
||||
|
||||
|
@ -65,11 +79,18 @@ module Bundler
|
|||
return unless other.is_a?(SpecGroup)
|
||||
name.eql?(other.name) &&
|
||||
version.eql?(other.version) &&
|
||||
sorted_activated_platforms.eql?(other.sorted_activated_platforms) &&
|
||||
source.eql?(other.source)
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
private
|
||||
|
|
|
@ -51,7 +51,8 @@ module Gem
|
|||
alias_method :rg_extension_dir, :extension_dir
|
||||
def extension_dir
|
||||
@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
|
||||
rg_extension_dir
|
||||
end
|
||||
|
|
|
@ -346,7 +346,7 @@ module Bundler
|
|||
raise e
|
||||
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?
|
||||
end
|
||||
end
|
||||
|
@ -443,35 +443,6 @@ module Bundler
|
|||
Gem.clear_paths
|
||||
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
|
||||
@replaced_methods.each do |(sym, klass), method|
|
||||
redefine_method(klass, sym, method)
|
||||
|
@ -602,10 +573,10 @@ module Bundler
|
|||
|
||||
def backport_ext_builder_monitor
|
||||
# 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
|
||||
end
|
||||
RB
|
||||
RUBY
|
||||
|
||||
require "rubygems/ext/builder"
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ module Bundler
|
|||
allow_offline_install
|
||||
auto_clean_without_path
|
||||
auto_install
|
||||
auto_config_jobs
|
||||
cache_all
|
||||
cache_all_platforms
|
||||
default_install_uses_path
|
||||
|
@ -22,7 +21,6 @@ module Bundler
|
|||
disable_exec_load
|
||||
disable_local_branch_check
|
||||
disable_multisource
|
||||
disable_platform_warnings
|
||||
disable_shared_gems
|
||||
disable_version_check
|
||||
force_ruby_platform
|
||||
|
|
|
@ -230,6 +230,10 @@ module Bundler
|
|||
@allow_remote || @allow_cached
|
||||
end
|
||||
|
||||
def local?
|
||||
@local
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def serialize_gemspecs_in(destination)
|
||||
|
@ -256,10 +260,6 @@ module Bundler
|
|||
cached_revision && super
|
||||
end
|
||||
|
||||
def local?
|
||||
@local
|
||||
end
|
||||
|
||||
def requires_checkout?
|
||||
allow_git_ops? && !local? && !cached_revision_checked_out?
|
||||
end
|
||||
|
|
|
@ -18,7 +18,7 @@ module Bundler
|
|||
def initialize(command)
|
||||
msg = String.new
|
||||
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")}"
|
||||
super msg
|
||||
end
|
||||
|
@ -27,21 +27,21 @@ module Bundler
|
|||
class GitCommandError < GitError
|
||||
attr_reader :command
|
||||
|
||||
def initialize(command, path = nil, extra_info = nil)
|
||||
def initialize(command, path, destination_path, extra_info = nil)
|
||||
@command = command
|
||||
|
||||
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 << "\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
|
||||
end
|
||||
end
|
||||
|
||||
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?"
|
||||
super command, path, msg
|
||||
super command, path, destination_path, msg
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -62,26 +62,18 @@ module Bundler
|
|||
end
|
||||
|
||||
def revision
|
||||
return @revision if @revision
|
||||
|
||||
begin
|
||||
@revision ||= find_local_revision
|
||||
rescue GitCommandError => e
|
||||
raise MissingGitRevisionError.new(e.command, path, ref, URICredentialsFilter.credential_filtered_uri(uri))
|
||||
end
|
||||
|
||||
@revision
|
||||
end
|
||||
|
||||
def branch
|
||||
@branch ||= allowed_in_path do
|
||||
git("rev-parse --abbrev-ref HEAD").strip
|
||||
@branch ||= allowed_with_path do
|
||||
git("rev-parse --abbrev-ref HEAD", :dir => path).strip
|
||||
end
|
||||
end
|
||||
|
||||
def contains?(commit)
|
||||
allowed_in_path do
|
||||
result, status = git_null("branch --contains #{commit}")
|
||||
allowed_with_path do
|
||||
result, status = git_null("branch --contains #{commit}", :dir => path)
|
||||
status.success? && result =~ /^\* (.*)$/
|
||||
end
|
||||
end
|
||||
|
@ -108,8 +100,8 @@ module Bundler
|
|||
return unless extra_ref
|
||||
end
|
||||
|
||||
in_path do
|
||||
git_retry %(fetch --force --quiet --tags #{uri_escaped_with_configured_credentials} "refs/heads/*:refs/heads/*" #{extra_ref})
|
||||
with_path do
|
||||
git_retry %(fetch --force --quiet --tags #{uri_escaped_with_configured_credentials} "refs/heads/*:refs/heads/*" #{extra_ref}), :dir => path
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -133,58 +125,54 @@ module Bundler
|
|||
end
|
||||
end
|
||||
# method 2
|
||||
SharedHelpers.chdir(destination) do
|
||||
git_retry %(fetch --force --quiet --tags "#{path}")
|
||||
git_retry %(fetch --force --quiet --tags "#{path}"), :dir => destination
|
||||
|
||||
begin
|
||||
git "reset --hard #{@revision}"
|
||||
git "reset --hard #{@revision}", :dir => destination
|
||||
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
|
||||
|
||||
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")
|
||||
git_retry "submodule deinit --all --force"
|
||||
end
|
||||
git_retry "submodule deinit --all --force", :dir => destination
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def git_null(command)
|
||||
command_with_no_credentials = URICredentialsFilter.credential_filtered_string(command, uri)
|
||||
raise GitNotAllowedError.new(command_with_no_credentials) unless allow?
|
||||
def git_null(command, dir: SharedHelpers.pwd)
|
||||
check_allowed(command)
|
||||
|
||||
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
|
||||
|
||||
[URICredentialsFilter.credential_filtered_string(out, uri), status]
|
||||
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
|
||||
git(command)
|
||||
git(command, :dir => dir)
|
||||
end
|
||||
end
|
||||
|
||||
def git(command, check_errors = true, error_msg = nil)
|
||||
command_with_no_credentials = URICredentialsFilter.credential_filtered_string(command, uri)
|
||||
raise GitNotAllowedError.new(command_with_no_credentials) unless allow?
|
||||
def git(command, dir: SharedHelpers.pwd)
|
||||
command_with_no_credentials = check_allowed(command)
|
||||
|
||||
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
|
||||
|
||||
stdout_with_no_credentials = URICredentialsFilter.credential_filtered_string(out, uri)
|
||||
raise GitCommandError.new(command_with_no_credentials, path, error_msg) if check_errors && !status.success?
|
||||
stdout_with_no_credentials
|
||||
raise GitCommandError.new(command_with_no_credentials, path, dir) unless status.success?
|
||||
|
||||
URICredentialsFilter.credential_filtered_string(out, uri)
|
||||
end
|
||||
|
||||
def has_revision_cached?
|
||||
return unless @revision
|
||||
in_path { git("cat-file -e #{@revision}") }
|
||||
with_path { git("cat-file -e #{@revision}", :dir => path) }
|
||||
true
|
||||
rescue GitError
|
||||
false
|
||||
|
@ -195,9 +183,11 @@ module Bundler
|
|||
end
|
||||
|
||||
def find_local_revision
|
||||
allowed_in_path do
|
||||
git("rev-parse --verify #{Shellwords.shellescape(ref)}", true).strip
|
||||
allowed_with_path do
|
||||
git("rev-parse --verify #{Shellwords.shellescape(ref)}", :dir => path).strip
|
||||
end
|
||||
rescue GitCommandError => e
|
||||
raise MissingGitRevisionError.new(e.command, path, path, ref, URICredentialsFilter.credential_filtered_uri(uri))
|
||||
end
|
||||
|
||||
# Escape the URI for git commands
|
||||
|
@ -230,27 +220,32 @@ module Bundler
|
|||
@git ? @git.allow_git_ops? : true
|
||||
end
|
||||
|
||||
def in_path(&blk)
|
||||
def with_path(&blk)
|
||||
checkout unless path.exist?
|
||||
_ = URICredentialsFilter # load it before we chdir
|
||||
SharedHelpers.chdir(path, &blk)
|
||||
blk.call
|
||||
end
|
||||
|
||||
def allowed_in_path
|
||||
return in_path { yield } if allow?
|
||||
def allowed_with_path
|
||||
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"
|
||||
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"
|
||||
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?
|
||||
[return_value, status]
|
||||
end
|
||||
|
||||
def capture_and_ignore_stderr(cmd)
|
||||
def capture_and_ignore_stderr(cmd, chdir: SharedHelpers.pwd)
|
||||
require "open3"
|
||||
return_value, _, status = Open3.capture3(cmd)
|
||||
return_value, _, status = Open3.capture3(cmd, :chdir => chdir)
|
||||
[return_value, status]
|
||||
end
|
||||
end
|
||||
|
|
|
@ -132,7 +132,11 @@ module Bundler
|
|||
end
|
||||
|
||||
def expand(somepath)
|
||||
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
|
||||
Bundler.ui.debug(e)
|
||||
raise PathError, "There was an error while trying to use the path " \
|
||||
|
|
|
@ -26,7 +26,6 @@ module Bundler
|
|||
end
|
||||
|
||||
def post_install
|
||||
SharedHelpers.chdir(@gem_dir) do
|
||||
run_hooks(:pre_install)
|
||||
|
||||
unless @disable_extensions
|
||||
|
@ -37,7 +36,6 @@ module Bundler
|
|||
generate_bin unless spec.executables.nil? || spec.executables.empty?
|
||||
|
||||
run_hooks(:post_install)
|
||||
end
|
||||
ensure
|
||||
Bundler.rm_rf(@tmp_dir) if Bundler.requires_sudo?
|
||||
end
|
||||
|
|
|
@ -2,73 +2,83 @@
|
|||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
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.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
Examples of behavior that contributes to a positive environment for our community include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
||||
* 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
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
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.
|
||||
|
||||
Project maintainers 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, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
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.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
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.
|
||||
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.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
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.
|
||||
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.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
||||
|
||||
## 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
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [https://contributor-covenant.org/version/1/4][version]
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
||||
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||
|
||||
[homepage]: https://contributor-covenant.org
|
||||
[version]: https://contributor-covenant.org/version/1/4/
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
||||
|
||||
[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.
|
||||
|
|
|
@ -3,10 +3,13 @@ source "https://rubygems.org"
|
|||
# Specify your gem's dependencies in <%= config[:name] %>.gemspec
|
||||
gemspec
|
||||
|
||||
gem "rake", "~> 12.0"
|
||||
gem "rake", "~> 13.0"
|
||||
<%- if config[:ext] -%>
|
||||
gem "rake-compiler"
|
||||
<%- end -%>
|
||||
<%- if config[:test] -%>
|
||||
gem "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>"
|
||||
<%- end -%>
|
||||
<%- if config[:rubocop] -%>
|
||||
gem "rubocop"
|
||||
<%- end -%>
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
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"
|
||||
|
||||
Rake::TestTask.new(:test) do |t|
|
||||
|
@ -8,13 +10,21 @@ Rake::TestTask.new(:test) do |t|
|
|||
t.test_files = FileList["test/**/*_test.rb"]
|
||||
end
|
||||
|
||||
<% elsif config[:test] == "rspec" -%>
|
||||
<% when "rspec" -%>
|
||||
require "rspec/core/rake_task"
|
||||
|
||||
RSpec::Core::RakeTask.new(:spec)
|
||||
|
||||
<% end -%>
|
||||
<% if config[:rubocop] -%>
|
||||
<% default_task_names << :rubocop -%>
|
||||
require "rubocop/rake_task"
|
||||
|
||||
RuboCop::RakeTask.new
|
||||
|
||||
<% end -%>
|
||||
<% if config[:ext] -%>
|
||||
<% default_task_names.unshift(:clobber, :compile) -%>
|
||||
require "rake/extensiontask"
|
||||
|
||||
task :build => :compile
|
||||
|
@ -23,7 +33,5 @@ Rake::ExtensionTask.new("<%= config[:underscored_name] %>") do |ext|
|
|||
ext.lib_dir = "lib/<%= config[:namespaced_path] %>"
|
||||
end
|
||||
|
||||
task :default => [:clobber, :compile, :<%= config[:test_task] %>]
|
||||
<% else -%>
|
||||
task :default => :<%= config[:test_task] %>
|
||||
<% end -%>
|
||||
task :default => <%= default_task_names.size == 1 ? default_task_names.first.inspect : default_task_names.inspect %>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require_relative 'lib/<%=config[:namespaced_path]%>/version'
|
||||
require_relative "lib/<%=config[:namespaced_path]%>/version"
|
||||
|
||||
Gem::Specification.new do |spec|
|
||||
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.
|
||||
# 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)/}) }
|
||||
end
|
||||
spec.bindir = "exe"
|
||||
|
|
11
lib/bundler/templates/newgem/test/minitest/newgem_test.rb.tt
Normal file
11
lib/bundler/templates/newgem/test/minitest/newgem_test.rb.tt
Normal 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
|
|
@ -0,0 +1,4 @@
|
|||
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
|
||||
require "<%= config[:namespaced_path] %>"
|
||||
|
||||
require "minitest/autorun"
|
|
@ -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
|
|
@ -0,0 +1,4 @@
|
|||
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
|
||||
require "<%= config[:namespaced_path] %>"
|
||||
|
||||
require "test-unit"
|
|
@ -12,15 +12,11 @@ autoload :OpenSSL, 'openssl'
|
|||
# servers you wish to talk to. For each host:port you communicate with a
|
||||
# single persistent connection is created.
|
||||
#
|
||||
# Multiple Bundler::Persistent::Net::HTTP::Persistent objects will share the same set of
|
||||
# connections.
|
||||
# Connections will be shared across threads through a connection pool to
|
||||
# increase reuse of connections.
|
||||
#
|
||||
# For each thread you start a new connection will be created. A
|
||||
# Bundler::Persistent::Net::HTTP::Persistent connection will not be shared across threads.
|
||||
#
|
||||
# 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.
|
||||
# You can shut down any remaining HTTP connections when done by calling
|
||||
# #shutdown.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
|
@ -28,7 +24,7 @@ autoload :OpenSSL, 'openssl'
|
|||
#
|
||||
# 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
|
||||
# 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
|
||||
# params which are sent in the body for other requests.
|
||||
#
|
||||
# == SSL
|
||||
# == TLS/SSL
|
||||
#
|
||||
# SSL connections are automatically created depending upon the scheme of the
|
||||
# Bundler::URI. SSL connections are automatically verified against the default
|
||||
# TLS connections are automatically created depending upon the scheme of the
|
||||
# Bundler::URI. TLS connections are automatically verified against the default
|
||||
# certificate store for your computer. You can override this by changing
|
||||
# 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
|
||||
# #ca_file :: The certificate-authorities
|
||||
|
@ -67,7 +63,7 @@ autoload :OpenSSL, 'openssl'
|
|||
# #private_key :: The client's SSL private key
|
||||
# #reuse_ssl_sessions :: Reuse a previously opened SSL session for a new
|
||||
# connection
|
||||
# #ssl_timeout :: SSL session lifetime
|
||||
# #ssl_timeout :: Session lifetime
|
||||
# #ssl_version :: Which specific SSL version to use
|
||||
# #verify_callback :: For server certificate verification
|
||||
# #verify_depth :: Depth of certificate verification
|
||||
|
@ -96,14 +92,15 @@ autoload :OpenSSL, 'openssl'
|
|||
#
|
||||
# === Segregation
|
||||
#
|
||||
# By providing an application name to ::new you can separate your connections
|
||||
# from the connections of other applications.
|
||||
# Each Bundler::Persistent::Net::HTTP::Persistent instance has its own pool of connections. There
|
||||
# is no sharing with other instances (as was true in earlier versions).
|
||||
#
|
||||
# === Idle Timeout
|
||||
#
|
||||
# If a connection hasn't been used for this number of seconds it will automatically be
|
||||
# reset upon the next use to avoid attempting to send to a closed connection.
|
||||
# The default value is 5 seconds. nil means no timeout. Set through #idle_timeout.
|
||||
# If a connection hasn't been used for this number of seconds it will
|
||||
# automatically be reset upon the next use to avoid attempting to send to a
|
||||
# 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
|
||||
# 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.
|
||||
# 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
|
||||
# effect, if set, connections will be reset on the request after max_requests.
|
||||
# 101st request will fail with ECONNRESET. If unset (default), this value has
|
||||
# no effect, if set, connections will be reset on the request after
|
||||
# max_requests.
|
||||
#
|
||||
# === Open Timeout
|
||||
#
|
||||
|
@ -131,45 +129,6 @@ autoload :OpenSSL, 'openssl'
|
|||
# Socket options may be set on newly-created connections. See #socket_options
|
||||
# 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
|
||||
#
|
||||
# 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:
|
||||
|
||||
##
|
||||
# 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
|
||||
DEFAULT_POOL_SIZE = 256
|
||||
else
|
||||
if Process.const_defined? :RLIMIT_NOFILE
|
||||
DEFAULT_POOL_SIZE = Process.getrlimit(Process::RLIMIT_NOFILE).first / 4
|
||||
else
|
||||
DEFAULT_POOL_SIZE = 256
|
||||
end
|
||||
|
||||
##
|
||||
# The version of Bundler::Persistent::Net::HTTP::Persistent you are using
|
||||
|
||||
VERSION = '3.1.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
|
||||
VERSION = '4.0.0'
|
||||
|
||||
##
|
||||
# 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
|
||||
|
||||
##
|
||||
# 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
|
||||
# HTTP/1.1 servers.
|
||||
|
@ -360,8 +313,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|||
attr_accessor :keep_alive
|
||||
|
||||
##
|
||||
# A name for this connection. Allows you to keep your connections apart
|
||||
# from everybody else's.
|
||||
# The name for this collection of persistent connections.
|
||||
|
||||
attr_reader :name
|
||||
|
||||
|
@ -490,23 +442,11 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|||
|
||||
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.
|
||||
#
|
||||
# Set +name+ to keep your connections apart from everybody else's. Not
|
||||
# required currently, but highly recommended. Your library name should be
|
||||
# good enough. This parameter will be required in a future version.
|
||||
# Set a +name+ for fun. Your library name should be good enough, but this
|
||||
# otherwise has no purpose.
|
||||
#
|
||||
# +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.
|
||||
|
@ -519,8 +459,9 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|||
# proxy.password = 'hunter2'
|
||||
#
|
||||
# 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
|
||||
# than this many threads with active HTTP transactions.
|
||||
# Defaults to 1/4 the number of allowed file handles or 256 if your OS does
|
||||
# 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
|
||||
@name = name
|
||||
|
@ -537,6 +478,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|||
@write_timeout = nil
|
||||
@idle_timeout = 5
|
||||
@max_requests = nil
|
||||
@max_retries = 1
|
||||
@socket_options = []
|
||||
@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
|
||||
end
|
||||
|
||||
@retry_change_requests = false
|
||||
|
||||
self.proxy = proxy if proxy
|
||||
end
|
||||
|
||||
|
@ -630,7 +570,9 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|||
|
||||
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
|
||||
else
|
||||
net_http_args.concat [nil, nil, nil, nil]
|
||||
|
@ -650,9 +592,11 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|||
reset connection
|
||||
end
|
||||
|
||||
http.read_timeout = @read_timeout if @read_timeout
|
||||
http.write_timeout = @write_timeout if @write_timeout && http.respond_to?(:write_timeout=)
|
||||
http.keep_alive_timeout = @idle_timeout if @idle_timeout
|
||||
http.max_retries = @max_retries if http.respond_to?(:max_retries=)
|
||||
http.read_timeout = @read_timeout if @read_timeout
|
||||
http.write_timeout = @write_timeout if
|
||||
@write_timeout && http.respond_to?(:write_timeout=)
|
||||
|
||||
return yield connection
|
||||
rescue Errno::ECONNREFUSED
|
||||
|
@ -670,27 +614,14 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|||
end
|
||||
|
||||
##
|
||||
# Returns an error message containing the number of requests performed on
|
||||
# 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
|
||||
# CGI::escape wrapper
|
||||
|
||||
def escape str
|
||||
CGI.escape str if str
|
||||
end
|
||||
|
||||
##
|
||||
# Bundler::URI::unescape wrapper
|
||||
# CGI::unescape wrapper
|
||||
|
||||
def unescape str
|
||||
CGI.unescape str if str
|
||||
|
@ -733,6 +664,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|||
def finish connection
|
||||
connection.finish
|
||||
|
||||
connection.http.instance_variable_set :@last_communicated, nil
|
||||
connection.http.instance_variable_set :@ssl_session, nil unless
|
||||
@reuse_ssl_sessions
|
||||
end
|
||||
|
@ -741,24 +673,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|||
# Returns the HTTP protocol version for +uri+
|
||||
|
||||
def http_version uri
|
||||
@http_versions["#{uri.host}:#{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)
|
||||
@http_versions["#{uri.hostname}:#{uri.port}"]
|
||||
end
|
||||
|
||||
##
|
||||
|
@ -768,6 +683,23 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|||
(uri =~ /^https?:/) ? uri : "http://#{uri}"
|
||||
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
|
||||
|
||||
|
@ -806,7 +738,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|||
|
||||
if @proxy_uri then
|
||||
@proxy_args = [
|
||||
@proxy_uri.host,
|
||||
@proxy_uri.hostname,
|
||||
@proxy_uri.port,
|
||||
unescape(@proxy_uri.user),
|
||||
unescape(@proxy_uri.password),
|
||||
|
@ -881,14 +813,15 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|||
end
|
||||
|
||||
##
|
||||
# Forces reconnection of HTTP connections.
|
||||
# Forces reconnection of all HTTP connections, including TLS/SSL
|
||||
# connections.
|
||||
|
||||
def reconnect
|
||||
@generation += 1
|
||||
end
|
||||
|
||||
##
|
||||
# Forces reconnection of SSL connections.
|
||||
# Forces reconnection of only TLS/SSL connections.
|
||||
|
||||
def reconnect_ssl
|
||||
@ssl_generation += 1
|
||||
|
@ -921,14 +854,8 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|||
# the response will not have been read).
|
||||
#
|
||||
# +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
|
||||
retried = false
|
||||
bad_response = false
|
||||
|
||||
uri = Bundler::URI uri
|
||||
req = request_setup req || uri
|
||||
response = nil
|
||||
|
@ -947,32 +874,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|||
response.connection_close? then
|
||||
finish connection
|
||||
end
|
||||
rescue Net::HTTPBadResponse => e
|
||||
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
|
||||
rescue Exception # make sure to close the connection when it was interrupted
|
||||
finish connection
|
||||
|
||||
raise
|
||||
|
@ -981,26 +883,11 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|||
end
|
||||
end
|
||||
|
||||
@http_versions["#{uri.host}:#{uri.port}"] ||= response.http_version
|
||||
@http_versions["#{uri.hostname}:#{uri.port}"] ||= response.http_version
|
||||
|
||||
response
|
||||
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
|
||||
# request.
|
||||
|
@ -1008,7 +895,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
|||
# Returns the request.
|
||||
|
||||
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
|
||||
else
|
||||
req_or_uri
|
||||
|
@ -1172,7 +1059,6 @@ application:
|
|||
|
||||
reconnect_ssl
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
require_relative 'persistent/connection'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: false
|
||||
|
||||
module Bundler
|
||||
VERSION = "2.1.4".freeze
|
||||
VERSION = "2.2.0.dev".freeze
|
||||
|
||||
def self.bundler_major_version
|
||||
@bundler_major_version ||= VERSION.split(".").first.to_i
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
|
||||
|
|
|
@ -20,8 +20,8 @@ DESCRIPTION
|
|||
|
||||
bundle add rails --version "< 3.0, > 1.1"
|
||||
|
||||
bundle add rails --version "~> 5.0.0" --source "https://gems.exam-
|
||||
ple.com" --group "development"
|
||||
bundle add rails --version "~> 5.0.0" --source
|
||||
"https://gems.example.com" --group "development"
|
||||
|
||||
bundle add rails --skip-install
|
||||
|
||||
|
@ -55,4 +55,4 @@ OPTIONS
|
|||
|
||||
|
||||
|
||||
January 2020 BUNDLE-ADD(1)
|
||||
May 2020 BUNDLE-ADD(1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
|
||||
|
|
|
@ -13,8 +13,8 @@ DESCRIPTION
|
|||
small Ruby file (a binstub) that loads Bundler, runs the command, and
|
||||
puts it into bin/. Binstubs are a shortcut-or alternative- to always
|
||||
using bundle exec. This gives you a file that can be run directly, and
|
||||
one that will always run the correct gem version used by the applica-
|
||||
tion.
|
||||
one that will always run the correct gem version used by the
|
||||
application.
|
||||
|
||||
For example, if you run bundle binstubs rspec-core, Bundler will create
|
||||
the file bin/rspec. That file will contain enough code to load Bundler,
|
||||
|
@ -45,4 +45,4 @@ BUNDLE INSTALL --BINSTUBS
|
|||
|
||||
|
||||
|
||||
January 2020 BUNDLE-BINSTUBS(1)
|
||||
May 2020 BUNDLE-BINSTUBS(1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
|
||||
|
|
|
@ -9,8 +9,8 @@ SYNOPSIS
|
|||
bundle cache
|
||||
|
||||
DESCRIPTION
|
||||
Copy all of the .gem files needed to run the application into the ven-
|
||||
dor/cache directory. In the future, when running [bundle
|
||||
Copy all of the .gem files needed to run the application into the
|
||||
vendor/cache directory. In the future, when running [bundle
|
||||
install(1)][bundle-install], use the gems in the cache in preference to
|
||||
the ones on rubygems.org.
|
||||
|
||||
|
@ -57,15 +57,15 @@ REMOTE FETCHING
|
|||
(common) problem can happen when developing on Windows and deploying to
|
||||
Linux, or even when developing on OSX and deploying to Linux.
|
||||
|
||||
If you know for sure that the gems packaged in vendor/cache are appro-
|
||||
priate for the platform you are on, you can run bundle install --local
|
||||
to skip checking for more appropriate gems, and use the ones in ven-
|
||||
dor/cache.
|
||||
If you know for sure that the gems packaged in vendor/cache are
|
||||
appropriate for the platform you are on, you can run bundle install
|
||||
--local to skip checking for more appropriate gems, and use the ones in
|
||||
vendor/cache.
|
||||
|
||||
One way to be sure that you have the right platformed versions of all
|
||||
your gems is to run bundle cache on an identical machine and check in
|
||||
the gems. For instance, you can run bundle cache on an identical stag-
|
||||
ing box during your staging process, and check in the vendor/cache
|
||||
the gems. For instance, you can run bundle cache on an identical
|
||||
staging box during your staging process, and check in the vendor/cache
|
||||
before deploying to production.
|
||||
|
||||
By default, bundle cache(1) bundle-cache.1.html fetches and also
|
||||
|
@ -75,4 +75,4 @@ REMOTE FETCHING
|
|||
|
||||
|
||||
|
||||
January 2020 BUNDLE-CACHE(1)
|
||||
May 2020 BUNDLE-CACHE(1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
|
||||
|
|
|
@ -20,8 +20,8 @@ OPTIONS
|
|||
Locks the [Gemfile(5)][Gemfile(5)] before running the command.
|
||||
|
||||
--gemfile
|
||||
Use the specified gemfile instead of the [Gemfile(5)][Gem-
|
||||
file(5)].
|
||||
Use the specified gemfile instead of the
|
||||
[Gemfile(5)][Gemfile(5)].
|
||||
|
||||
--path Specify a different path than the system default ($BUNDLE_PATH
|
||||
or $GEM_HOME). Bundler will remember this value for future
|
||||
|
@ -30,4 +30,4 @@ OPTIONS
|
|||
|
||||
|
||||
|
||||
January 2020 BUNDLE-CHECK(1)
|
||||
May 2020 BUNDLE-CHECK(1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
|
||||
|
|
|
@ -10,8 +10,8 @@ SYNOPSIS
|
|||
|
||||
DESCRIPTION
|
||||
This command will remove all unused gems in your bundler directory.
|
||||
This is useful when you have made many changes to your gem dependen-
|
||||
cies.
|
||||
This is useful when you have made many changes to your gem
|
||||
dependencies.
|
||||
|
||||
OPTIONS
|
||||
--dry-run
|
||||
|
@ -23,4 +23,4 @@ OPTIONS
|
|||
|
||||
|
||||
|
||||
January 2020 BUNDLE-CLEAN(1)
|
||||
May 2020 BUNDLE-CLEAN(1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\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:
|
||||
.
|
||||
.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
|
||||
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\.
|
||||
.
|
||||
.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
|
||||
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\.
|
||||
.
|
||||
.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\.
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
|
|
|
@ -9,12 +9,13 @@ SYNOPSIS
|
|||
bundle config [list|get|set|unset] [name [value]]
|
||||
|
||||
DESCRIPTION
|
||||
This command allows you to interact with Bundler's configuration sys-
|
||||
tem.
|
||||
This command allows you to interact with Bundler's configuration
|
||||
system.
|
||||
|
||||
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)
|
||||
|
||||
|
@ -24,12 +25,12 @@ DESCRIPTION
|
|||
|
||||
|
||||
|
||||
Executing bundle config list with will print a list of all bundler con-
|
||||
figuration for the current bundle, and where that configuration was
|
||||
Executing bundle config list with will print a list of all bundler
|
||||
configuration for the current bundle, and where that configuration was
|
||||
set.
|
||||
|
||||
Executing bundle config get <name> will print the value of that config-
|
||||
uration setting, and where it was set.
|
||||
Executing bundle config get <name> will print the value of that
|
||||
configuration setting, and where it was set.
|
||||
|
||||
Executing bundle config set <name> <value> will set that configuration
|
||||
to the value specified for all bundles executed as the current user.
|
||||
|
@ -39,15 +40,17 @@ DESCRIPTION
|
|||
Executing bundle config set --global <name> <value> works the same as
|
||||
above.
|
||||
|
||||
Executing bundle config set --local <name> <value> will set that con-
|
||||
figuration to the local application. The configuration will be stored
|
||||
in app/.bundle/config.
|
||||
Executing bundle config set --local <name> <value> will set that
|
||||
configuration in the directory for the local application. The
|
||||
configuration will be stored in <project_root>/.bundle/config. If
|
||||
BUNDLE_APP_CONFIG is set, the configuration will be stored in
|
||||
$BUNDLE_APP_CONFIG/config.
|
||||
|
||||
Executing bundle config unset <name> will delete the configuration in
|
||||
both local and global sources.
|
||||
|
||||
Executing bundle config unset --global <name> will delete the configu-
|
||||
ration only from the user configuration.
|
||||
Executing bundle config unset --global <name> will delete the
|
||||
configuration only from the user configuration.
|
||||
|
||||
Executing bundle config unset --local <name> <value> will delete the
|
||||
configuration only from the local application.
|
||||
|
@ -55,10 +58,10 @@ DESCRIPTION
|
|||
Executing bundle with the BUNDLE_IGNORE_CONFIG environment variable set
|
||||
will cause it to ignore all configuration.
|
||||
|
||||
Executing bundle config set disable_multisource true upgrades the warn-
|
||||
ing about the Gemfile containing multiple primary sources to an error.
|
||||
Executing bundle config unset disable_multisource downgrades this error
|
||||
to a warning.
|
||||
Executing bundle config set disable_multisource true upgrades the
|
||||
warning about the Gemfile containing multiple primary sources to an
|
||||
error. Executing bundle config unset disable_multisource downgrades
|
||||
this error to a warning.
|
||||
|
||||
REMEMBERING OPTIONS
|
||||
Flags passed to bundle install or the Bundler runtime, such as --path
|
||||
|
@ -71,17 +74,17 @@ REMEMBERING OPTIONS
|
|||
|
||||
The options that can be configured are:
|
||||
|
||||
bin Creates a directory (defaults to ~/bin) and place any executa-
|
||||
bles from the gem there. These executables run in Bundler's con-
|
||||
text. If used, you might add this directory to your environ-
|
||||
ment's PATH variable. For instance, if the rails gem comes with
|
||||
a rails executable, this flag will create a bin/rails executable
|
||||
that ensures that all referred dependencies will be resolved
|
||||
using the bundled gems.
|
||||
bin Creates a directory (defaults to ~/bin) and place any
|
||||
executables from the gem there. These executables run in
|
||||
Bundler's context. If used, you might add this directory to your
|
||||
environment's PATH variable. For instance, if the rails gem
|
||||
comes with a rails executable, this flag will create a bin/rails
|
||||
executable that ensures that all referred dependencies will be
|
||||
resolved using the bundled gems.
|
||||
|
||||
deployment
|
||||
In deployment mode, Bundler will 'roll-out' the bundle for pro-
|
||||
duction use. Please check carefully if you want to have this
|
||||
In deployment mode, Bundler will 'roll-out' the bundle for
|
||||
production use. Please check carefully if you want to have this
|
||||
option enabled in development or test environments.
|
||||
|
||||
path The location to install the specified gems to. This defaults to
|
||||
|
@ -128,45 +131,47 @@ CONFIGURATION KEYS
|
|||
Configuration keys in bundler have two forms: the canonical form and
|
||||
the environment variable form.
|
||||
|
||||
For instance, passing the --without flag to bundle install(1) bun-
|
||||
dle-install.1.html prevents Bundler from installing certain groups
|
||||
specified in the Gemfile(5). Bundler persists this value in app/.bun-
|
||||
dle/config so that calls to Bundler.setup do not try to find gems from
|
||||
the Gemfile that you didn't install. Additionally, subsequent calls to
|
||||
bundle install(1) bundle-install.1.html remember this setting and skip
|
||||
those groups.
|
||||
For instance, passing the --without flag to bundle install(1)
|
||||
bundle-install.1.html prevents Bundler from installing certain groups
|
||||
specified in the Gemfile(5). Bundler persists this value in
|
||||
app/.bundle/config so that calls to Bundler.setup do not try to find
|
||||
gems from the Gemfile that you didn't install. Additionally, subsequent
|
||||
calls to bundle install(1) bundle-install.1.html remember this setting
|
||||
and skip those groups.
|
||||
|
||||
The canonical form of this configuration is "without". To convert the
|
||||
canonical form to the environment variable form, capitalize it, and
|
||||
prepend BUNDLE_. The environment variable form of "without" is BUN-
|
||||
DLE_WITHOUT.
|
||||
prepend BUNDLE_. The environment variable form of "without" is
|
||||
BUNDLE_WITHOUT.
|
||||
|
||||
Any periods in the configuration keys must be replaced with two under-
|
||||
scores when setting it via environment variables. The configuration key
|
||||
local.rack becomes the environment variable BUNDLE_LOCAL__RACK.
|
||||
Any periods in the configuration keys must be replaced with two
|
||||
underscores when setting it via environment variables. The
|
||||
configuration key local.rack becomes the environment variable
|
||||
BUNDLE_LOCAL__RACK.
|
||||
|
||||
LIST OF AVAILABLE KEYS
|
||||
The following is a list of all configuration keys and their purpose.
|
||||
You can learn more about their operation in bundle install(1) bun-
|
||||
dle-install.1.html.
|
||||
You can learn more about their operation in bundle install(1)
|
||||
bundle-install.1.html.
|
||||
|
||||
o allow_bundler_dependency_conflicts (BUNDLE_ALLOW_BUNDLER_DEPEN-
|
||||
DENCY_CONFLICTS): Allow resolving to specifications that have
|
||||
dependencies on bundler that are incompatible with the running
|
||||
Bundler version.
|
||||
o allow_bundler_dependency_conflicts
|
||||
(BUNDLE_ALLOW_BUNDLER_DEPENDENCY_CONFLICTS): Allow resolving to
|
||||
specifications that have dependencies on bundler that are
|
||||
incompatible with the running Bundler version.
|
||||
|
||||
o allow_deployment_source_credential_changes (BUNDLE_ALLOW_DEPLOY-
|
||||
MENT_SOURCE_CREDENTIAL_CHANGES): When in deployment mode, allow
|
||||
changing the credentials to a gem's source. Ex:
|
||||
https://some.host.com/gems/path/ -> https://user_name:pass-
|
||||
word@some.host.com/gems/path
|
||||
o allow_deployment_source_credential_changes
|
||||
(BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES): When in
|
||||
deployment mode, allow changing the credentials to a gem's source.
|
||||
Ex: https://some.host.com/gems/path/ ->
|
||||
https://user_name:password@some.host.com/gems/path
|
||||
|
||||
o allow_offline_install (BUNDLE_ALLOW_OFFLINE_INSTALL): Allow Bundler
|
||||
to use cached data when installing without network access.
|
||||
|
||||
o auto_clean_without_path (BUNDLE_AUTO_CLEAN_WITHOUT_PATH): Automati-
|
||||
cally run bundle clean after installing when an explicit path has
|
||||
not been set and Bundler is not installing into the system gems.
|
||||
o auto_clean_without_path (BUNDLE_AUTO_CLEAN_WITHOUT_PATH):
|
||||
Automatically run bundle clean after installing when an explicit
|
||||
path has not been set and Bundler is not installing into the system
|
||||
gems.
|
||||
|
||||
o auto_install (BUNDLE_AUTO_INSTALL): Automatically run bundle
|
||||
install when gems are missing.
|
||||
|
@ -184,8 +189,8 @@ LIST OF AVAILABLE KEYS
|
|||
place cached gems in when running bundle package, and that bundler
|
||||
will look in when installing gems. Defaults to vendor/cache.
|
||||
|
||||
o clean (BUNDLE_CLEAN): Whether Bundler should run bundle clean auto-
|
||||
matically after bundle install.
|
||||
o clean (BUNDLE_CLEAN): Whether Bundler should run bundle clean
|
||||
automatically after bundle install.
|
||||
|
||||
o console (BUNDLE_CONSOLE): The console that bundle console starts.
|
||||
Defaults to irb.
|
||||
|
@ -199,24 +204,20 @@ LIST OF AVAILABLE KEYS
|
|||
running Bundler commands will be blocked.
|
||||
|
||||
o disable_checksum_validation (BUNDLE_DISABLE_CHECKSUM_VALIDATION):
|
||||
Allow installing gems even if they do not match the checksum pro-
|
||||
vided by RubyGems.
|
||||
Allow installing gems even if they do not match the checksum
|
||||
provided by RubyGems.
|
||||
|
||||
o disable_exec_load (BUNDLE_DISABLE_EXEC_LOAD): Stop Bundler from
|
||||
using load to launch an executable in-process in bundle exec.
|
||||
|
||||
o disable_local_branch_check (BUNDLE_DISABLE_LOCAL_BRANCH_CHECK):
|
||||
Allow Bundler to use a local git override without a branch speci-
|
||||
fied in the Gemfile.
|
||||
Allow Bundler to use a local git override without a branch
|
||||
specified in the Gemfile.
|
||||
|
||||
o disable_multisource (BUNDLE_DISABLE_MULTISOURCE): When set, Gem-
|
||||
files containing multiple sources will produce errors instead of
|
||||
o disable_multisource (BUNDLE_DISABLE_MULTISOURCE): When set,
|
||||
Gemfiles containing multiple sources will produce errors instead of
|
||||
warnings. Use bundle config unset disable_multisource to unset.
|
||||
|
||||
o disable_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
|
||||
accessing gems installed to RubyGems' normal location.
|
||||
|
||||
|
@ -224,24 +225,24 @@ LIST OF AVAILABLE KEYS
|
|||
from checking if a newer Bundler version is available on
|
||||
rubygems.org.
|
||||
|
||||
o force_ruby_platform (BUNDLE_FORCE_RUBY_PLATFORM): Ignore the cur-
|
||||
rent machine's platform and install only ruby platform gems. As a
|
||||
result, gems with native extensions will be compiled from source.
|
||||
o force_ruby_platform (BUNDLE_FORCE_RUBY_PLATFORM): Ignore the
|
||||
current machine's platform and install only ruby platform gems. As
|
||||
a result, gems with native extensions will be compiled from source.
|
||||
|
||||
o frozen (BUNDLE_FROZEN): Disallow changes to the Gemfile. When the
|
||||
Gemfile is changed and the lockfile has not been updated, running
|
||||
Bundler commands will be blocked. Defaults to true when --deploy-
|
||||
ment is used.
|
||||
Bundler commands will be blocked. Defaults to true when
|
||||
--deployment is used.
|
||||
|
||||
o gem.push_key (BUNDLE_GEM__PUSH_KEY): Sets the --key parameter for
|
||||
gem push when using the rake release command with a private gem-
|
||||
stash server.
|
||||
gem push when using the rake release command with a private
|
||||
gemstash server.
|
||||
|
||||
o gemfile (BUNDLE_GEMFILE): The name of the file that bundler should
|
||||
use as the Gemfile. This location of this file also sets the root
|
||||
of the project, which is used to resolve relative paths in the Gem-
|
||||
file, among other things. By default, bundler will search up from
|
||||
the current working directory until it finds a Gemfile.
|
||||
of the project, which is used to resolve relative paths in the
|
||||
Gemfile, among other things. By default, bundler will search up
|
||||
from the current working directory until it finds a Gemfile.
|
||||
|
||||
o global_gem_cache (BUNDLE_GLOBAL_GEM_CACHE): Whether Bundler should
|
||||
cache all gems globally, rather than locally to the installing Ruby
|
||||
|
@ -254,8 +255,8 @@ LIST OF AVAILABLE KEYS
|
|||
o init_gems_rb (BUNDLE_INIT_GEMS_RB) Generate a gems.rb instead of a
|
||||
Gemfile when running bundle init.
|
||||
|
||||
o jobs (BUNDLE_JOBS): The number of gems Bundler can install in par-
|
||||
allel. Defaults to 1.
|
||||
o jobs (BUNDLE_JOBS): The number of gems Bundler can install in
|
||||
parallel. Defaults to 1.
|
||||
|
||||
o no_install (BUNDLE_NO_INSTALL): Whether bundle package should skip
|
||||
installing gems.
|
||||
|
@ -263,9 +264,9 @@ LIST OF AVAILABLE KEYS
|
|||
o no_prune (BUNDLE_NO_PRUNE): Whether Bundler should leave outdated
|
||||
gems unpruned when caching.
|
||||
|
||||
o only_update_to_newer_versions (BUNDLE_ONLY_UPDATE_TO_NEWER_VER-
|
||||
SIONS): During bundle update, only resolve to newer versions of the
|
||||
gems in the lockfile.
|
||||
o only_update_to_newer_versions
|
||||
(BUNDLE_ONLY_UPDATE_TO_NEWER_VERSIONS): During bundle update, only
|
||||
resolve to newer versions of the gems in the lockfile.
|
||||
|
||||
o path (BUNDLE_PATH): The location on disk where all gems in your
|
||||
bundle will be located regardless of $GEM_HOME or $GEM_PATH values.
|
||||
|
@ -279,8 +280,8 @@ LIST OF AVAILABLE KEYS
|
|||
o path_relative_to_cwd (BUNDLE_PATH_RELATIVE_TO_CWD) Makes --path
|
||||
relative to the CWD instead of the Gemfile.
|
||||
|
||||
o plugins (BUNDLE_PLUGINS): Enable Bundler's experimental plugin sys-
|
||||
tem.
|
||||
o plugins (BUNDLE_PLUGINS): Enable Bundler's experimental plugin
|
||||
system.
|
||||
|
||||
o prefer_patch (BUNDLE_PREFER_PATCH): Prefer updating only to next
|
||||
patch version during updates. Makes bundle update calls equivalent
|
||||
|
@ -295,9 +296,10 @@ LIST OF AVAILABLE KEYS
|
|||
o retry (BUNDLE_RETRY): The number of times to retry failed network
|
||||
requests. Defaults to 3.
|
||||
|
||||
o setup_makes_kernel_gem_public (BUNDLE_SETUP_MAKES_KERNEL_GEM_PUB-
|
||||
LIC): Have Bundler.setup make the Kernel#gem method public, even
|
||||
though RubyGems declares it as private.
|
||||
o setup_makes_kernel_gem_public
|
||||
(BUNDLE_SETUP_MAKES_KERNEL_GEM_PUBLIC): Have Bundler.setup make the
|
||||
Kernel#gem method public, even though RubyGems declares it as
|
||||
private.
|
||||
|
||||
o shebang (BUNDLE_SHEBANG): The program name that should be invoked
|
||||
for generated binstubs. Defaults to the ruby install name used to
|
||||
|
@ -311,21 +313,21 @@ LIST OF AVAILABLE KEYS
|
|||
warning Bundler prints when installing gems as root.
|
||||
|
||||
o skip_default_git_sources (BUNDLE_SKIP_DEFAULT_GIT_SOURCES): Whether
|
||||
Bundler should skip adding default git source shortcuts to the Gem-
|
||||
file DSL.
|
||||
Bundler should skip adding default git source shortcuts to the
|
||||
Gemfile DSL.
|
||||
|
||||
o specific_platform (BUNDLE_SPECIFIC_PLATFORM): Allow bundler to
|
||||
resolve for the specific running platform and store it in the lock-
|
||||
file, instead of only using a generic platform. A specific platform
|
||||
is the exact platform triple reported by Gem::Platform.local, such
|
||||
as x86_64-darwin-16 or universal-java-1.8. On the other hand,
|
||||
generic platforms are those such as ruby, mswin, or java. In this
|
||||
example, x86_64-darwin-16 would map to ruby and universal-java-1.8
|
||||
to java.
|
||||
resolve for the specific running platform and store it in the
|
||||
lockfile, instead of only using a generic platform. A specific
|
||||
platform is the exact platform triple reported by
|
||||
Gem::Platform.local, such as x86_64-darwin-16 or
|
||||
universal-java-1.8. On the other hand, generic platforms are those
|
||||
such as ruby, mswin, or java. In this example, x86_64-darwin-16
|
||||
would map to ruby and universal-java-1.8 to java.
|
||||
|
||||
o ssl_ca_cert (BUNDLE_SSL_CA_CERT): Path to a designated CA certifi-
|
||||
cate file or folder containing multiple certificates for trusted
|
||||
CAs in PEM format.
|
||||
o ssl_ca_cert (BUNDLE_SSL_CA_CERT): Path to a designated CA
|
||||
certificate file or folder containing multiple certificates for
|
||||
trusted CAs in PEM format.
|
||||
|
||||
o ssl_client_cert (BUNDLE_SSL_CLIENT_CERT): Path to a designated file
|
||||
containing a X.509 client certificate and key in PEM format.
|
||||
|
@ -333,9 +335,10 @@ LIST OF AVAILABLE KEYS
|
|||
o ssl_verify_mode (BUNDLE_SSL_VERIFY_MODE): The SSL verification mode
|
||||
Bundler uses when making HTTPS requests. Defaults to verify peer.
|
||||
|
||||
o suppress_install_using_messages (BUNDLE_SUPPRESS_INSTALL_USING_MES-
|
||||
SAGES): Avoid printing Using ... messages during installation when
|
||||
the version of a gem has not changed.
|
||||
o suppress_install_using_messages
|
||||
(BUNDLE_SUPPRESS_INSTALL_USING_MESSAGES): Avoid printing Using ...
|
||||
messages during installation when the version of a gem has not
|
||||
changed.
|
||||
|
||||
o system_bindir (BUNDLE_SYSTEM_BINDIR): The location where RubyGems
|
||||
installs binstubs. Defaults to Gem.bindir.
|
||||
|
@ -363,12 +366,12 @@ LIST OF AVAILABLE KEYS
|
|||
|
||||
|
||||
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-
|
||||
dle package(1) bundle-package.1.html command.
|
||||
applicable flag to the bundle install(1) bundle-install.1.html or
|
||||
bundle package(1) bundle-package.1.html command.
|
||||
|
||||
You can set them globally either via environment variables or bundle
|
||||
config, whichever is preferable for your setup. If you use both, envi-
|
||||
ronment variables will take preference over global settings.
|
||||
config, whichever is preferable for your setup. If you use both,
|
||||
environment variables will take preference over global settings.
|
||||
|
||||
LOCAL GIT REPOS
|
||||
Bundler also allows you to work against a git repository locally
|
||||
|
@ -390,15 +393,15 @@ LOCAL GIT REPOS
|
|||
|
||||
|
||||
|
||||
Now instead of checking out the remote git repository, the local over-
|
||||
ride will be used. Similar to a path source, every time the local git
|
||||
repository change, changes will be automatically picked up by Bundler.
|
||||
This means a commit in the local git repo will update the revision in
|
||||
the Gemfile.lock to the local git repo revision. This requires the same
|
||||
attention as git submodules. Before pushing to the remote, you need to
|
||||
ensure the local override was pushed, otherwise you may point to a com-
|
||||
mit that only exists in your local machine. You'll also need to CGI
|
||||
escape your usernames and passwords as well.
|
||||
Now instead of checking out the remote git repository, the local
|
||||
override will be used. Similar to a path source, every time the local
|
||||
git repository change, changes will be automatically picked up by
|
||||
Bundler. This means a commit in the local git repo will update the
|
||||
revision in the Gemfile.lock to the local git repo revision. This
|
||||
requires the same attention as git submodules. Before pushing to the
|
||||
remote, you need to ensure the local override was pushed, otherwise you
|
||||
may point to a commit that only exists in your local machine. You'll
|
||||
also need to CGI escape your usernames and passwords as well.
|
||||
|
||||
Bundler does many checks to ensure a developer won't work with invalid
|
||||
references. Particularly, we force a developer to specify a branch in
|
||||
|
@ -408,8 +411,8 @@ LOCAL GIT REPOS
|
|||
working against the correct branches, and prevents accidental locking
|
||||
to a different branch.
|
||||
|
||||
Finally, Bundler also ensures that the current revision in the Gem-
|
||||
file.lock exists in the local git repository. By doing this, Bundler
|
||||
Finally, Bundler also ensures that the current revision in the
|
||||
Gemfile.lock exists in the local git repository. By doing this, Bundler
|
||||
forces you to fetch the latest changes in the remotes.
|
||||
|
||||
MIRRORS OF GEM SOURCES
|
||||
|
@ -423,8 +426,8 @@ MIRRORS OF GEM SOURCES
|
|||
|
||||
|
||||
|
||||
For example, to use a mirror of rubygems.org hosted at rubygems-mir-
|
||||
ror.org:
|
||||
For example, to use a mirror of rubygems.org hosted at
|
||||
rubygems-mirror.org:
|
||||
|
||||
|
||||
|
||||
|
@ -450,8 +453,8 @@ MIRRORS OF GEM SOURCES
|
|||
|
||||
|
||||
|
||||
The default fallback timeout is 0.1 seconds, but the setting can cur-
|
||||
rently only accept whole seconds (for example, 1, 15, or 30).
|
||||
The default fallback timeout is 0.1 seconds, but the setting can
|
||||
currently only accept whole seconds (for example, 1, 15, or 30).
|
||||
|
||||
CREDENTIALS FOR GEM SOURCES
|
||||
Bundler allows you to configure credentials for any gem source, which
|
||||
|
@ -510,8 +513,8 @@ CONFIGURE BUNDLER DIRECTORIES
|
|||
Bundler's home, config, cache and plugin directories are able to be
|
||||
configured through environment variables. The default location for
|
||||
Bundler's home directory is ~/.bundle, which all directories inherit
|
||||
from by default. The following outlines the available environment vari-
|
||||
ables and their default values
|
||||
from by default. The following outlines the available environment
|
||||
variables and their default values
|
||||
|
||||
|
||||
|
||||
|
@ -525,4 +528,4 @@ CONFIGURE BUNDLER DIRECTORIES
|
|||
|
||||
|
||||
|
||||
January 2020 BUNDLE-CONFIG(1)
|
||||
May 2020 BUNDLE-CONFIG(1)
|
||||
|
|
|
@ -11,7 +11,7 @@ This command allows you to interact with Bundler's configuration system.
|
|||
|
||||
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`)
|
||||
3. Global config (`~/.bundle/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 --local <name> <value>` will set that configuration to
|
||||
the local application. The configuration will be stored in `app/.bundle/config`.
|
||||
Executing `bundle config set --local <name> <value>` will set that configuration
|
||||
in the directory for the local application. The configuration will be stored in
|
||||
`<project_root>/.bundle/config`. If `BUNDLE_APP_CONFIG` is set, the configuration
|
||||
will be stored in `$BUNDLE_APP_CONFIG/config`.
|
||||
|
||||
Executing `bundle config unset <name>` will delete the configuration in both
|
||||
local and global sources.
|
||||
|
@ -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
|
||||
instead of warnings.
|
||||
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`):
|
||||
Stop Bundler from accessing gems installed to RubyGems' normal location.
|
||||
* `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_CONFIG : $BUNDLE_USER_HOME/config
|
||||
BUNDLE_USER_PLUGIN : $BUNDLE_USER_HOME/plugin
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-doctor\fR \- Checks the bundle for common problems
|
||||
|
|
|
@ -41,4 +41,4 @@ OPTIONS
|
|||
|
||||
|
||||
|
||||
January 2020 BUNDLE-DOCTOR(1)
|
||||
May 2020 BUNDLE-DOCTOR(1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-exec\fR \- Execute a command in the context of the bundle
|
||||
|
|
|
@ -13,9 +13,10 @@ DESCRIPTION
|
|||
[Gemfile(5)][Gemfile(5)] available to require in Ruby programs.
|
||||
|
||||
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-
|
||||
file(5)][Gemfile(5)] and installed via bundle install(1) bun-
|
||||
dle-install.1.html, you should run bundle exec rspec spec/my_spec.rb.
|
||||
spec/my_spec.rb, and you want to use the gems specified in the
|
||||
[Gemfile(5)][Gemfile(5)] and installed via bundle install(1)
|
||||
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
|
||||
on your shell's $PATH.
|
||||
|
@ -27,13 +28,13 @@ OPTIONS
|
|||
of passing all file descriptors to the new process.
|
||||
|
||||
BUNDLE INSTALL --BINSTUBS
|
||||
If you use the --binstubs flag in bundle install(1) bun-
|
||||
dle-install.1.html, Bundler will automatically create a directory
|
||||
If you use the --binstubs flag in bundle install(1)
|
||||
bundle-install.1.html, Bundler will automatically create a directory
|
||||
(which defaults to app_root/bin) containing all of the executables
|
||||
available from gems in the bundle.
|
||||
|
||||
After using --binstubs, bin/rspec spec/my_spec.rb is identical to bun-
|
||||
dle exec rspec spec/my_spec.rb.
|
||||
After using --binstubs, bin/rspec spec/my_spec.rb is identical to
|
||||
bundle exec rspec spec/my_spec.rb.
|
||||
|
||||
ENVIRONMENT MODIFICATIONS
|
||||
bundle exec makes a number of changes to the shell environment, then
|
||||
|
@ -48,8 +49,8 @@ ENVIRONMENT MODIFICATIONS
|
|||
o make sure that if bundler is invoked in the subshell, it uses the
|
||||
same Gemfile (by setting BUNDLE_GEMFILE)
|
||||
|
||||
o add -rbundler/setup to $RUBYOPT, which makes sure that Ruby pro-
|
||||
grams invoked in the subshell can see the gems in the bundle
|
||||
o add -rbundler/setup to $RUBYOPT, which makes sure that Ruby
|
||||
programs invoked in the subshell can see the gems in the bundle
|
||||
|
||||
|
||||
|
||||
|
@ -57,8 +58,9 @@ ENVIRONMENT MODIFICATIONS
|
|||
|
||||
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-
|
||||
ments is in the bundle, and to raise a Gem::LoadError if it's not
|
||||
o modify the gem method to be a no-op if a gem matching the
|
||||
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
|
||||
frozen when using bundler, and to prevent gems from the system
|
||||
|
@ -71,20 +73,21 @@ ENVIRONMENT MODIFICATIONS
|
|||
|
||||
|
||||
|
||||
Finally, bundle exec also implicitly modifies Gemfile.lock if the lock-
|
||||
file and the Gemfile do not match. Bundler needs the Gemfile to deter-
|
||||
mine things such as a gem's groups, autorequire, and platforms, etc.,
|
||||
and that information isn't stored in the lockfile. The Gemfile and
|
||||
lockfile must be synced in order to bundle exec successfully, so bundle
|
||||
exec updates the lockfile beforehand.
|
||||
Finally, bundle exec also implicitly modifies Gemfile.lock if the
|
||||
lockfile and the Gemfile do not match. Bundler needs the Gemfile to
|
||||
determine things such as a gem's groups, autorequire, and platforms,
|
||||
etc., and that information isn't stored in the lockfile. The Gemfile
|
||||
and lockfile must be synced in order to bundle exec successfully, so
|
||||
bundle exec updates the lockfile beforehand.
|
||||
|
||||
Loading
|
||||
By default, when attempting to bundle exec to a file with a ruby she-
|
||||
bang, Bundler will Kernel.load that file instead of using Kernel.exec.
|
||||
For the vast majority of cases, this is a performance improvement. In a
|
||||
rare few cases, this could cause some subtle side-effects (such as
|
||||
dependence on the exact contents of $0 or __FILE__) and the optimiza-
|
||||
tion can be disabled by enabling the disable_exec_load setting.
|
||||
By default, when attempting to bundle exec to a file with a ruby
|
||||
shebang, Bundler will Kernel.load that file instead of using
|
||||
Kernel.exec. For the vast majority of cases, this is a performance
|
||||
improvement. In a rare few cases, this could cause some subtle
|
||||
side-effects (such as dependence on the exact contents of $0 or
|
||||
__FILE__) and the optimization can be disabled by enabling the
|
||||
disable_exec_load setting.
|
||||
|
||||
Shelling out
|
||||
Any Ruby code that opens a subshell (like system, backticks, or %x{})
|
||||
|
@ -138,14 +141,14 @@ RUBYGEMS PLUGINS
|
|||
end up activating themselves or their dependencies.
|
||||
|
||||
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-
|
||||
sion without this problem), Rubygems would activate gemcutter 0.5 and
|
||||
json_pure <latest>.
|
||||
that version of gemcutter installed (even if you also had a newer
|
||||
version without this problem), Rubygems would activate gemcutter 0.5
|
||||
and json_pure <latest>.
|
||||
|
||||
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
|
||||
the version in your Gemfile(5), or the snapshot version in your Gem-
|
||||
file.lock.
|
||||
the version in your Gemfile(5), or the snapshot version in your
|
||||
Gemfile.lock.
|
||||
|
||||
If this happens, bundler will say:
|
||||
|
||||
|
@ -175,4 +178,4 @@ RUBYGEMS PLUGINS
|
|||
|
||||
|
||||
|
||||
January 2020 BUNDLE-EXEC(1)
|
||||
May 2020 BUNDLE-EXEC(1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\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)\.
|
||||
.
|
||||
.TP
|
||||
\fB\-t\fR, \fB\-\-test=minitest\fR, \fB\-\-test=rspec\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\.
|
||||
\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, \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
|
||||
\fB\-e\fR, \fB\-\-edit[=EDITOR]\fR
|
||||
|
|
|
@ -55,9 +55,9 @@ OPTIONS
|
|||
Do not add C extension code (overrides --ext specified in the
|
||||
global config).
|
||||
|
||||
--mit Add an MIT license to a LICENSE.txt file in the root of the gen-
|
||||
erated project. Your name from the global git config is used for
|
||||
the copyright statement. If this option is unspecified, an
|
||||
--mit Add an MIT license to a LICENSE.txt file in the root of the
|
||||
generated project. Your name from the global git config is used
|
||||
for the copyright statement. If this option is unspecified, an
|
||||
interactive prompt will be displayed and the answer will be
|
||||
saved in Bundler's global config for future bundle gem use.
|
||||
|
||||
|
@ -65,20 +65,20 @@ OPTIONS
|
|||
Do not create a LICENSE.txt (overrides --mit specified in the
|
||||
global config).
|
||||
|
||||
-t, --test=minitest, --test=rspec
|
||||
Specify the test framework that Bundler should use when generat-
|
||||
ing the project. Acceptable values are minitest and rspec. The
|
||||
GEM_NAME.gemspec 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 bun-
|
||||
dle gem use. If no option is specified, the default testing
|
||||
framework is RSpec.
|
||||
-t, --test=minitest, --test=rspec, --test=test-unit
|
||||
Specify the test framework that Bundler should use when
|
||||
generating the project. Acceptable values are minitest, rspec
|
||||
and test-unit. The GEM_NAME.gemspec 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 bundle gem use. If no option is
|
||||
specified, the default testing framework is RSpec.
|
||||
|
||||
-e, --edit[=EDITOR]
|
||||
Open the resulting GEM_NAME.gemspec in EDITOR, or the default
|
||||
editor if not specified. The default is $BUNDLER_EDITOR, $VIS-
|
||||
UAL, or $EDITOR.
|
||||
editor if not specified. The default is $BUNDLER_EDITOR,
|
||||
$VISUAL, or $EDITOR.
|
||||
|
||||
SEE ALSO
|
||||
o bundle config(1) bundle-config.1.html
|
||||
|
@ -88,4 +88,4 @@ SEE ALSO
|
|||
|
||||
|
||||
|
||||
January 2020 BUNDLE-GEM(1)
|
||||
May 2020 BUNDLE-GEM(1)
|
||||
|
|
|
@ -60,13 +60,13 @@ configuration file using the following names:
|
|||
Do not create a `LICENSE.txt` (overrides `--mit` specified in the global
|
||||
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
|
||||
project. Acceptable values are `minitest` and `rspec`. The `GEM_NAME.gemspec`
|
||||
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
|
||||
`bundle gem` use.
|
||||
project. Acceptable values are `minitest`, `rspec` and `test-unit`. The
|
||||
`GEM_NAME.gemspec` 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 `bundle gem` use.
|
||||
If no option is specified, the default testing framework is RSpec.
|
||||
|
||||
* `-e`, `--edit[=EDITOR]`:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-info\fR \- Show information for the given gem in your bundle
|
||||
|
|
|
@ -18,4 +18,4 @@ OPTIONS
|
|||
|
||||
|
||||
|
||||
January 2020 BUNDLE-INFO(1)
|
||||
May 2020 BUNDLE-INFO(1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-init\fR \- Generates a Gemfile into the current working directory
|
||||
|
|
|
@ -9,16 +9,16 @@ SYNOPSIS
|
|||
bundle init [--gemspec=FILE]
|
||||
|
||||
DESCRIPTION
|
||||
Init generates a default [Gemfile(5)][Gemfile(5)] in the current work-
|
||||
ing directory. When adding a [Gemfile(5)][Gemfile(5)] to a gem with a
|
||||
gemspec, the --gemspec option will automatically add each dependency
|
||||
listed in the gemspec file to the newly created [Gemfile(5)][Gem-
|
||||
file(5)].
|
||||
Init generates a default [Gemfile(5)][Gemfile(5)] in the current
|
||||
working directory. When adding a [Gemfile(5)][Gemfile(5)] to a gem with
|
||||
a gemspec, the --gemspec option will automatically add each dependency
|
||||
listed in the gemspec file to the newly created
|
||||
[Gemfile(5)][Gemfile(5)].
|
||||
|
||||
OPTIONS
|
||||
--gemspec
|
||||
Use the specified .gemspec to create the [Gemfile(5)][Gem-
|
||||
file(5)]
|
||||
Use the specified .gemspec to create the
|
||||
[Gemfile(5)][Gemfile(5)]
|
||||
|
||||
FILES
|
||||
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)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
|
||||
|
|
|
@ -29,4 +29,4 @@ DESCRIPTION
|
|||
|
||||
|
||||
|
||||
January 2020 BUNDLE-INJECT(1)
|
||||
May 2020 BUNDLE-INJECT(1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
|
||||
|
|
|
@ -9,9 +9,9 @@ SYNOPSIS
|
|||
bundle install [--binstubs[=DIRECTORY]] [--clean] [--deployment]
|
||||
[--frozen] [--full-index] [--gemfile=GEMFILE] [--jobs=NUMBER] [--local]
|
||||
[--no-cache] [--no-prune] [--path PATH] [--quiet] [--redownload]
|
||||
[--retry=NUMBER] [--shebang] [--standalone[=GROUP[ GROUP...]]] [--sys-
|
||||
tem] [--trust-policy=POLICY] [--with=GROUP[ GROUP...]] [--with-
|
||||
out=GROUP[ GROUP...]]
|
||||
[--retry=NUMBER] [--shebang] [--standalone[=GROUP[ GROUP...]]]
|
||||
[--system] [--trust-policy=POLICY] [--with=GROUP[ GROUP...]]
|
||||
[--without=GROUP[ GROUP...]]
|
||||
|
||||
DESCRIPTION
|
||||
Install the gems specified in your Gemfile(5). If this is the first
|
||||
|
@ -20,8 +20,8 @@ DESCRIPTION
|
|||
all needed gems.
|
||||
|
||||
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-
|
||||
fied in the Gemfile.lock instead of resolving dependencies.
|
||||
Bundler will fetch all remote sources, but use the dependencies
|
||||
specified in the Gemfile.lock instead of resolving dependencies.
|
||||
|
||||
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
|
||||
|
@ -34,19 +34,19 @@ OPTIONS
|
|||
time bundle install is run, use bundle config (see bundle-config(1)).
|
||||
|
||||
--binstubs[=<directory>]
|
||||
Binstubs are scripts that wrap around executables. Bundler cre-
|
||||
ates a small Ruby file (a binstub) that loads Bundler, runs the
|
||||
command, and puts it in bin/. This lets you link the binstub
|
||||
inside of an application to the exact gem version the applica-
|
||||
tion needs.
|
||||
Binstubs are scripts that wrap around executables. Bundler
|
||||
creates a small Ruby file (a binstub) that loads Bundler, runs
|
||||
the command, and puts it in bin/. This lets you link the binstub
|
||||
inside of an application to the exact gem version the
|
||||
application needs.
|
||||
|
||||
Creates a directory (defaults to ~/bin) and places any executa-
|
||||
bles from the gem there. These executables run in Bundler's con-
|
||||
text. If used, you might add this directory to your environ-
|
||||
ment's PATH variable. For instance, if the rails gem comes with
|
||||
a rails executable, this flag will create a bin/rails executable
|
||||
that ensures that all referred dependencies will be resolved
|
||||
using the bundled gems.
|
||||
Creates a directory (defaults to ~/bin) and places any
|
||||
executables from the gem there. These executables run in
|
||||
Bundler's context. If used, you might add this directory to your
|
||||
environment's PATH variable. For instance, if the rails gem
|
||||
comes with a rails executable, this flag will create a bin/rails
|
||||
executable that ensures that all referred dependencies will be
|
||||
resolved using the bundled gems.
|
||||
|
||||
--clean
|
||||
On finishing the installation Bundler is going to remove any
|
||||
|
@ -54,8 +54,8 @@ OPTIONS
|
|||
currently in use will not be removed.
|
||||
|
||||
--deployment
|
||||
In deployment mode, Bundler will 'roll-out' the bundle for pro-
|
||||
duction or CI use. Please check carefully if you want to have
|
||||
In deployment mode, Bundler will 'roll-out' the bundle for
|
||||
production or CI use. Please check carefully if you want to have
|
||||
this option enabled in your development environment.
|
||||
|
||||
--redownload
|
||||
|
@ -64,14 +64,14 @@ OPTIONS
|
|||
|
||||
--frozen
|
||||
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-
|
||||
file.lock.
|
||||
Exits non-zero if there are going to be changes to the
|
||||
Gemfile.lock.
|
||||
|
||||
--full-index
|
||||
Bundler will not call Rubygems' API endpoint (default) but down-
|
||||
load and cache a (currently big) index file of all gems. Perfor-
|
||||
mance can be improved for large bundles that seldom change by
|
||||
enabling this option.
|
||||
Bundler will not call Rubygems' API endpoint (default) but
|
||||
download and cache a (currently big) index file of all gems.
|
||||
Performance can be improved for large bundles that seldom change
|
||||
by enabling this option.
|
||||
|
||||
--gemfile=<gemfile>
|
||||
The location of the Gemfile(5) which Bundler should use. This
|
||||
|
@ -86,8 +86,8 @@ OPTIONS
|
|||
|
||||
--local
|
||||
Do not attempt to connect to rubygems.org. Instead, Bundler will
|
||||
use the gems already present in Rubygems' cache or in ven-
|
||||
dor/cache. Note that if a appropriate platform-specific gem
|
||||
use the gems already present in Rubygems' cache or in
|
||||
vendor/cache. Note that if a appropriate platform-specific gem
|
||||
exists on rubygems.org it will not be found.
|
||||
|
||||
--no-cache
|
||||
|
@ -116,18 +116,18 @@ OPTIONS
|
|||
|
||||
--shebang=<ruby-executable>
|
||||
Uses the specified ruby executable (usually ruby) to execute the
|
||||
scripts created with --binstubs. In addition, if you use --bin-
|
||||
stubs together with --shebang jruby these executables will be
|
||||
changed to execute jruby instead.
|
||||
scripts created with --binstubs. In addition, if you use
|
||||
--binstubs together with --shebang jruby these executables will
|
||||
be changed to execute jruby instead.
|
||||
|
||||
--standalone[=<list>]
|
||||
Makes a bundle that can work without depending on Rubygems or
|
||||
Bundler at runtime. A space separated list of groups to install
|
||||
has to be specified. Bundler creates a directory named bundle
|
||||
and installs the bundle there. It also generates a bun-
|
||||
dle/bundler/setup.rb file to replace Bundler's own setup in the
|
||||
manner required. Using this option implicitly sets path, which
|
||||
is a [remembered option][REMEMBERED OPTIONS].
|
||||
and installs the bundle there. It also generates a
|
||||
bundle/bundler/setup.rb file to replace Bundler's own setup in
|
||||
the manner required. Using this option implicitly sets path,
|
||||
which is a [remembered option][REMEMBERED OPTIONS].
|
||||
|
||||
--system
|
||||
Installs the gems specified in the bundle to the system's
|
||||
|
@ -163,8 +163,8 @@ DEPLOYMENT MODE
|
|||
tested with are also used in deployments, a Gemfile.lock is
|
||||
required.
|
||||
|
||||
This is mainly to ensure that you remember to check your Gem-
|
||||
file.lock into version control.
|
||||
This is mainly to ensure that you remember to check your
|
||||
Gemfile.lock into version control.
|
||||
|
||||
2. The Gemfile.lock must be up to date
|
||||
|
||||
|
@ -174,8 +174,8 @@ DEPLOYMENT MODE
|
|||
In deployment, your Gemfile.lock should be up-to-date with changes
|
||||
made in your Gemfile(5).
|
||||
|
||||
3. Gems are installed to vendor/bundle not your default system loca-
|
||||
tion
|
||||
3. Gems are installed to vendor/bundle not your default system
|
||||
location
|
||||
|
||||
In development, it's convenient to share the gems used in your
|
||||
application with other applications and other scripts that run on
|
||||
|
@ -183,11 +183,11 @@ DEPLOYMENT MODE
|
|||
|
||||
In deployment, isolation is a more important default. In addition,
|
||||
the user deploying the application may not have permission to
|
||||
install gems to the system, or the web server may not have permis-
|
||||
sion to read them.
|
||||
install gems to the system, or the web server may not have
|
||||
permission to read them.
|
||||
|
||||
As a result, bundle install --deployment installs gems to the ven-
|
||||
dor/bundle directory in the application. This may be overridden
|
||||
As a result, bundle install --deployment installs gems to the
|
||||
vendor/bundle directory in the application. This may be overridden
|
||||
using the --path option.
|
||||
|
||||
|
||||
|
@ -232,9 +232,9 @@ INSTALLING GROUPS
|
|||
groups with the --without option. This option takes a space-separated
|
||||
list of groups.
|
||||
|
||||
While the --without option will skip installing the gems in the speci-
|
||||
fied groups, it will still download those gems and use them to resolve
|
||||
the dependencies of every gem in your Gemfile(5).
|
||||
While the --without option will skip installing the gems in the
|
||||
specified groups, it will still download those gems and use them to
|
||||
resolve the dependencies of every gem in your Gemfile(5).
|
||||
|
||||
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
|
||||
|
@ -244,8 +244,8 @@ INSTALLING GROUPS
|
|||
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
|
||||
different environments, but you will never be caught flat-footed by
|
||||
different versions of third-party code being used in different environ-
|
||||
ments.
|
||||
different versions of third-party code being used in different
|
||||
environments.
|
||||
|
||||
For a simple illustration, consider the following Gemfile(5):
|
||||
|
||||
|
@ -287,8 +287,8 @@ THE 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
|
||||
guarantees that you always use the same exact code, even as your appli-
|
||||
cation moves across machines.
|
||||
guarantees that you always use the same exact code, even as your
|
||||
application moves across machines.
|
||||
|
||||
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
|
||||
|
@ -302,15 +302,15 @@ THE GEMFILE.LOCK
|
|||
third-party code being used if any of the gems in the Gemfile(5) or any
|
||||
of their dependencies have been updated.
|
||||
|
||||
When Bundler first shipped, the Gemfile.lock was included in the .git-
|
||||
ignore file included with generated gems. Over time, however, it became
|
||||
clear that this practice forces the pain of broken dependencies onto
|
||||
new contributors, while leaving existing contributors potentially
|
||||
When Bundler first shipped, the Gemfile.lock was included in the
|
||||
.gitignore file included with generated gems. Over time, however, it
|
||||
became clear that this practice forces the pain of broken dependencies
|
||||
onto new contributors, while leaving existing contributors potentially
|
||||
unaware of the problem. Since bundle install is usually the first step
|
||||
towards a contribution, the pain of broken dependencies would discour-
|
||||
age new contributors from contributing. As a result, we have revised
|
||||
our guidance for gem authors to now recommend checking in the lock for
|
||||
gems.
|
||||
towards a contribution, the pain of broken dependencies would
|
||||
discourage new contributors from contributing. As a result, we have
|
||||
revised our guidance for gem authors to now recommend checking in the
|
||||
lock for gems.
|
||||
|
||||
CONSERVATIVE UPDATING
|
||||
When you make a change to the Gemfile(5) and then run bundle install,
|
||||
|
@ -331,10 +331,10 @@ CONSERVATIVE UPDATING
|
|||
|
||||
|
||||
|
||||
In this case, both actionpack and activemerchant depend on activesup-
|
||||
port. The actionpack gem depends on activesupport 2.3.8 and rack ~>
|
||||
1.1.0, while the activemerchant gem depends on activesupport >= 2.3.2,
|
||||
braintree >= 2.0.0, and builder >= 2.0.0.
|
||||
In this case, both actionpack and activemerchant depend on
|
||||
activesupport. The actionpack gem depends on activesupport 2.3.8 and
|
||||
rack ~> 1.1.0, while the activemerchant gem depends on activesupport >=
|
||||
2.3.2, braintree >= 2.0.0, and builder >= 2.0.0.
|
||||
|
||||
When the dependencies are first resolved, Bundler will select
|
||||
activesupport 2.3.8, which satisfies the requirements of both gems in
|
||||
|
@ -352,8 +352,8 @@ CONSERVATIVE UPDATING
|
|||
|
||||
|
||||
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-
|
||||
dency to ~> 1.2.1.
|
||||
updates the activesupport dependency to = 3.0.0.rc and the rack
|
||||
dependency to ~> 1.2.1.
|
||||
|
||||
When you run bundle install, Bundler notices that you changed the
|
||||
actionpack gem, but not the activemerchant gem. It evaluates the gems
|
||||
|
@ -367,16 +367,16 @@ CONSERVATIVE UPDATING
|
|||
not currently being used to satisfy another dependency
|
||||
|
||||
Because you did not explicitly ask to update activemerchant, you would
|
||||
not expect it to suddenly stop working after updating actionpack. How-
|
||||
ever, satisfying the new activesupport 3.0.0.rc dependency of action-
|
||||
pack requires updating one of its dependencies.
|
||||
not expect it to suddenly stop working after updating actionpack.
|
||||
However, satisfying the new activesupport 3.0.0.rc dependency of
|
||||
actionpack requires updating one of its dependencies.
|
||||
|
||||
Even though activemerchant declares a very loose dependency that theo-
|
||||
retically matches activesupport 3.0.0.rc, Bundler treats gems in your
|
||||
Gemfile(5) that have not changed as an atomic unit together with their
|
||||
dependencies. In this case, the activemerchant dependency is treated as
|
||||
activemerchant 1.7.1 + activesupport 2.3.8, so bundle install will
|
||||
report that it cannot update actionpack.
|
||||
Even though activemerchant declares a very loose dependency that
|
||||
theoretically matches activesupport 3.0.0.rc, Bundler treats gems in
|
||||
your Gemfile(5) that have not changed as an atomic unit together with
|
||||
their dependencies. In this case, the activemerchant dependency is
|
||||
treated as activemerchant 1.7.1 + activesupport 2.3.8, so bundle
|
||||
install will report that it cannot update actionpack.
|
||||
|
||||
To explicitly update actionpack, including its dependencies which other
|
||||
gems in the Gemfile(5) still depend on, run bundle update actionpack
|
||||
|
@ -398,4 +398,4 @@ SEE ALSO
|
|||
|
||||
|
||||
|
||||
January 2020 BUNDLE-INSTALL(1)
|
||||
May 2020 BUNDLE-INSTALL(1)
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-list\fR \- List all the gems in the bundle
|
||||
.
|
||||
.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"
|
||||
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
|
||||
.
|
||||
.P
|
||||
bundle list \-\-only\-group dev \-\-paths
|
||||
bundle list \-\-only\-group dev test \-\-paths
|
||||
.
|
||||
.SH "OPTIONS"
|
||||
.
|
||||
|
@ -41,10 +41,10 @@ Print only the name of each gem\.
|
|||
Print the path to each gem in the bundle\.
|
||||
.
|
||||
.TP
|
||||
\fB\-\-without\-group\fR
|
||||
Print all gems expect from a group\.
|
||||
\fB\-\-without\-group=<list>\fR
|
||||
A space\-separated list of groups of gems to skip during printing\.
|
||||
.
|
||||
.TP
|
||||
\fB\-\-only\-group\fR
|
||||
Print gems from a particular group\.
|
||||
\fB\-\-only\-group=<list>\fR
|
||||
A space\-separated list of groups of gems to print\.
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ NAME
|
|||
bundle-list - List all the gems in the bundle
|
||||
|
||||
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
|
||||
Prints a list of all the gems in the bundle including their version.
|
||||
|
@ -22,7 +22,7 @@ DESCRIPTION
|
|||
|
||||
bundle list --only-group dev
|
||||
|
||||
bundle list --only-group dev --paths
|
||||
bundle list --only-group dev test --paths
|
||||
|
||||
OPTIONS
|
||||
--name-only
|
||||
|
@ -31,13 +31,14 @@ OPTIONS
|
|||
--paths
|
||||
Print the path to each gem in the bundle.
|
||||
|
||||
--without-group
|
||||
Print all gems expect from a group.
|
||||
--without-group=<list>
|
||||
A space-separated list of groups of gems to skip during
|
||||
printing.
|
||||
|
||||
--only-group
|
||||
Print gems from a particular group.
|
||||
--only-group=<list>
|
||||
A space-separated list of groups of gems to print.
|
||||
|
||||
|
||||
|
||||
|
||||
January 2020 BUNDLE-LIST(1)
|
||||
May 2020 BUNDLE-LIST(1)
|
||||
|
|
|
@ -3,7 +3,7 @@ bundle-list(1) -- List all the gems in the bundle
|
|||
|
||||
## 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
|
||||
|
||||
|
@ -19,7 +19,7 @@ bundle list --without-group test
|
|||
|
||||
bundle list --only-group dev
|
||||
|
||||
bundle list --only-group dev --paths
|
||||
bundle list --only-group dev test --paths
|
||||
|
||||
## OPTIONS
|
||||
|
||||
|
@ -27,7 +27,7 @@ bundle list --only-group dev --paths
|
|||
Print only the name of each gem.
|
||||
* `--paths`:
|
||||
Print the path to each gem in the bundle.
|
||||
* `--without-group`:
|
||||
Print all gems expect from a group.
|
||||
* `--only-group`:
|
||||
Print gems from a particular group.
|
||||
* `--without-group=<list>`:
|
||||
A space-separated list of groups of gems to skip during printing.
|
||||
* `--only-group=<list>`:
|
||||
A space-separated list of groups of gems to print.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
|
||||
|
|
|
@ -20,8 +20,8 @@ OPTIONS
|
|||
|
||||
--local
|
||||
Do not attempt to connect to rubygems.org. Instead, Bundler will
|
||||
use the gems already present in Rubygems' cache or in ven-
|
||||
dor/cache. Note that if a appropriate platform-specific gem
|
||||
use the gems already present in Rubygems' cache or in
|
||||
vendor/cache. Note that if a appropriate platform-specific gem
|
||||
exists on rubygems.org it will not be found.
|
||||
|
||||
--print
|
||||
|
@ -35,8 +35,8 @@ OPTIONS
|
|||
Fall back to using the single-file index of all gems.
|
||||
|
||||
--add-platform
|
||||
Add a new platform to the lockfile, re-resolving for the addi-
|
||||
tion of that platform.
|
||||
Add a new platform to the lockfile, re-resolving for the
|
||||
addition of that platform.
|
||||
|
||||
--remove-platform
|
||||
Remove a platform from the lockfile.
|
||||
|
@ -73,8 +73,8 @@ UPDATING A LIST OF GEMS
|
|||
--update nokogiri.
|
||||
|
||||
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-
|
||||
file.lock.
|
||||
rest of the gems that you specified locked to the versions in the
|
||||
Gemfile.lock.
|
||||
|
||||
SUPPORTING OTHER PLATFORMS
|
||||
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)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
|
||||
|
|
|
@ -26,4 +26,4 @@ DESCRIPTION
|
|||
|
||||
|
||||
|
||||
January 2020 BUNDLE-OPEN(1)
|
||||
May 2020 BUNDLE-OPEN(1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-outdated\fR \- List installed gems with newer versions available
|
||||
|
|
|
@ -8,8 +8,8 @@ NAME
|
|||
SYNOPSIS
|
||||
bundle outdated [GEM] [--local] [--pre] [--source] [--strict]
|
||||
[--parseable | --porcelain] [--group=GROUP] [--groups]
|
||||
[--update-strict] [--patch|--minor|--major] [--filter-major] [--fil-
|
||||
ter-minor] [--filter-patch] [--only-explicit]
|
||||
[--update-strict] [--patch|--minor|--major] [--filter-major]
|
||||
[--filter-minor] [--filter-patch] [--only-explicit]
|
||||
|
||||
DESCRIPTION
|
||||
Outdated lists the names and versions of gems that have a newer version
|
||||
|
@ -63,8 +63,8 @@ OPTIONS
|
|||
Only list patch newer versions.
|
||||
|
||||
--only-explicit
|
||||
Only list gems specified in your Gemfile, not their dependen-
|
||||
cies.
|
||||
Only list gems specified in your Gemfile, not their
|
||||
dependencies.
|
||||
|
||||
PATCH LEVEL OPTIONS
|
||||
See bundle update(1) bundle-update.1.html for details.
|
||||
|
@ -123,9 +123,9 @@ FILTERING OUTPUT
|
|||
|
||||
|
||||
|
||||
Combining all three filter options would be the same result as provid-
|
||||
ing none of them.
|
||||
Combining all three filter options would be the same result as
|
||||
providing none of them.
|
||||
|
||||
|
||||
|
||||
January 2020 BUNDLE-OUTDATED(1)
|
||||
May 2020 BUNDLE-OUTDATED(1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-platform\fR \- Displays platform compatibility information
|
||||
|
|
|
@ -43,9 +43,9 @@ DESCRIPTION
|
|||
|
||||
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
|
||||
you know if the ruby directive requirement has been met. If ruby direc-
|
||||
tive doesn't match the running Ruby VM, it will tell you what part does
|
||||
not.
|
||||
you know if the ruby directive requirement has been met. If ruby
|
||||
directive doesn't match the running Ruby VM, it will tell you what part
|
||||
does not.
|
||||
|
||||
OPTIONS
|
||||
--ruby It will display the ruby directive information, so you don't
|
||||
|
@ -54,4 +54,4 @@ OPTIONS
|
|||
|
||||
|
||||
|
||||
January 2020 BUNDLE-PLATFORM(1)
|
||||
May 2020 BUNDLE-PLATFORM(1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
|
||||
|
|
|
@ -35,10 +35,10 @@ DESCRIPTION
|
|||
--all cleans all installed gems for that Ruby version.
|
||||
|
||||
If a developer forgets which gems in their project they might have been
|
||||
debugging, the Rubygems gem pristine [GEMNAME] command may be inconve-
|
||||
nient. One can avoid waiting for gem pristine --all, and instead run
|
||||
bundle pristine.
|
||||
debugging, the Rubygems gem pristine [GEMNAME] command may be
|
||||
inconvenient. One can avoid waiting for gem pristine --all, and instead
|
||||
run bundle pristine.
|
||||
|
||||
|
||||
|
||||
January 2020 BUNDLE-PRISTINE(1)
|
||||
May 2020 BUNDLE-PRISTINE(1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-remove\fR \- Removes gems from the Gemfile
|
||||
|
|
|
@ -9,9 +9,9 @@ SYNOPSIS
|
|||
bundle remove [GEM [GEM ...]] [--install]
|
||||
|
||||
DESCRIPTION
|
||||
Removes the given gems from the Gemfile while ensuring that the result-
|
||||
ing Gemfile is still valid. If a gem cannot be removed, a warning is
|
||||
printed. If a gem is already absent from the Gemfile, and error is
|
||||
Removes the given gems from the Gemfile while ensuring that the
|
||||
resulting Gemfile is still valid. If a gem cannot be removed, a warning
|
||||
is printed. If a gem is already absent from the Gemfile, and error is
|
||||
raised.
|
||||
|
||||
OPTIONS
|
||||
|
@ -31,4 +31,4 @@ OPTIONS
|
|||
|
||||
|
||||
|
||||
January 2020 BUNDLE-REMOVE(1)
|
||||
May 2020 BUNDLE-REMOVE(1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
|
||||
|
|
|
@ -9,19 +9,19 @@ SYNOPSIS
|
|||
bundle show [GEM] [--paths]
|
||||
|
||||
DESCRIPTION
|
||||
Without the [GEM] option, show will print a list of the names and ver-
|
||||
sions of all gems that are required by your [Gemfile(5)][Gemfile(5)],
|
||||
sorted by name.
|
||||
Without the [GEM] option, show will print a list of the names and
|
||||
versions of all gems that are required by your
|
||||
[Gemfile(5)][Gemfile(5)], sorted by name.
|
||||
|
||||
Calling show with [GEM] will list the exact location of that gem on
|
||||
your machine.
|
||||
|
||||
OPTIONS
|
||||
--paths
|
||||
List the paths of all gems that are required by your [Gem-
|
||||
file(5)][Gemfile(5)], sorted by gem name.
|
||||
List the paths of all gems that are required by your
|
||||
[Gemfile(5)][Gemfile(5)], sorted by gem name.
|
||||
|
||||
|
||||
|
||||
|
||||
January 2020 BUNDLE-SHOW(1)
|
||||
May 2020 BUNDLE-SHOW(1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\fBbundle\-update\fR \- Update your gems to the latest available versions
|
||||
|
|
|
@ -12,9 +12,9 @@ SYNOPSIS
|
|||
|
||||
DESCRIPTION
|
||||
Update the gems specified (all gems, if --all flag is used), ignoring
|
||||
the previously installed gems specified in the Gemfile.lock. In gen-
|
||||
eral, you should use bundle install(1) bundle-install.1.html to install
|
||||
the same exact gems and versions across machines.
|
||||
the previously installed gems specified in the Gemfile.lock. In
|
||||
general, you should use bundle install(1) bundle-install.1.html to
|
||||
install the same exact gems and versions across machines.
|
||||
|
||||
You would use bundle update to explicitly update the version of a gem.
|
||||
|
||||
|
@ -42,8 +42,8 @@ OPTIONS
|
|||
Ruby.
|
||||
|
||||
--bundler
|
||||
Update the locked version of bundler to the invoked bundler ver-
|
||||
sion.
|
||||
Update the locked version of bundler to the invoked bundler
|
||||
version.
|
||||
|
||||
--full-index
|
||||
Fall back to using the single-file index of all gems.
|
||||
|
@ -146,11 +146,11 @@ UPDATING ALL GEMS
|
|||
use.
|
||||
|
||||
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-
|
||||
file(5).
|
||||
using to the newest versions that still match the gems in your
|
||||
Gemfile(5).
|
||||
|
||||
To do this, run bundle update --all, which will ignore the Gem-
|
||||
file.lock, and resolve all the dependencies again. Keep in mind that
|
||||
To do this, run bundle update --all, which will ignore the
|
||||
Gemfile.lock, and resolve all the dependencies again. Keep in mind that
|
||||
this process can result in a significantly different set of the 25
|
||||
gems, based on the requirements of new gems that the gem authors
|
||||
released since the last time you ran bundle update --all.
|
||||
|
@ -210,17 +210,17 @@ OVERLAPPING DEPENDENCIES
|
|||
are also dependencies of another gem.
|
||||
|
||||
To prevent updating shared dependencies, prior to version 1.14 the only
|
||||
option was the CONSERVATIVE UPDATING behavior in bundle install(1) bun-
|
||||
dle-install.1.html:
|
||||
option was the CONSERVATIVE UPDATING behavior in bundle install(1)
|
||||
bundle-install.1.html:
|
||||
|
||||
In this scenario, updating the thin version manually in the Gemfile(5),
|
||||
and then running bundle install(1) bundle-install.1.html will only
|
||||
update daemons and eventmachine, but not rack. For more information,
|
||||
see the CONSERVATIVE UPDATING section of bundle install(1) bun-
|
||||
dle-install.1.html.
|
||||
see the CONSERVATIVE UPDATING section of bundle install(1)
|
||||
bundle-install.1.html.
|
||||
|
||||
Starting with 1.14, specifying the --conservative option will also pre-
|
||||
vent shared dependencies from being updated.
|
||||
Starting with 1.14, specifying the --conservative option will also
|
||||
prevent shared dependencies from being updated.
|
||||
|
||||
PATCH LEVEL OPTIONS
|
||||
Version 1.14 introduced 4 patch-level options that will influence how
|
||||
|
@ -242,10 +242,10 @@ PATCH LEVEL OPTIONS
|
|||
| --major.
|
||||
|
||||
When Bundler is resolving what versions to use to satisfy declared
|
||||
requirements in the Gemfile or in parent gems, it looks up all avail-
|
||||
able versions, filters out any versions that don't satisfy the require-
|
||||
ment, and then, by default, sorts them from newest to oldest, consider-
|
||||
ing them in that order.
|
||||
requirements in the Gemfile or in parent gems, it looks up all
|
||||
available versions, filters out any versions that don't satisfy the
|
||||
requirement, and then, by default, sorts them from newest to oldest,
|
||||
considering them in that order.
|
||||
|
||||
Providing one of the patch level options (e.g. --patch) changes the
|
||||
sort order of the satisfying versions, causing Bundler to consider the
|
||||
|
@ -274,9 +274,9 @@ PATCH LEVEL OPTIONS
|
|||
1.0.4, 1.0.3, 1.0.2".
|
||||
|
||||
Gem requirements as defined in the Gemfile will still be the first
|
||||
determining factor for what versions are available. If the gem require-
|
||||
ment for foo in the Gemfile is '~> 1.0', that will accomplish the same
|
||||
thing as providing the --minor and --strict options.
|
||||
determining factor for what versions are available. If the gem
|
||||
requirement for foo in the Gemfile is '~> 1.0', that will accomplish
|
||||
the same thing as providing the --minor and --strict options.
|
||||
|
||||
PATCH LEVEL EXAMPLES
|
||||
Given the following gem specifications:
|
||||
|
@ -363,8 +363,8 @@ RECOMMENDED WORKFLOW
|
|||
|
||||
$ bundle install --deployment
|
||||
|
||||
o After changing the Gemfile(5) to reflect a new or update depen-
|
||||
dency, run
|
||||
o After changing the Gemfile(5) to reflect a new or update
|
||||
dependency, run
|
||||
|
||||
$ bundle install
|
||||
|
||||
|
@ -372,8 +372,9 @@ RECOMMENDED WORKFLOW
|
|||
|
||||
$ git add Gemfile.lock
|
||||
|
||||
o If bundle install(1) bundle-install.1.html reports a conflict, man-
|
||||
ually update the specific gems that you changed in the Gemfile(5)
|
||||
o If bundle install(1) bundle-install.1.html reports a conflict,
|
||||
manually update the specific gems that you changed in the
|
||||
Gemfile(5)
|
||||
|
||||
$ bundle update rails thin
|
||||
|
||||
|
@ -387,4 +388,4 @@ RECOMMENDED WORKFLOW
|
|||
|
||||
|
||||
|
||||
January 2020 BUNDLE-UPDATE(1)
|
||||
May 2020 BUNDLE-UPDATE(1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.\" generated with Ronn/v0.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"
|
||||
\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
Loading…
Add table
Add a link
Reference in a new issue