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

Merge Bundler 2.0.1 from upstream.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
hsbt 2019-01-04 13:10:58 +00:00
parent 4bbbbb6a3f
commit e97741e12a
97 changed files with 578 additions and 551 deletions

View file

@ -8,8 +8,6 @@ rescue LoadError
require File.expand_path("../bundler/version", __FILE__) require File.expand_path("../bundler/version", __FILE__)
end end
require "shellwords"
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = "bundler" s.name = "bundler"
s.version = Bundler::VERSION s.version = Bundler::VERSION
@ -49,7 +47,9 @@ Gem::Specification.new do |s|
s.add_development_dependency "ronn", "~> 0.7.3" s.add_development_dependency "ronn", "~> 0.7.3"
s.add_development_dependency "rspec", "~> 3.6" s.add_development_dependency "rspec", "~> 3.6"
# s.files = `git ls-files -z`.split("\x0").select {|f| f.match(%r{^(lib|exe)/}) } # base_dir = File.dirname(__FILE__).gsub(%r{([^A-Za-z0-9_\-.,:\/@\n])}, "\\\\\\1")
# s.files = IO.popen("git -C #{base_dir} ls-files -z", &:read).split("\x0").select {|f| f.match(%r{^(lib|exe)/}) }
# we don't check in man pages, but we need to ship them because # we don't check in man pages, but we need to ship them because
# we use them to generate the long-form help for each command. # we use them to generate the long-form help for each command.
# s.files += Dir.glob("man/**/*") # s.files += Dir.glob("man/**/*")

View file

@ -119,7 +119,7 @@ module Bundler
end end
def environment def environment
SharedHelpers.major_deprecation 2, "Bundler.environment has been removed in favor of Bundler.load" SharedHelpers.major_deprecation 3, "Bundler.environment has been removed in favor of Bundler.load"
load load
end end
@ -283,7 +283,7 @@ EOF
# @deprecated Use `original_env` instead # @deprecated Use `original_env` instead
# @return [Hash] Environment with all bundler-related variables removed # @return [Hash] Environment with all bundler-related variables removed
def clean_env def clean_env
Bundler::SharedHelpers.major_deprecation(2, "`Bundler.clean_env` has weird edge cases, use `.original_env` instead") Bundler::SharedHelpers.major_deprecation(3, "`Bundler.clean_env` has weird edge cases, use `.original_env` instead")
env = original_env env = original_env
if env.key?("BUNDLER_ORIG_MANPATH") if env.key?("BUNDLER_ORIG_MANPATH")

View file

@ -4,8 +4,6 @@ module Bundler
# Represents metadata from when the Bundler gem was built. # Represents metadata from when the Bundler gem was built.
module BuildMetadata module BuildMetadata
# begin ivars # begin ivars
@built_at = "2018-12-19".freeze
@git_commit_sha = "3fc4de72b".freeze
@release = false @release = false
# end ivars # end ivars

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require "bundler/shared_helpers" require "bundler/shared_helpers"
Bundler::SharedHelpers.major_deprecation 2, Bundler::SharedHelpers.major_deprecation 3,
"The Bundler task for Capistrano. Please use http://github.com/capistrano/bundler" "The Bundler task for Capistrano. Please use http://github.com/capistrano/bundler"
# Capistrano task for Bundler. # Capistrano task for Bundler.

View file

@ -229,7 +229,7 @@ module Bundler
"Include gems that are part of the specified named group." "Include gems that are part of the specified named group."
map "i" => "install" map "i" => "install"
def install def install
SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force") SharedHelpers.major_deprecation(3, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
require "bundler/cli/install" require "bundler/cli/install"
Bundler.settings.temporary(:no_install => false) do Bundler.settings.temporary(:no_install => false) do
Install.new(options.dup).run Install.new(options.dup).run
@ -275,7 +275,7 @@ module Bundler
method_option "all", :type => :boolean, :banner => method_option "all", :type => :boolean, :banner =>
"Update everything." "Update everything."
def update(*gems) def update(*gems)
SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force") SharedHelpers.major_deprecation(3, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
require "bundler/cli/update" require "bundler/cli/update"
Update.new(options, gems).run Update.new(options, gems).run
end end
@ -303,7 +303,7 @@ module Bundler
old_argv = ARGV.join(" ") old_argv = ARGV.join(" ")
new_argv = [new_command, *new_arguments.compact].join(" ") new_argv = [new_command, *new_arguments.compact].join(" ")
Bundler::SharedHelpers.major_deprecation(2, "use `bundle #{new_argv}` instead of `bundle #{old_argv}`") Bundler::SharedHelpers.major_deprecation(3, "use `bundle #{new_argv}` instead of `bundle #{old_argv}`")
end end
require "bundler/cli/show" require "bundler/cli/show"
Show.new(options, gem_name).run Show.new(options, gem_name).run
@ -537,7 +537,7 @@ module Bundler
method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version." method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version."
method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group." method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
def viz def viz
SharedHelpers.major_deprecation 2, "The `viz` command has been moved to the `bundle-viz` gem, see https://github.com/bundler/bundler-viz" SharedHelpers.major_deprecation 3, "The `viz` command has been moved to the `bundle-viz` gem, see https://github.com/bundler/bundler-viz"
require "bundler/cli/viz" require "bundler/cli/viz"
Viz.new(options.dup).run Viz.new(options.dup).run
end end
@ -608,7 +608,7 @@ module Bundler
method_option "group", :type => :string, :banner => method_option "group", :type => :string, :banner =>
"Install gem into a bundler group" "Install gem into a bundler group"
def inject(name, version) def inject(name, version)
SharedHelpers.major_deprecation 2, "The `inject` command has been replaced by the `add` command" SharedHelpers.major_deprecation 3, "The `inject` command has been replaced by the `add` command"
require "bundler/cli/inject" require "bundler/cli/inject"
Inject.new(options.dup, name, version).run Inject.new(options.dup, name, version).run
end end

View file

@ -9,7 +9,7 @@ module Bundler
end end
def run def run
Bundler::SharedHelpers.major_deprecation 2, "bundle console will be replaced " \ Bundler::SharedHelpers.major_deprecation 3, "bundle console will be replaced " \
"by `bin/console` generated by `bundle gem <name>`" "by `bin/console` generated by `bundle gem <name>`"
group ? Bundler.require(:default, *(group.split.map!(&:to_sym))) : Bundler.require group ? Bundler.require(:default, *(group.split.map!(&:to_sym))) : Bundler.require

View file

@ -53,7 +53,7 @@ module Bundler
Bundler::Fetcher.disable_endpoint = options["full-index"] Bundler::Fetcher.disable_endpoint = options["full-index"]
if options["binstubs"] if options["binstubs"]
Bundler::SharedHelpers.major_deprecation 2, Bundler::SharedHelpers.major_deprecation 3,
"The --binstubs option will be removed in favor of `bundle binstubs`" "The --binstubs option will be removed in favor of `bundle binstubs`"
end end

View file

@ -22,7 +22,7 @@ module Bundler
if Bundler.feature_flag.update_requires_all_flag? if Bundler.feature_flag.update_requires_all_flag?
raise InvalidOption, "To update everything, pass the `--all` flag." raise InvalidOption, "To update everything, pass the `--all` flag."
end end
SharedHelpers.major_deprecation 2, "Pass --all to `bundle update` to update everything" SharedHelpers.major_deprecation 3, "Pass --all to `bundle update` to update everything"
elsif !full_update && options[:all] elsif !full_update && options[:all]
raise InvalidOption, "Cannot specify --all along with specific options." raise InvalidOption, "Cannot specify --all along with specific options."
end end

View file

@ -19,6 +19,7 @@ module Bundler
2.4 2.4
2.5 2.5
2.6 2.6
2.7
].freeze ].freeze
KNOWN_MAJOR_VERSIONS = KNOWN_MINOR_VERSIONS.map {|v| v.split(".", 2).first }.uniq.freeze KNOWN_MAJOR_VERSIONS = KNOWN_MINOR_VERSIONS.map {|v| v.split(".", 2).first }.uniq.freeze

View file

@ -331,7 +331,7 @@ module Bundler
# i.e., Windows with `git config core.autocrlf=true` # i.e., Windows with `git config core.autocrlf=true`
contents.gsub!(/\n/, "\r\n") if @lockfile_contents.match("\r\n") contents.gsub!(/\n/, "\r\n") if @lockfile_contents.match("\r\n")
if @locked_bundler_version if @locked_bundler_version && Bundler.feature_flag.lockfile_upgrade_warning?
locked_major = @locked_bundler_version.segments.first locked_major = @locked_bundler_version.segments.first
current_major = Gem::Version.create(Bundler::VERSION).segments.first current_major = Gem::Version.create(Bundler::VERSION).segments.first

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require "bundler/shared_helpers" require "bundler/shared_helpers"
Bundler::SharedHelpers.major_deprecation 2, "Bundler no longer integrates with " \ Bundler::SharedHelpers.major_deprecation 3, "Bundler no longer integrates with " \
"Capistrano, but Capistrano provides its own integration with " \ "Capistrano, but Capistrano provides its own integration with " \
"Bundler via the capistrano-bundler gem. Use it instead." "Bundler via the capistrano-bundler gem. Use it instead."

View file

@ -194,7 +194,7 @@ module Bundler
" end\n\n" " end\n\n"
raise DeprecatedError, msg if Bundler.feature_flag.disable_multisource? raise DeprecatedError, msg if Bundler.feature_flag.disable_multisource?
SharedHelpers.major_deprecation(2, msg.strip) SharedHelpers.major_deprecation(3, msg.strip)
end end
source_options = normalize_hash(options).merge( source_options = normalize_hash(options).merge(
@ -305,8 +305,8 @@ module Bundler
# end # end
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
# TODO: 2.0 upgrade this setting to the default # TODO: 2.0 upgrade this setting to the default
if Bundler.feature_flag.github_https? if Bundler.settings["github.https"]
Bundler::SharedHelpers.major_deprecation 2, "The `github.https` setting will be removed" Bundler::SharedHelpers.major_deprecation 3, "The `github.https` setting will be removed"
"https://github.com/#{repo_name}.git" "https://github.com/#{repo_name}.git"
else else
"git://github.com/#{repo_name}.git" "git://github.com/#{repo_name}.git"
@ -456,7 +456,7 @@ repo_name ||= user_name
def normalize_source(source) def normalize_source(source)
case source case source
when :gemcutter, :rubygems, :rubyforge when :gemcutter, :rubygems, :rubyforge
Bundler::SharedHelpers.major_deprecation 2, "The source :#{source} is deprecated because HTTP " \ Bundler::SharedHelpers.major_deprecation 3, "The source :#{source} is deprecated because HTTP " \
"requests are insecure.\nPlease change your source to 'https://" \ "requests are insecure.\nPlease change your source to 'https://" \
"rubygems.org' if possible, or 'http://rubygems.org' if not." "rubygems.org' if possible, or 'http://rubygems.org' if not."
"http://rubygems.org" "http://rubygems.org"
@ -474,13 +474,13 @@ repo_name ||= user_name
msg = "This Gemfile contains multiple primary sources. " \ msg = "This Gemfile contains multiple primary sources. " \
"Each source after the first must include a block to indicate which gems " \ "Each source after the first must include a block to indicate which gems " \
"should come from that source" "should come from that source"
unless Bundler.feature_flag.bundler_2_mode? unless Bundler.feature_flag.bundler_3_mode?
msg += ". To downgrade this error to a warning, run " \ msg += ". To downgrade this error to a warning, run " \
"`bundle config --delete disable_multisource`" "`bundle config --delete disable_multisource`"
end end
raise GemfileEvalError, msg raise GemfileEvalError, msg
else else
Bundler::SharedHelpers.major_deprecation 2, "Your Gemfile contains multiple primary sources. " \ Bundler::SharedHelpers.major_deprecation 3, "Your Gemfile contains multiple primary sources. " \
"Using `source` more than once without a block is a security risk, and " \ "Using `source` more than once without a block is a security risk, and " \
"may result in installing unexpected gems. To resolve this warning, use " \ "may result in installing unexpected gems. To resolve this warning, use " \
"a block to indicate which gems should come from the secondary source. " \ "a block to indicate which gems should come from the secondary source. " \
@ -498,8 +498,8 @@ repo_name ||= user_name
"do |repo_name|\n#{replacement.to_s.gsub(/^/, " ")}\n end" "do |repo_name|\n#{replacement.to_s.gsub(/^/, " ")}\n end"
end end
Bundler::SharedHelpers.major_deprecation 2, <<-EOS Bundler::SharedHelpers.major_deprecation 3, <<-EOS
The :#{name} git source is deprecated, and will be removed in Bundler 2.0.#{additional_message} Add this code to the top of your Gemfile to ensure it continues to work: The :#{name} git source is deprecated, and will be removed in Bundler 3.0.#{additional_message} Add this code to the top of your Gemfile to ensure it continues to work:
git_source(:#{name}) #{replacement} git_source(:#{name}) #{replacement}

View file

@ -27,38 +27,39 @@ module Bundler
(1..10).each {|v| define_method("bundler_#{v}_mode?") { major_version >= v } } (1..10).each {|v| define_method("bundler_#{v}_mode?") { major_version >= v } }
settings_flag(:allow_bundler_dependency_conflicts) { bundler_2_mode? } settings_flag(:allow_bundler_dependency_conflicts) { bundler_3_mode? }
settings_flag(:allow_offline_install) { bundler_2_mode? } settings_flag(:allow_offline_install) { bundler_3_mode? }
settings_flag(:auto_clean_without_path) { bundler_2_mode? } settings_flag(:auto_clean_without_path) { bundler_3_mode? }
settings_flag(:auto_config_jobs) { bundler_2_mode? } settings_flag(:auto_config_jobs) { bundler_3_mode? }
settings_flag(:cache_all) { bundler_2_mode? } settings_flag(:cache_all) { bundler_3_mode? }
settings_flag(:cache_command_is_package) { bundler_2_mode? } settings_flag(:cache_command_is_package) { bundler_3_mode? }
settings_flag(:console_command) { !bundler_2_mode? } settings_flag(:console_command) { !bundler_3_mode? }
settings_flag(:default_install_uses_path) { bundler_2_mode? } settings_flag(:default_install_uses_path) { bundler_3_mode? }
settings_flag(:deployment_means_frozen) { bundler_2_mode? } settings_flag(:deployment_means_frozen) { bundler_3_mode? }
settings_flag(:disable_multisource) { bundler_2_mode? } settings_flag(:disable_multisource) { bundler_3_mode? }
settings_flag(:error_on_stderr) { bundler_2_mode? } settings_flag(:error_on_stderr) { bundler_2_mode? }
settings_flag(:forget_cli_options) { bundler_2_mode? } settings_flag(:forget_cli_options) { bundler_3_mode? }
settings_flag(:global_path_appends_ruby_scope) { bundler_2_mode? } settings_flag(:global_path_appends_ruby_scope) { bundler_3_mode? }
settings_flag(:global_gem_cache) { bundler_2_mode? } settings_flag(:global_gem_cache) { bundler_3_mode? }
settings_flag(:init_gems_rb) { bundler_2_mode? } settings_flag(:init_gems_rb) { bundler_3_mode? }
settings_flag(:list_command) { bundler_2_mode? } settings_flag(:list_command) { bundler_3_mode? }
settings_flag(:lockfile_uses_separate_rubygems_sources) { bundler_2_mode? } settings_flag(:lockfile_uses_separate_rubygems_sources) { bundler_3_mode? }
settings_flag(:only_update_to_newer_versions) { bundler_2_mode? } settings_flag(:lockfile_upgrade_warning) { bundler_3_mode? }
settings_flag(:path_relative_to_cwd) { bundler_2_mode? } settings_flag(:only_update_to_newer_versions) { bundler_3_mode? }
settings_flag(:path_relative_to_cwd) { bundler_3_mode? }
settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") } settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") }
settings_flag(:prefer_gems_rb) { bundler_2_mode? } settings_flag(:prefer_gems_rb) { bundler_3_mode? }
settings_flag(:print_only_version_number) { bundler_2_mode? } settings_flag(:print_only_version_number) { bundler_3_mode? }
settings_flag(:setup_makes_kernel_gem_public) { !bundler_2_mode? } settings_flag(:setup_makes_kernel_gem_public) { !bundler_3_mode? }
settings_flag(:skip_default_git_sources) { bundler_2_mode? } settings_flag(:skip_default_git_sources) { bundler_3_mode? }
settings_flag(:specific_platform) { bundler_2_mode? } settings_flag(:specific_platform) { bundler_3_mode? }
settings_flag(:suppress_install_using_messages) { bundler_2_mode? } settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
settings_flag(:unlock_source_unlocks_spec) { !bundler_2_mode? } settings_flag(:unlock_source_unlocks_spec) { !bundler_3_mode? }
settings_flag(:update_requires_all_flag) { bundler_2_mode? } settings_flag(:update_requires_all_flag) { bundler_3_mode? }
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_2_mode? } settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }
settings_flag(:viz_command) { !bundler_2_mode? } settings_flag(:viz_command) { !bundler_3_mode? }
settings_option(:default_cli_command) { bundler_2_mode? ? :cli_help : :install } settings_option(:default_cli_command) { bundler_3_mode? ? :cli_help : :install }
settings_method(:github_https?, "github.https") { bundler_2_mode? } settings_method(:github_https?, "github.https") { bundler_2_mode? }

View file

@ -465,7 +465,7 @@ module Bundler
raise Gem::Exception, "no default executable for #{spec.full_name}" unless exec_name ||= spec.default_executable raise Gem::Exception, "no default executable for #{spec.full_name}" unless exec_name ||= spec.default_executable
unless spec.name == gem_name unless spec.name == gem_name
Bundler::SharedHelpers.major_deprecation 2, Bundler::SharedHelpers.major_deprecation 3,
"Bundler is using a binstub that was created for a different gem (#{spec.name}).\n" \ "Bundler is using a binstub that was created for a different gem (#{spec.name}).\n" \
"You should run `bundle binstub #{gem_name}` " \ "You should run `bundle binstub #{gem_name}` " \
"to work around a system/bundle conflict." "to work around a system/bundle conflict."

View file

@ -40,6 +40,7 @@ module Bundler
ignore_messages ignore_messages
init_gems_rb init_gems_rb
list_command list_command
lockfile_upgrade_warning
lockfile_uses_separate_rubygems_sources lockfile_uses_separate_rubygems_sources
major_deprecations major_deprecations
no_install no_install
@ -112,7 +113,7 @@ module Bundler
"bundle config #{key} #{Array(value).join(":")}" "bundle config #{key} #{Array(value).join(":")}"
end end
Bundler::SharedHelpers.major_deprecation 2,\ Bundler::SharedHelpers.major_deprecation 3,\
"flags passed to commands " \ "flags passed to commands " \
"will no longer be automatically remembered. Instead please set flags " \ "will no longer be automatically remembered. Instead please set flags " \
"you want remembered between commands using `bundle config " \ "you want remembered between commands using `bundle config " \

View file

@ -157,8 +157,8 @@ module Bundler
next if gemfiles.empty? next if gemfiles.empty?
break false if gemfiles.size == 1 break false if gemfiles.size == 1
end end
if multiple_gemfiles && Bundler.bundler_major_version == 1 if multiple_gemfiles && Bundler.bundler_major_version == 2
Bundler::SharedHelpers.major_deprecation 2, \ Bundler::SharedHelpers.major_deprecation 3, \
"gems.rb and gems.locked will be preferred to Gemfile and Gemfile.lock." "gems.rb and gems.locked will be preferred to Gemfile and Gemfile.lock."
end end

View file

@ -19,9 +19,8 @@ module Bundler
# can't point to the actual gemspec or else the require paths will be wrong # can't point to the actual gemspec or else the require paths will be wrong
s.loaded_from = File.expand_path("..", __FILE__) s.loaded_from = File.expand_path("..", __FILE__)
end end
if loaded_spec = Bundler.rubygems.loaded_specs("bundler")
idx << loaded_spec # this has to come after the fake gemspec, to override it if local_spec = Bundler.rubygems.find_name("bundler").find {|s| s.version.to_s == VERSION }
elsif local_spec = Bundler.rubygems.find_name("bundler").find {|s| s.version.to_s == VERSION }
idx << local_spec idx << local_spec
end end

View file

@ -1,16 +1,12 @@
# frozen_string_literal: true # frozen_string_literal: true
require "tsort" require "tsort"
require "forwardable"
require "set" require "set"
module Bundler module Bundler
class SpecSet class SpecSet
extend Forwardable include Enumerable
include TSort, Enumerable include TSort
def_delegators :@specs, :<<, :length, :add, :remove, :size, :empty?
def_delegators :sorted, :each
def initialize(specs) def initialize(specs)
@specs = specs @specs = specs
@ -132,6 +128,26 @@ module Bundler
what_required(req) << spec what_required(req) << spec
end end
def <<(spec)
@specs << spec
end
def length
@specs.length
end
def size
@specs.size
end
def empty?
@specs.empty?
end
def each(&b)
sorted.each(&b)
end
private private
def sorted def sorted

View file

@ -1,6 +1,4 @@
source "https://rubygems.org" source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
# Specify your gem's dependencies in <%= config[:name] %>.gemspec # Specify your gem's dependencies in <%= config[:name] %>.gemspec
gemspec gemspec

View file

@ -7,7 +7,7 @@ module Bundler
# We're doing this because we might write tests that deal # We're doing this because we might write tests that deal
# with other versions of bundler and we are unsure how to # with other versions of bundler and we are unsure how to
# handle this better. # handle this better.
VERSION = "1.17.2" unless defined?(::Bundler::VERSION) VERSION = "2.0.1" unless defined?(::Bundler::VERSION)
def self.overwrite_loaded_gem_version def self.overwrite_loaded_gem_version
begin begin

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require "bundler/shared_helpers" require "bundler/shared_helpers"
Bundler::SharedHelpers.major_deprecation 2, Bundler::SharedHelpers.major_deprecation 3,
"The Bundler task for Vlad" "The Bundler task for Vlad"
# Vlad task for Bundler. # Vlad task for Bundler.

View file

@ -3,7 +3,7 @@
require "bundler/shared_helpers" require "bundler/shared_helpers"
Bundler::SharedHelpers.major_deprecation(2, "the bundle_ruby executable has been removed in favor of `bundle platform --ruby`") Bundler::SharedHelpers.major_deprecation(3, "the bundle_ruby executable has been removed in favor of `bundle platform --ruby`")
Signal.trap("INT") { exit 1 } Signal.trap("INT") { exit 1 }

View file

@ -10,8 +10,8 @@ BUNDLE-ADD(1) BUNDLE-ADD(1)
[--source=SOURCE] [--skip-install] [--strict] [--optimistic] [--source=SOURCE] [--skip-install] [--strict] [--optimistic]
1mDESCRIPTION0m 1mDESCRIPTION0m
Adds the named gem to the Gemfile and run 1mbundle install22m. 1mbundle0m Adds the named gem to the Gemfile and run 1mbundle install22m. 1mbundle in-0m
1minstall 22mcan be avoided by using the flag 1m--skip-install22m. 1mstall 22mcan be avoided by using the flag 1m--skip-install22m.
Example: Example:

View file

@ -24,8 +24,8 @@ BUNDLE-CHECK(1) BUNDLE-CHECK(1)
file(5)]. file(5)].
1m--path 22mSpecify a different path than the system default (1m$BUNDLE_PATH0m 1m--path 22mSpecify a different path than the system default (1m$BUNDLE_PATH0m
or 1m$GEM_HOME22m). Bundler will remember this value for future or 1m$GEM_HOME22m). Bundler will remember this value for future in-
installs on this machine. stalls on this machine.

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-CONFIG" "1" "December 2018" "" "" .TH "BUNDLE\-CONFIG" "1" "January 2019" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-config\fR \- Set bundler configuration options \fBbundle\-config\fR \- Set bundler configuration options

View file

@ -44,8 +44,8 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
1mapp/.bundle/config22m. 1mapp/.bundle/config22m.
Executing 1mbundle config --delete <name> 22mwill delete the configuration Executing 1mbundle config --delete <name> 22mwill delete the configuration
in both local and global sources. Not compatible with --global or in both local and global sources. Not compatible with --global or --lo-
--local flag. cal flag.
Executing bundle with the 1mBUNDLE_IGNORE_CONFIG 22menvironment variable set Executing bundle with the 1mBUNDLE_IGNORE_CONFIG 22menvironment variable set
will cause it to ignore all configuration. will cause it to ignore all configuration.
@ -68,13 +68,13 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
text. If used, you might add this directory to your environ- text. If used, you might add this directory to your environ-
ment's 1mPATH 22mvariable. For instance, if the 1mrails 22mgem comes with ment's 1mPATH 22mvariable. For instance, if the 1mrails 22mgem comes with
a 1mrails 22mexecutable, this flag will create a 1mbin/rails 22mexecutable a 1mrails 22mexecutable, this flag will create a 1mbin/rails 22mexecutable
that ensures that all referred dependencies will be resolved that ensures that all referred dependencies will be resolved us-
using the bundled gems. ing the bundled gems.
1mdeployment0m 1mdeployment0m
In deployment mode, Bundler will 'roll-out' the bundle for 1mpro-0m In deployment mode, Bundler will 'roll-out' the bundle for 1mpro-0m
1mduction 22muse. Please check carefully if you want to have this 1mduction 22muse. Please check carefully if you want to have this op-
option enabled in 1mdevelopment 22mor 1mtest 22menvironments. tion enabled in 1mdevelopment 22mor 1mtest 22menvironments.
1mpath 22mThe location to install the specified gems to. This defaults to 1mpath 22mThe location to install the specified gems to. This defaults to
Rubygems' setting. Bundler shares this location with Rubygems, Rubygems' setting. Bundler shares this location with Rubygems,
@ -143,8 +143,8 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
4mdle-install.1.html24m. 4mdle-install.1.html24m.
o 1mallow_bundler_dependency_conflicts 22m(1mBUNDLE_ALLOW_BUNDLER_DEPEN-0m o 1mallow_bundler_dependency_conflicts 22m(1mBUNDLE_ALLOW_BUNDLER_DEPEN-0m
1mDENCY_CONFLICTS22m): Allow resolving to specifications that have 1mDENCY_CONFLICTS22m): Allow resolving to specifications that have de-
dependencies on 1mbundler 22mthat are incompatible with the running pendencies on 1mbundler 22mthat are incompatible with the running
Bundler version. Bundler version.
o 1mallow_deployment_source_credential_changes 22m(1mBUNDLE_ALLOW_DEPLOY-0m o 1mallow_deployment_source_credential_changes 22m(1mBUNDLE_ALLOW_DEPLOY-0m
@ -160,8 +160,8 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
cally run 1mbundle clean 22mafter installing when an explicit 1mpath 22mhas cally run 1mbundle clean 22mafter installing when an explicit 1mpath 22mhas
not been set and Bundler is not installing into the system gems. not been set and Bundler is not installing into the system gems.
o 1mauto_install 22m(1mBUNDLE_AUTO_INSTALL22m): Automatically run 1mbundle0m o 1mauto_install 22m(1mBUNDLE_AUTO_INSTALL22m): Automatically run 1mbundle in-0m
1minstall 22mwhen gems are missing. 1mstall 22mwhen gems are missing.
o 1mbin 22m(1mBUNDLE_BIN22m): Install executables from gems in the bundle to o 1mbin 22m(1mBUNDLE_BIN22m): Install executables from gems in the bundle to
the specified directory. Defaults to 1mfalse22m. the specified directory. Defaults to 1mfalse22m.
@ -183,8 +183,8 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
Defaults to 1mirb22m. Defaults to 1mirb22m.
o 1mdefault_install_uses_path 22m(1mBUNDLE_DEFAULT_INSTALL_USES_PATH22m): o 1mdefault_install_uses_path 22m(1mBUNDLE_DEFAULT_INSTALL_USES_PATH22m):
Whether a 1mbundle install 22mwithout an explicit 1m--path 22margument Whether a 1mbundle install 22mwithout an explicit 1m--path 22margument de-
defaults to installing gems in 1m.bundle22m. faults to installing gems in 1m.bundle22m.
o 1mdeployment 22m(1mBUNDLE_DEPLOYMENT22m): Disallow changes to the 1mGemfile22m. o 1mdeployment 22m(1mBUNDLE_DEPLOYMENT22m): Disallow changes to the 1mGemfile22m.
When the 1mGemfile 22mis changed and the lockfile has not been updated, When the 1mGemfile 22mis changed and the lockfile has not been updated,
@ -194,12 +194,12 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
Allow installing gems even if they do not match the checksum pro- Allow installing gems even if they do not match the checksum pro-
vided by RubyGems. vided by RubyGems.
o 1mdisable_exec_load 22m(1mBUNDLE_DISABLE_EXEC_LOAD22m): Stop Bundler from o 1mdisable_exec_load 22m(1mBUNDLE_DISABLE_EXEC_LOAD22m): Stop Bundler from us-
using 1mload 22mto launch an executable in-process in 1mbundle exec22m. ing 1mload 22mto launch an executable in-process in 1mbundle exec22m.
o 1mdisable_local_branch_check 22m(1mBUNDLE_DISABLE_LOCAL_BRANCH_CHECK22m): o 1mdisable_local_branch_check 22m(1mBUNDLE_DISABLE_LOCAL_BRANCH_CHECK22m): Al-
Allow Bundler to use a local git override without a branch speci- low Bundler to use a local git override without a branch specified
fied in the Gemfile. in the Gemfile.
o 1mdisable_multisource 22m(1mBUNDLE_DISABLE_MULTISOURCE22m): When set, Gem- o 1mdisable_multisource 22m(1mBUNDLE_DISABLE_MULTISOURCE22m): When set, Gem-
files containing multiple sources will produce errors instead of files containing multiple sources will produce errors instead of
@ -242,90 +242,89 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
cache all gems globally, rather than locally to the installing Ruby cache all gems globally, rather than locally to the installing Ruby
installation. installation.
o 1mglobal_path_appends_ruby_scope 22m(1mBUN-0m o 1mglobal_path_appends_ruby_scope 22m(1mBUNDLE_GLOBAL_PATH_AP-0m
1mDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE22m): Whether Bundler should append 1mPENDS_RUBY_SCOPE22m): Whether Bundler should append the Ruby scope
the Ruby scope (e.g. engine and ABI version) to a globally-config- (e.g. engine and ABI version) to a globally-configured path.
ured path.
o 1mignore_messages 22m(1mBUNDLE_IGNORE_MESSAGES22m): When set, no post install o 1mignore_messages 22m(1mBUNDLE_IGNORE_MESSAGES22m): When set, no post install
messages will be printed. To silence a single gem, use dot notation messages will be printed. To silence a single gem, use dot notation
like 1mignore_messages.httparty true22m. like 1mignore_messages.httparty true22m.
o 1minit_gems_rb 22m(1mBUNDLE_INIT_GEMS_RB22m) Generate a 1mgems.rb 22minstead of a o 1minit_gems_rb 22m(1mBUNDLE_INIT_GEMS_RB22m) Generate a 1mgems.rb 22minstead of a
1mGemfile 22mwhen running 1mbundle init22m. 1mGemfile 22mwhen running 1mbundle init22m.
o 1mjobs 22m(1mBUNDLE_JOBS22m): The number of gems Bundler can install in par- o 1mjobs 22m(1mBUNDLE_JOBS22m): The number of gems Bundler can install in par-
allel. Defaults to 1. allel. Defaults to 1.
o 1mlist_command 22m(1mBUNDLE_LIST_COMMAND22m) Enable new list command feature o 1mlist_command 22m(1mBUNDLE_LIST_COMMAND22m) Enable new list command feature
o 1mmajor_deprecations 22m(1mBUNDLE_MAJOR_DEPRECATIONS22m): Whether Bundler o 1mmajor_deprecations 22m(1mBUNDLE_MAJOR_DEPRECATIONS22m): Whether Bundler
should print deprecation warnings for behavior that will be changed should print deprecation warnings for behavior that will be changed
in the next major version. in the next major version.
o 1mno_install 22m(1mBUNDLE_NO_INSTALL22m): Whether 1mbundle package 22mshould skip o 1mno_install 22m(1mBUNDLE_NO_INSTALL22m): Whether 1mbundle package 22mshould skip
installing gems. installing gems.
o 1mno_prune 22m(1mBUNDLE_NO_PRUNE22m): Whether Bundler should leave outdated o 1mno_prune 22m(1mBUNDLE_NO_PRUNE22m): Whether Bundler should leave outdated
gems unpruned when caching. gems unpruned when caching.
o 1monly_update_to_newer_versions 22m(1mBUNDLE_ONLY_UPDATE_TO_NEWER_VER-0m o 1monly_update_to_newer_versions 22m(1mBUNDLE_ONLY_UPDATE_TO_NEWER_VER-0m
1mSIONS22m): During 1mbundle update22m, only resolve to newer versions of the 1mSIONS22m): During 1mbundle update22m, only resolve to newer versions of the
gems in the lockfile. gems in the lockfile.
o 1mpath 22m(1mBUNDLE_PATH22m): The location on disk where all gems in your o 1mpath 22m(1mBUNDLE_PATH22m): The location on disk where all gems in your
bundle will be located regardless of 1m$GEM_HOME 22mor 1m$GEM_PATH 22mvalues. bundle will be located regardless of 1m$GEM_HOME 22mor 1m$GEM_PATH 22mvalues.
Bundle gems not found in this location will be installed by 1mbundle0m Bundle gems not found in this location will be installed by 1mbundle0m
1minstall22m. Defaults to 1mGem.dir22m. When --deployment is used, defaults 1minstall22m. Defaults to 1mGem.dir22m. When --deployment is used, defaults
to vendor/bundle. to vendor/bundle.
o 1mpath.system 22m(1mBUNDLE_PATH__SYSTEM22m): Whether Bundler will install o 1mpath.system 22m(1mBUNDLE_PATH__SYSTEM22m): Whether Bundler will install
gems into the default system path (1mGem.dir22m). gems into the default system path (1mGem.dir22m).
o 1mpath_relative_to_cwd 22m(1mPATH_RELATIVE_TO_CWD22m) Makes 1m--path 22mrelative o 1mpath_relative_to_cwd 22m(1mPATH_RELATIVE_TO_CWD22m) Makes 1m--path 22mrelative
to the CWD instead of the 1mGemfile22m. to the CWD instead of the 1mGemfile22m.
o 1mplugins 22m(1mBUNDLE_PLUGINS22m): Enable Bundler's experimental plugin sys- o 1mplugins 22m(1mBUNDLE_PLUGINS22m): Enable Bundler's experimental plugin sys-
tem. tem.
o 1mprefer_gems_rb 22m(1mBUNDLE_PREFER_GEMS_RB22m) Prefer 1mgems.rb 22mto 1mGemfile0m o 1mprefer_gems_rb 22m(1mBUNDLE_PREFER_GEMS_RB22m) Prefer 1mgems.rb 22mto 1mGemfile0m
when Bundler is searching for a Gemfile. when Bundler is searching for a Gemfile.
o 1mprint_only_version_number 22m(1mBUNDLE_PRINT_ONLY_VERSION_NUMBER22m) Print o 1mprint_only_version_number 22m(1mBUNDLE_PRINT_ONLY_VERSION_NUMBER22m) Print
only version number from 1mbundler --version22m. only version number from 1mbundler --version22m.
o 1mredirect 22m(1mBUNDLE_REDIRECT22m): The number of redirects allowed for o 1mredirect 22m(1mBUNDLE_REDIRECT22m): The number of redirects allowed for
network requests. Defaults to 1m522m. network requests. Defaults to 1m522m.
o 1mretry 22m(1mBUNDLE_RETRY22m): The number of times to retry failed network o 1mretry 22m(1mBUNDLE_RETRY22m): The number of times to retry failed network
requests. Defaults to 1m322m. requests. Defaults to 1m322m.
o 1msetup_makes_kernel_gem_public 22m(1mBUNDLE_SETUP_MAKES_KERNEL_GEM_PUB-0m o 1msetup_makes_kernel_gem_public 22m(1mBUNDLE_SETUP_MAKES_KERNEL_GEM_PUB-0m
1mLIC22m): Have 1mBundler.setup 22mmake the 1mKernel#gem 22mmethod public, even 1mLIC22m): Have 1mBundler.setup 22mmake the 1mKernel#gem 22mmethod public, even
though RubyGems declares it as private. though RubyGems declares it as private.
o 1mshebang 22m(1mBUNDLE_SHEBANG22m): The program name that should be invoked o 1mshebang 22m(1mBUNDLE_SHEBANG22m): The program name that should be invoked
for generated binstubs. Defaults to the ruby install name used to for generated binstubs. Defaults to the ruby install name used to
generate the binstub. generate the binstub.
o 1msilence_root_warning 22m(1mBUNDLE_SILENCE_ROOT_WARNING22m): Silence the o 1msilence_root_warning 22m(1mBUNDLE_SILENCE_ROOT_WARNING22m): Silence the
warning Bundler prints when installing gems as root. warning Bundler prints when installing gems as root.
o 1mskip_default_git_sources 22m(1mBUNDLE_SKIP_DEFAULT_GIT_SOURCES22m): Whether o 1mskip_default_git_sources 22m(1mBUNDLE_SKIP_DEFAULT_GIT_SOURCES22m): Whether
Bundler should skip adding default git source shortcuts to the Gem- Bundler should skip adding default git source shortcuts to the Gem-
file DSL. file DSL.
o 1mspecific_platform 22m(1mBUNDLE_SPECIFIC_PLATFORM22m): Allow bundler to o 1mspecific_platform 22m(1mBUNDLE_SPECIFIC_PLATFORM22m): Allow bundler to re-
resolve for the specific running platform and store it in the lock- solve for the specific running platform and store it in the lock-
file, instead of only using a generic platform. A specific platform file, instead of only using a generic platform. A specific platform
is the exact platform triple reported by 1mGem::Platform.local22m, such is the exact platform triple reported by 1mGem::Platform.local22m, such
as 1mx86_64-darwin-16 22mor 1muniversal-java-1.822m. On the other hand, as 1mx86_64-darwin-16 22mor 1muniversal-java-1.822m. On the other hand,
generic platforms are those such as 1mruby22m, 1mmswin22m, or 1mjava22m. In this generic platforms are those such as 1mruby22m, 1mmswin22m, or 1mjava22m. In this
example, 1mx86_64-darwin-16 22mwould map to 1mruby 22mand 1muniversal-java-1.80m example, 1mx86_64-darwin-16 22mwould map to 1mruby 22mand 1muniversal-java-1.80m
to 1mjava22m. to 1mjava22m.
o 1mssl_ca_cert 22m(1mBUNDLE_SSL_CA_CERT22m): Path to a designated CA certifi- o 1mssl_ca_cert 22m(1mBUNDLE_SSL_CA_CERT22m): Path to a designated CA certifi-
cate file or folder containing multiple certificates for trusted cate file or folder containing multiple certificates for trusted
CAs in PEM format. CAs in PEM format.
o 1mssl_client_cert 22m(1mBUNDLE_SSL_CLIENT_CERT22m): Path to a designated file o 1mssl_client_cert 22m(1mBUNDLE_SSL_CLIENT_CERT22m): Path to a designated file
@ -335,46 +334,46 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
Bundler uses when making HTTPS requests. Defaults to verify peer. Bundler uses when making HTTPS requests. Defaults to verify peer.
o 1msuppress_install_using_messages 22m(1mBUNDLE_SUPPRESS_INSTALL_USING_MES-0m o 1msuppress_install_using_messages 22m(1mBUNDLE_SUPPRESS_INSTALL_USING_MES-0m
1mSAGES22m): Avoid printing 1mUsing ... 22mmessages during installation when 1mSAGES22m): Avoid printing 1mUsing ... 22mmessages during installation when
the version of a gem has not changed. the version of a gem has not changed.
o 1msystem_bindir 22m(1mBUNDLE_SYSTEM_BINDIR22m): The location where RubyGems o 1msystem_bindir 22m(1mBUNDLE_SYSTEM_BINDIR22m): The location where RubyGems
installs binstubs. Defaults to 1mGem.bindir22m. installs binstubs. Defaults to 1mGem.bindir22m.
o 1mtimeout 22m(1mBUNDLE_TIMEOUT22m): The seconds allowed before timing out for o 1mtimeout 22m(1mBUNDLE_TIMEOUT22m): The seconds allowed before timing out for
network requests. Defaults to 1m1022m. network requests. Defaults to 1m1022m.
o 1munlock_source_unlocks_spec 22m(1mBUNDLE_UNLOCK_SOURCE_UNLOCKS_SPEC22m): o 1munlock_source_unlocks_spec 22m(1mBUNDLE_UNLOCK_SOURCE_UNLOCKS_SPEC22m):
Whether running 1mbundle update --source NAME 22munlocks a gem with the Whether running 1mbundle update --source NAME 22munlocks a gem with the
given name. Defaults to 1mtrue22m. given name. Defaults to 1mtrue22m.
o 1mupdate_requires_all_flag 22m(1mBUNDLE_UPDATE_REQUIRES_ALL_FLAG22m) Require o 1mupdate_requires_all_flag 22m(1mBUNDLE_UPDATE_REQUIRES_ALL_FLAG22m) Require
passing 1m--all 22mto 1mbundle update 22mwhen everything should be updated, passing 1m--all 22mto 1mbundle update 22mwhen everything should be updated,
and disallow passing no options to 1mbundle update22m. and disallow passing no options to 1mbundle update22m.
o 1muser_agent 22m(1mBUNDLE_USER_AGENT22m): The custom user agent fragment o 1muser_agent 22m(1mBUNDLE_USER_AGENT22m): The custom user agent fragment
Bundler includes in API requests. Bundler includes in API requests.
o 1mwith 22m(1mBUNDLE_WITH22m): A 1m:22m-separated list of groups whose gems bundler o 1mwith 22m(1mBUNDLE_WITH22m): A 1m:22m-separated list of groups whose gems bundler
should install. should install.
o 1mwithout 22m(1mBUNDLE_WITHOUT22m): A 1m:22m-separated list of groups whose gems o 1mwithout 22m(1mBUNDLE_WITHOUT22m): A 1m:22m-separated list of groups whose gems
bundler should not install. bundler should not install.
In general, you should set these settings per-application by using the In general, you should set these settings per-application by using the
applicable flag to the bundle install(1) 4mbundle-install.1.html24m or bun- applicable flag to the bundle install(1) 4mbundle-install.1.html24m or bun-
dle package(1) 4mbundle-package.1.html24m command. dle package(1) 4mbundle-package.1.html24m command.
You can set them globally either via environment variables or 1mbundle0m You can set them globally either via environment variables or 1mbundle0m
1mconfig22m, whichever is preferable for your setup. If you use both, envi- 1mconfig22m, whichever is preferable for your setup. If you use both, envi-
ronment variables will take preference over global settings. ronment variables will take preference over global settings.
1mLOCAL GIT REPOS0m 1mLOCAL GIT REPOS0m
Bundler also allows you to work against a git repository locally Bundler also allows you to work against a git repository locally in-
instead of using the remote version. This can be achieved by setting up stead of using the remote version. This can be achieved by setting up a
a local override: local override:
@ -391,30 +390,30 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
Now instead of checking out the remote git repository, the local over- 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 ride will be used. Similar to a path source, every time the local git
repository change, changes will be automatically picked up by Bundler. repository change, changes will be automatically picked up by Bundler.
This means a commit in the local git repo will update the revision in This means a commit in the local git repo will update the revision in
the 1mGemfile.lock 22mto the local git repo revision. This requires the same the 1mGemfile.lock 22mto the local git repo revision. This requires the same
attention as git submodules. Before pushing to the remote, you need to 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- 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 mit that only exists in your local machine. You'll also need to CGI es-
escape your usernames and passwords as well. cape your usernames and passwords as well.
Bundler does many checks to ensure a developer won't work with invalid Bundler does many checks to ensure a developer won't work with invalid
references. Particularly, we force a developer to specify a branch in references. Particularly, we force a developer to specify a branch in
the 1mGemfile 22min order to use this feature. If the branch specified in the 1mGemfile 22min order to use this feature. If the branch specified in
the 1mGemfile 22mand the current branch in the local git repository do not the 1mGemfile 22mand the current branch in the local git repository do not
match, Bundler will abort. This ensures that a developer is always match, Bundler will abort. This ensures that a developer is always
working against the correct branches, and prevents accidental locking working against the correct branches, and prevents accidental locking
to a different branch. to a different branch.
Finally, Bundler also ensures that the current revision in the 1mGem-0m Finally, Bundler also ensures that the current revision in the 1mGem-0m
1mfile.lock 22mexists in the local git repository. By doing this, Bundler 1mfile.lock 22mexists in the local git repository. By doing this, Bundler
forces you to fetch the latest changes in the remotes. forces you to fetch the latest changes in the remotes.
1mMIRRORS OF GEM SOURCES0m 1mMIRRORS OF GEM SOURCES0m
Bundler supports overriding gem sources with mirrors. This allows you Bundler supports overriding gem sources with mirrors. This allows you
to configure rubygems.org as the gem source in your Gemfile while still to configure rubygems.org as the gem source in your Gemfile while still
using your mirror to fetch gems. using your mirror to fetch gems.
@ -424,7 +423,7 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
For example, to use a mirror of rubygems.org hosted at rubygems-mir- For example, to use a mirror of rubygems.org hosted at rubygems-mir-
ror.org: ror.org:
@ -433,8 +432,8 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
Each mirror also provides a fallback timeout setting. If the mirror Each mirror also provides a fallback timeout setting. If the mirror
does not respond within the fallback timeout, Bundler will try to use does not respond within the fallback timeout, Bundler will try to use
the original server instead of the mirror. the original server instead of the mirror.
@ -451,11 +450,11 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
The default fallback timeout is 0.1 seconds, but the setting can cur- The default fallback timeout is 0.1 seconds, but the setting can cur-
rently only accept whole seconds (for example, 1, 15, or 30). rently only accept whole seconds (for example, 1, 15, or 30).
1mCREDENTIALS FOR GEM SOURCES0m 1mCREDENTIALS FOR GEM SOURCES0m
Bundler allows you to configure credentials for any gem source, which Bundler allows you to configure credentials for any gem source, which
allows you to avoid putting secrets into your Gemfile. allows you to avoid putting secrets into your Gemfile.
@ -464,7 +463,7 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
For example, to save the credentials of user 1mclaudette 22mfor the gem For example, to save the credentials of user 1mclaudette 22mfor the gem
source at 1mgems.longerous.com22m, you would run: source at 1mgems.longerous.com22m, you would run:
@ -498,7 +497,7 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
This is especially useful for private repositories on hosts such as This is especially useful for private repositories on hosts such as
Github, where you can use personal OAuth tokens: Github, where you can use personal OAuth tokens:
@ -508,9 +507,9 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
1mCONFIGURE BUNDLER DIRECTORIES0m 1mCONFIGURE BUNDLER DIRECTORIES0m
Bundler's home, config, cache and plugin directories are able to be Bundler's home, config, cache and plugin directories are able to be
configured through environment variables. The default location for configured through environment variables. The default location for
Bundler's home directory is 1m~/.bundle22m, which all directories inherit Bundler's home directory is 1m~/.bundle22m, which all directories inherit
from by default. The following outlines the available environment vari- from by default. The following outlines the available environment vari-
ables and their default values ables and their default values
@ -526,4 +525,4 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
December 2018 BUNDLE-CONFIG(1) January 2019 BUNDLE-CONFIG(1)

View file

@ -14,8 +14,8 @@ BUNDLE-EXEC(1) BUNDLE-EXEC(1)
Essentially, if you would normally have run something like 1mrspec0m Essentially, if you would normally have run something like 1mrspec0m
1mspec/my_spec.rb22m, and you want to use the gems specified in the [1mGem-0m 1mspec/my_spec.rb22m, and you want to use the gems specified in the [1mGem-0m
1mfile(5)22m][Gemfile(5)] and installed via bundle install(1) 4mbun-0m 1mfile(5)22m][Gemfile(5)] and installed via bundle install(1) 4mbundle-in-0m
4mdle-install.1.html24m, you should run 1mbundle exec rspec spec/my_spec.rb22m. 4mstall.1.html24m, you should run 1mbundle exec rspec spec/my_spec.rb22m.
Note that 1mbundle exec 22mdoes not require that an executable is available Note that 1mbundle exec 22mdoes not require that an executable is available
on your shell's 1m$PATH22m. on your shell's 1m$PATH22m.
@ -27,10 +27,10 @@ BUNDLE-EXEC(1) BUNDLE-EXEC(1)
of passing all file descriptors to the new process. of passing all file descriptors to the new process.
1mBUNDLE INSTALL --BINSTUBS0m 1mBUNDLE INSTALL --BINSTUBS0m
If you use the 1m--binstubs 22mflag in bundle install(1) 4mbun-0m If you use the 1m--binstubs 22mflag in bundle install(1) 4mbundle-in-0m
4mdle-install.1.html24m, Bundler will automatically create a directory 4mstall.1.html24m, Bundler will automatically create a directory (which de-
(which defaults to 1mapp_root/bin22m) containing all of the executables faults to 1mapp_root/bin22m) containing all of the executables available
available from gems in the bundle. from gems in the bundle.
After using 1m--binstubs22m, 1mbin/rspec spec/my_spec.rb 22mis identical to 1mbun-0m After using 1m--binstubs22m, 1mbin/rspec spec/my_spec.rb 22mis identical to 1mbun-0m
1mdle exec rspec spec/my_spec.rb22m. 1mdle exec rspec spec/my_spec.rb22m.
@ -39,8 +39,8 @@ BUNDLE-EXEC(1) BUNDLE-EXEC(1)
1mbundle exec 22mmakes a number of changes to the shell environment, then 1mbundle exec 22mmakes a number of changes to the shell environment, then
executes the command you specify in full. executes the command you specify in full.
o make sure that it's still possible to shell out to 1mbundle 22mfrom o make sure that it's still possible to shell out to 1mbundle 22mfrom in-
inside a command invoked by 1mbundle exec 22m(using 1m$BUNDLE_BIN_PATH22m) side a command invoked by 1mbundle exec 22m(using 1m$BUNDLE_BIN_PATH22m)
o put the directory containing executables (like 1mrails22m, 1mrspec22m, o put the directory containing executables (like 1mrails22m, 1mrspec22m,
1mrackup22m) for your bundle on 1m$PATH0m 1mrackup22m) for your bundle on 1m$PATH0m
@ -82,18 +82,18 @@ BUNDLE-EXEC(1) BUNDLE-EXEC(1)
By default, when attempting to 1mbundle exec 22mto a file with a ruby she- By default, when attempting to 1mbundle exec 22mto a file with a ruby she-
bang, Bundler will 1mKernel.load 22mthat file instead of using 1mKernel.exec22m. bang, Bundler will 1mKernel.load 22mthat file instead of using 1mKernel.exec22m.
For the vast majority of cases, this is a performance improvement. In a 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 rare few cases, this could cause some subtle side-effects (such as de-
dependence on the exact contents of 1m$0 22mor 1m__FILE__22m) and the optimiza- pendence on the exact contents of 1m$0 22mor 1m__FILE__22m) and the optimization
tion can be disabled by enabling the 1mdisable_exec_load 22msetting. can be disabled by enabling the 1mdisable_exec_load 22msetting.
1mShelling out0m 1mShelling out0m
Any Ruby code that opens a subshell (like 1msystem22m, backticks, or 1m%x{}22m) Any Ruby code that opens a subshell (like 1msystem22m, backticks, or 1m%x{}22m)
will automatically use the current Bundler environment. If you need to will automatically use the current Bundler environment. If you need to
shell out to a Ruby command that is not part of your current bundle, shell out to a Ruby command that is not part of your current bundle,
use the 1mwith_clean_env 22mmethod with a block. Any subshells created use the 1mwith_clean_env 22mmethod with a block. Any subshells created in-
inside the block will be given the environment present before Bundler side the block will be given the environment present before Bundler was
was activated. For example, Homebrew commands run Ruby, but don't work activated. For example, Homebrew commands run Ruby, but don't work in-
inside a bundle: side a bundle:

View file

@ -16,8 +16,8 @@ BUNDLE-GEM(1) BUNDLE-GEM(1)
Run 1mrake -T 22min the resulting project for a list of Rake tasks that can Run 1mrake -T 22min the resulting project for a list of Rake tasks that can
be used to test and publish the gem to rubygems.org. be used to test and publish the gem to rubygems.org.
The generated project skeleton can be customized with OPTIONS, as The generated project skeleton can be customized with OPTIONS, as ex-
explained below. Note that these options can also be specified via plained below. Note that these options can also be specified via
Bundler's global configuration file using the following names: Bundler's global configuration file using the following names:
o 1mgem.coc0m o 1mgem.coc0m
@ -57,9 +57,9 @@ BUNDLE-GEM(1) BUNDLE-GEM(1)
1m--mit 22mAdd an MIT license to a 1mLICENSE.txt 22mfile in the root of the gen- 1m--mit 22mAdd an MIT license to a 1mLICENSE.txt 22mfile in the root of the gen-
erated project. Your name from the global git config is used for erated project. Your name from the global git config is used for
the copyright statement. If this option is unspecified, an the copyright statement. If this option is unspecified, an in-
interactive prompt will be displayed and the answer will be teractive prompt will be displayed and the answer will be saved
saved in Bundler's global config for future 1mbundle gem 22muse. in Bundler's global config for future 1mbundle gem 22muse.
1m--no-mit0m 1m--no-mit0m
Do not create a 1mLICENSE.txt 22m(overrides 1m--mit 22mspecified in the Do not create a 1mLICENSE.txt 22m(overrides 1m--mit 22mspecified in the
@ -68,12 +68,12 @@ BUNDLE-GEM(1) BUNDLE-GEM(1)
1m-t22m, 1m--test=minitest22m, 1m--test=rspec0m 1m-t22m, 1m--test=minitest22m, 1m--test=rspec0m
Specify the test framework that Bundler should use when generat- Specify the test framework that Bundler should use when generat-
ing the project. Acceptable values are 1mminitest 22mand 1mrspec22m. The ing the project. Acceptable values are 1mminitest 22mand 1mrspec22m. The
1mGEM_NAME.gemspec 22mwill be configured and a skeleton test/spec 1mGEM_NAME.gemspec 22mwill be configured and a skeleton test/spec di-
directory will be created based on this option. If this option rectory will be created based on this option. If this option is
is unspecified, an interactive prompt will be displayed and the unspecified, an interactive prompt will be displayed and the an-
answer will be saved in Bundler's global config for future 1mbun-0m swer will be saved in Bundler's global config for future 1mbundle0m
1mdle gem 22muse. If no option is specified, the default testing 1mgem 22muse. If no option is specified, the default testing frame-
framework is RSpec. work is RSpec.
1m-e22m, 1m--edit[=EDITOR]0m 1m-e22m, 1m--edit[=EDITOR]0m
Open the resulting GEM_NAME.gemspec in EDITOR, or the default Open the resulting GEM_NAME.gemspec in EDITOR, or the default

View file

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

View file

@ -39,8 +39,8 @@ BUNDLE-INSTALL(1) BUNDLE-INSTALL(1)
text. If used, you might add this directory to your environ- text. If used, you might add this directory to your environ-
ment's 1mPATH 22mvariable. For instance, if the 1mrails 22mgem comes with ment's 1mPATH 22mvariable. For instance, if the 1mrails 22mgem comes with
a 1mrails 22mexecutable, this flag will create a 1mbin/rails 22mexecutable a 1mrails 22mexecutable, this flag will create a 1mbin/rails 22mexecutable
that ensures that all referred dependencies will be resolved that ensures that all referred dependencies will be resolved us-
using the bundled gems. ing the bundled gems.
1m--clean0m 1m--clean0m
On finishing the installation Bundler is going to remove any On finishing the installation Bundler is going to remove any
@ -53,9 +53,9 @@ BUNDLE-INSTALL(1) BUNDLE-INSTALL(1)
this option enabled in your development environment. this option enabled in your development environment.
1m--force0m 1m--force0m
Force download every gem, even if the required versions are Force download every gem, even if the required versions are al-
already available locally. 1m--redownload 22mis an alias of this ready available locally. 1m--redownload 22mis an alias of this op-
option. tion.
1m--frozen0m 1m--frozen0m
Do not allow the Gemfile.lock to be updated after this install. Do not allow the Gemfile.lock to be updated after this install.
@ -82,8 +82,8 @@ BUNDLE-INSTALL(1) BUNDLE-INSTALL(1)
1m--local0m 1m--local0m
Do not attempt to connect to 1mrubygems.org22m. Instead, Bundler will Do not attempt to connect to 1mrubygems.org22m. Instead, Bundler will
use the gems already present in Rubygems' cache or in 1mven-0m use the gems already present in Rubygems' cache or in 1mven-0m
1mdor/cache22m. Note that if a appropriate platform-specific gem 1mdor/cache22m. Note that if a appropriate platform-specific gem ex-
exists on 1mrubygems.org 22mit will not be found. ists on 1mrubygems.org 22mit will not be found.
1m--no-cache0m 1m--no-cache0m
Do not update the cache in 1mvendor/cache 22mwith the newly bundled Do not update the cache in 1mvendor/cache 22mwith the newly bundled
@ -103,8 +103,8 @@ BUNDLE-INSTALL(1) BUNDLE-INSTALL(1)
will not get listed. will not get listed.
1m--quiet0m 1m--quiet0m
Do not print progress information to the standard output. Do not print progress information to the standard output. In-
Instead, Bundler will exit using a status code (1m$?22m). stead, Bundler will exit using a status code (1m$?22m).
1m--retry=[<number>]0m 1m--retry=[<number>]0m
Retry failed network or git requests for 4mnumber24m times. Retry failed network or git requests for 4mnumber24m times.
@ -155,8 +155,8 @@ BUNDLE-INSTALL(1) BUNDLE-INSTALL(1)
1. A 1mGemfile.lock 22mis required. 1. A 1mGemfile.lock 22mis required.
To ensure that the same versions of the gems you developed with and To ensure that the same versions of the gems you developed with and
tested with are also used in deployments, a 1mGemfile.lock 22mis tested with are also used in deployments, a 1mGemfile.lock 22mis re-
required. quired.
This is mainly to ensure that you remember to check your 1mGem-0m This is mainly to ensure that you remember to check your 1mGem-0m
1mfile.lock 22minto version control. 1mfile.lock 22minto version control.
@ -172,18 +172,18 @@ BUNDLE-INSTALL(1) BUNDLE-INSTALL(1)
3. Gems are installed to 1mvendor/bundle 22mnot your default system loca- 3. Gems are installed to 1mvendor/bundle 22mnot your default system loca-
tion tion
In development, it's convenient to share the gems used in your In development, it's convenient to share the gems used in your ap-
application with other applications and other scripts that run on plication with other applications and other scripts that run on the
the system. system.
In deployment, isolation is a more important default. In addition, In deployment, isolation is a more important default. In addition,
the user deploying the application may not have permission to the user deploying the application may not have permission to in-
install gems to the system, or the web server may not have permis- stall gems to the system, or the web server may not have permission
sion to read them. to read them.
As a result, 1mbundle install --deployment 22minstalls gems to the 1mven-0m As a result, 1mbundle install --deployment 22minstalls gems to the 1mven-0m
1mdor/bundle 22mdirectory in the application. This may be overridden 1mdor/bundle 22mdirectory in the application. This may be overridden us-
using the 1m--path 22moption. ing the 1m--path 22moption.
@ -195,8 +195,8 @@ BUNDLE-INSTALL(1) BUNDLE-INSTALL(1)
ask you for your 1msudo 22mpassword in order to copy the gems into their ask you for your 1msudo 22mpassword in order to copy the gems into their
system location. system location.
From your perspective, this is identical to installing the gems From your perspective, this is identical to installing the gems di-
directly into the system. rectly into the system.
You should never use 1msudo bundle install22m. This is because several other You should never use 1msudo bundle install22m. This is because several other
steps in 1mbundle install 22mmust be performed as the current user: steps in 1mbundle install 22mmust be performed as the current user:
@ -265,9 +265,9 @@ BUNDLE-INSTALL(1) BUNDLE-INSTALL(1)
APIs unavailable in Rack 1.x, only to have Bundler switch to Rack 1.2 APIs unavailable in Rack 1.x, only to have Bundler switch to Rack 1.2
when the 1mproduction 22mgroup 4mis24m used. when the 1mproduction 22mgroup 4mis24m used.
This should not cause any problems in practice, because we do not This should not cause any problems in practice, because we do not at-
attempt to 1minstall 22mthe gems in the excluded groups, and only evaluate tempt to 1minstall 22mthe gems in the excluded groups, and only evaluate as
as part of the dependency resolution process. part of the dependency resolution process.
This also means that you cannot include different versions of the same This also means that you cannot include different versions of the same
gem in different groups, because doing so would result in different gem in different groups, because doing so would result in different
@ -300,8 +300,8 @@ BUNDLE-INSTALL(1) BUNDLE-INSTALL(1)
When Bundler first shipped, the 1mGemfile.lock 22mwas included in the 1m.git-0m When Bundler first shipped, the 1mGemfile.lock 22mwas included in the 1m.git-0m
1mignore 22mfile included with generated gems. Over time, however, it became 1mignore 22mfile included with generated gems. Over time, however, it became
clear that this practice forces the pain of broken dependencies onto clear that this practice forces the pain of broken dependencies onto
new contributors, while leaving existing contributors potentially new contributors, while leaving existing contributors potentially un-
unaware of the problem. Since 1mbundle install 22mis usually the first step aware of the problem. Since 1mbundle install 22mis usually the first step
towards a contribution, the pain of broken dependencies would discour- towards a contribution, the pain of broken dependencies would discour-
age new contributors from contributing. As a result, we have revised age new contributors from contributing. As a result, we have revised
our guidance for gem authors to now recommend checking in the lock for our guidance for gem authors to now recommend checking in the lock for
@ -331,8 +331,8 @@ BUNDLE-INSTALL(1) BUNDLE-INSTALL(1)
1m1.1.022m, while the 1mactivemerchant 22mgem depends on 1mactivesupport >= 2.3.222m, 1m1.1.022m, while the 1mactivemerchant 22mgem depends on 1mactivesupport >= 2.3.222m,
1mbraintree >= 2.0.022m, and 1mbuilder >= 2.0.022m. 1mbraintree >= 2.0.022m, and 1mbuilder >= 2.0.022m.
When the dependencies are first resolved, Bundler will select When the dependencies are first resolved, Bundler will select 1mac-0m
1mactivesupport 2.3.822m, which satisfies the requirements of both gems in 1mtivesupport 2.3.822m, which satisfies the requirements of both gems in
your Gemfile(5). your Gemfile(5).
Next, you modify your Gemfile(5) to: Next, you modify your Gemfile(5) to:
@ -346,12 +346,12 @@ BUNDLE-INSTALL(1) BUNDLE-INSTALL(1)
The 1mactionpack 3.0.0.rc 22mgem has a number of new dependencies, and The 1mactionpack 3.0.0.rc 22mgem has a number of new dependencies, and up-
updates the 1mactivesupport 22mdependency to 1m= 3.0.0.rc 22mand the 1mrack 22mdepen- dates the 1mactivesupport 22mdependency to 1m= 3.0.0.rc 22mand the 1mrack 22mdepen-
dency to 1m~> 1.2.122m. dency to 1m~> 1.2.122m.
When you run 1mbundle install22m, Bundler notices that you changed the When you run 1mbundle install22m, Bundler notices that you changed the 1mac-0m
1mactionpack 22mgem, but not the 1mactivemerchant 22mgem. It evaluates the gems 1mtionpack 22mgem, but not the 1mactivemerchant 22mgem. It evaluates the gems
currently being used to satisfy its requirements: currently being used to satisfy its requirements:
1mactivesupport 2.3.80m 1mactivesupport 2.3.80m
@ -370,8 +370,8 @@ BUNDLE-INSTALL(1) BUNDLE-INSTALL(1)
retically matches 1mactivesupport 3.0.0.rc22m, Bundler treats gems in your retically matches 1mactivesupport 3.0.0.rc22m, Bundler treats gems in your
Gemfile(5) that have not changed as an atomic unit together with their Gemfile(5) that have not changed as an atomic unit together with their
dependencies. In this case, the 1mactivemerchant 22mdependency is treated as dependencies. In this case, the 1mactivemerchant 22mdependency is treated as
1mactivemerchant 1.7.1 + activesupport 2.3.822m, so 1mbundle install 22mwill 1mactivemerchant 1.7.1 + activesupport 2.3.822m, so 1mbundle install 22mwill re-
report that it cannot update 1mactionpack22m. port that it cannot update 1mactionpack22m.
To explicitly update 1mactionpack22m, including its dependencies which other To explicitly update 1mactionpack22m, including its dependencies which other
gems in the Gemfile(5) still depend on, run 1mbundle update actionpack0m gems in the Gemfile(5) still depend on, run 1mbundle update actionpack0m
@ -383,8 +383,8 @@ BUNDLE-INSTALL(1) BUNDLE-INSTALL(1)
work, run bundle update(1) 4mbundle-update.1.html24m. work, run bundle update(1) 4mbundle-update.1.html24m.
1mSEE ALSO0m 1mSEE ALSO0m
o Gem install docs o Gem install docs 4mhttp://guides.rubygems.org/rubygems-basics/#in-0m
4mhttp://guides.rubygems.org/rubygems-basics/#installing-gems0m 4mstalling-gems0m
o Rubygems signing docs 4mhttp://guides.rubygems.org/security/0m o Rubygems signing docs 4mhttp://guides.rubygems.org/security/0m
@ -393,4 +393,4 @@ BUNDLE-INSTALL(1) BUNDLE-INSTALL(1)
December 2018 BUNDLE-INSTALL(1) January 2019 BUNDLE-INSTALL(1)

View file

@ -21,8 +21,8 @@ BUNDLE-LOCK(1) BUNDLE-LOCK(1)
1m--local0m 1m--local0m
Do not attempt to connect to 1mrubygems.org22m. Instead, Bundler will Do not attempt to connect to 1mrubygems.org22m. Instead, Bundler will
use the gems already present in Rubygems' cache or in 1mven-0m use the gems already present in Rubygems' cache or in 1mven-0m
1mdor/cache22m. Note that if a appropriate platform-specific gem 1mdor/cache22m. Note that if a appropriate platform-specific gem ex-
exists on 1mrubygems.org 22mit will not be found. ists on 1mrubygems.org 22mit will not be found.
1m--print0m 1m--print0m
Prints the lockfile to STDOUT instead of writing to the file Prints the lockfile to STDOUT instead of writing to the file
@ -60,17 +60,17 @@ BUNDLE-LOCK(1) BUNDLE-LOCK(1)
1mUPDATING ALL GEMS0m 1mUPDATING ALL GEMS0m
If you run 1mbundle lock 22mwith 1m--update 22moption without list of gems, If you run 1mbundle lock 22mwith 1m--update 22moption without list of gems,
bundler will ignore any previously installed gems and resolve all bundler will ignore any previously installed gems and resolve all de-
dependencies again based on the latest versions of all gems available pendencies again based on the latest versions of all gems available in
in the sources. the sources.
1mUPDATING A LIST OF GEMS0m 1mUPDATING A LIST OF GEMS0m
Sometimes, you want to update a single gem in the Gemfile(5), and leave Sometimes, you want to update a single gem in the Gemfile(5), and leave
the rest of the gems that you specified locked to the versions in the the rest of the gems that you specified locked to the versions in the
1mGemfile.lock22m. 1mGemfile.lock22m.
For instance, you only want to update 1mnokogiri22m, run 1mbundle lock0m For instance, you only want to update 1mnokogiri22m, run 1mbundle lock --up-0m
1m--update nokogiri22m. 1mdate nokogiri22m.
Bundler will update 1mnokogiri 22mand any of its dependencies, but leave the Bundler will update 1mnokogiri 22mand any of its dependencies, but leave the
rest of the gems that you specified locked to the versions in the 1mGem-0m rest of the gems that you specified locked to the versions in the 1mGem-0m

View file

@ -7,9 +7,9 @@ BUNDLE-OUTDATED(1) BUNDLE-OUTDATED(1)
1mSYNOPSIS0m 1mSYNOPSIS0m
1mbundle outdated 22m[GEM] [--local] [--pre] [--source] [--strict] 1mbundle outdated 22m[GEM] [--local] [--pre] [--source] [--strict]
[--parseable | --porcelain] [--group=GROUP] [--groups] [--parseable | --porcelain] [--group=GROUP] [--groups] [--up-
[--update-strict] [--patch|--minor|--major] [--filter-major] [--fil- date-strict] [--patch|--minor|--major] [--filter-major] [--filter-mi-
ter-minor] [--filter-patch] [--only-explicit] nor] [--filter-patch] [--only-explicit]
1mDESCRIPTION0m 1mDESCRIPTION0m
Outdated lists the names and versions of gems that have a newer version Outdated lists the names and versions of gems that have a newer version
@ -20,8 +20,8 @@ BUNDLE-OUTDATED(1) BUNDLE-OUTDATED(1)
1mOPTIONS0m 1mOPTIONS0m
1m--local0m 1m--local0m
Do not attempt to fetch gems remotely and use the gem cache Do not attempt to fetch gems remotely and use the gem cache in-
instead. stead.
1m--pre 22mCheck for newer pre-release gems. 1m--pre 22mCheck for newer pre-release gems.
@ -41,8 +41,8 @@ BUNDLE-OUTDATED(1) BUNDLE-OUTDATED(1)
List gems organized by groups. List gems organized by groups.
1m--update-strict0m 1m--update-strict0m
Strict conservative resolution, do not allow any gem to be Strict conservative resolution, do not allow any gem to be up-
updated past latest --patch | --minor| --major. dated past latest --patch | --minor| --major.
1m--minor0m 1m--minor0m
Prefer updating only to next minor version. Prefer updating only to next minor version.

View file

@ -10,15 +10,15 @@ BUNDLE-PACKAGE(1) BUNDLE-PACKAGE(1)
1mDESCRIPTION0m 1mDESCRIPTION0m
Copy all of the 1m.gem 22mfiles needed to run the application into the 1mven-0m Copy all of the 1m.gem 22mfiles needed to run the application into the 1mven-0m
1mdor/cache 22mdirectory. In the future, when running [bundle 1mdor/cache 22mdirectory. In the future, when running [bundle in-
install(1)][bundle-install], use the gems in the cache in preference to stall(1)][bundle-install], use the gems in the cache in preference to
the ones on 1mrubygems.org22m. the ones on 1mrubygems.org22m.
1mGIT AND PATH GEMS0m 1mGIT AND PATH GEMS0m
Since Bundler 1.2, the 1mbundle package 22mcommand can also package 1m:git 22mand Since Bundler 1.2, the 1mbundle package 22mcommand can also package 1m:git 22mand
1m:path 22mdependencies besides .gem files. This needs to be explicitly 1m:path 22mdependencies besides .gem files. This needs to be explicitly en-
enabled via the 1m--all 22moption. Once used, the 1m--all 22moption will be abled via the 1m--all 22moption. Once used, the 1m--all 22moption will be remem-
remembered. bered.
1mSUPPORT FOR MULTIPLE PLATFORMS0m 1mSUPPORT FOR MULTIPLE PLATFORMS0m
When using gems that have different packages for different platforms, When using gems that have different packages for different platforms,
@ -48,9 +48,9 @@ BUNDLE-PACKAGE(1) BUNDLE-PACKAGE(1)
run 1mbundle install22m, bundler is forced to check to see whether a 1m"java"0m run 1mbundle install22m, bundler is forced to check to see whether a 1m"java"0m
platformed 1mnokogiri 22mexists. platformed 1mnokogiri 22mexists.
Even though the 1mnokogiri 22mgem for the Ruby platform is 4mtechnically0m Even though the 1mnokogiri 22mgem for the Ruby platform is 4mtechnically24m ac-
acceptable on JRuby, it has a C extension that does not run on JRuby. ceptable on JRuby, it has a C extension that does not run on JRuby. As
As a result, bundler will, by default, still connect to 1mrubygems.org 22mto a result, bundler will, by default, still connect to 1mrubygems.org 22mto
check whether it has a version of one of your gems more specific to check whether it has a version of one of your gems more specific to
your platform. your platform.

View file

@ -18,9 +18,9 @@ BUNDLE-PRISTINE(1) BUNDLE-PRISTINE(1)
gem's git repository as if one were installing from scratch. gem's git repository as if one were installing from scratch.
Note: the Bundler gem cannot be restored to its original state with Note: the Bundler gem cannot be restored to its original state with
1mpristine22m. One also cannot use 1mbundle pristine 22mon gems with a 'path' 1mpristine22m. One also cannot use 1mbundle pristine 22mon gems with a 'path' op-
option in the Gemfile, because bundler has no original copy it can tion in the Gemfile, because bundler has no original copy it can re-
restore from. store from.
When is it practical to use 1mbundle pristine22m? When is it practical to use 1mbundle pristine22m?

View file

@ -17,8 +17,8 @@ BUNDLE-REMOVE(1) BUNDLE-REMOVE(1)
1mOPTIONS0m 1mOPTIONS0m
1m--install0m 1m--install0m
Runs 1mbundle install 22mafter the given gems have been removed from Runs 1mbundle install 22mafter the given gems have been removed from
the Gemfile, which ensures that both the lockfile and the the Gemfile, which ensures that both the lockfile and the in-
installed gems on disk are also updated to remove the given stalled gems on disk are also updated to remove the given
gem(s). gem(s).
Example: Example:

View file

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

View file

@ -35,8 +35,8 @@ BUNDLE-UPDATE(1) BUNDLE-UPDATE(1)
1m--source rails0m 1m--source rails0m
1m--local0m 1m--local0m
Do not attempt to fetch gems remotely and use the gem cache Do not attempt to fetch gems remotely and use the gem cache in-
instead. stead.
1m--ruby 22mUpdate the locked version of Ruby to the current version of 1m--ruby 22mUpdate the locked version of Ruby to the current version of
Ruby. Ruby.
@ -79,8 +79,8 @@ BUNDLE-UPDATE(1) BUNDLE-UPDATE(1)
shared dependencies to be updated. shared dependencies to be updated.
1mUPDATING ALL GEMS0m 1mUPDATING ALL GEMS0m
If you run 1mbundle update --all22m, bundler will ignore any previously If you run 1mbundle update --all22m, bundler will ignore any previously in-
installed gems and resolve all dependencies again based on the latest stalled gems and resolve all dependencies again based on the latest
versions of all gems available in the sources. versions of all gems available in the sources.
Consider the following Gemfile(5): Consider the following Gemfile(5):
@ -95,8 +95,8 @@ BUNDLE-UPDATE(1) BUNDLE-UPDATE(1)
When you run bundle install(1) 4mbundle-install.1.html24m the first time, When you run bundle install(1) 4mbundle-install.1.html24m the first time,
bundler will resolve all of the dependencies, all the way down, and bundler will resolve all of the dependencies, all the way down, and in-
install what you need: stall what you need:
@ -153,8 +153,8 @@ BUNDLE-UPDATE(1) BUNDLE-UPDATE(1)
To do this, run 1mbundle update --all22m, which will ignore the 1mGem-0m To do this, run 1mbundle update --all22m, which will ignore the 1mGem-0m
1mfile.lock22m, and resolve all the dependencies again. Keep in mind that 1mfile.lock22m, and resolve all the dependencies again. Keep in mind that
this process can result in a significantly different set of the 25 this process can result in a significantly different set of the 25
gems, based on the requirements of new gems that the gem authors gems, based on the requirements of new gems that the gem authors re-
released since the last time you ran 1mbundle update --all22m. leased since the last time you ran 1mbundle update --all22m.
1mUPDATING A LIST OF GEMS0m 1mUPDATING A LIST OF GEMS0m
Sometimes, you want to update a single gem in the Gemfile(5), and leave Sometimes, you want to update a single gem in the Gemfile(5), and leave
@ -182,8 +182,8 @@ BUNDLE-UPDATE(1) BUNDLE-UPDATE(1)
The 1mthin 22mgem depends on 1mrack >= 1.022m, while 1mrack-perftools-profiler0m The 1mthin 22mgem depends on 1mrack >= 1.022m, while 1mrack-perftools-profiler 22mde-
depends on 1mrack ~> 1.022m. If you run bundle install, you get: pends on 1mrack ~> 1.022m. If you run bundle install, you get:
@ -200,8 +200,8 @@ BUNDLE-UPDATE(1) BUNDLE-UPDATE(1)
In this case, the two gems have their own set of dependencies, but they In this case, the two gems have their own set of dependencies, but they
share 1mrack 22min common. If you run 1mbundle update thin22m, bundler will share 1mrack 22min common. If you run 1mbundle update thin22m, bundler will up-
update 1mdaemons22m, 1meventmachine 22mand 1mrack22m, which are dependencies of 1mthin22m, date 1mdaemons22m, 1meventmachine 22mand 1mrack22m, which are dependencies of 1mthin22m,
but not 1mopen4 22mor 1mperftools.rb22m, which are dependencies of but not 1mopen4 22mor 1mperftools.rb22m, which are dependencies of
1mrack-perftools_profiler22m. Note that 1mbundle update thin 22mwill update 1mrack0m 1mrack-perftools_profiler22m. Note that 1mbundle update thin 22mwill update 1mrack0m
even though it's 4malso24m a dependency of 1mrack-perftools_profiler22m. even though it's 4malso24m a dependency of 1mrack-perftools_profiler22m.
@ -215,10 +215,10 @@ BUNDLE-UPDATE(1) BUNDLE-UPDATE(1)
4mdle-install.1.html24m: 4mdle-install.1.html24m:
In this scenario, updating the 1mthin 22mversion manually in the Gemfile(5), In this scenario, updating the 1mthin 22mversion manually in the Gemfile(5),
and then running bundle install(1) 4mbundle-install.1.html24m will only and then running bundle install(1) 4mbundle-install.1.html24m will only up-
update 1mdaemons 22mand 1meventmachine22m, but not 1mrack22m. For more information, date 1mdaemons 22mand 1meventmachine22m, but not 1mrack22m. For more information, see
see the 1mCONSERVATIVE UPDATING 22msection of bundle install(1) 4mbun-0m the 1mCONSERVATIVE UPDATING 22msection of bundle install(1) 4mbundle-in-0m
4mdle-install.1.html24m. 4mstall.1.html24m.
Starting with 1.14, specifying the 1m--conservative 22moption will also pre- Starting with 1.14, specifying the 1m--conservative 22moption will also pre-
vent shared dependencies from being updated. vent shared dependencies from being updated.
@ -242,11 +242,11 @@ BUNDLE-UPDATE(1) BUNDLE-UPDATE(1)
Do not allow any gem to be updated past latest 1m--patch 22m| 1m--minor0m Do not allow any gem to be updated past latest 1m--patch 22m| 1m--minor0m
| 1m--major22m. | 1m--major22m.
When Bundler is resolving what versions to use to satisfy declared When Bundler is resolving what versions to use to satisfy declared re-
requirements in the Gemfile or in parent gems, it looks up all avail- quirements in the Gemfile or in parent gems, it looks up all available
able versions, filters out any versions that don't satisfy the require- versions, filters out any versions that don't satisfy the requirement,
ment, and then, by default, sorts them from newest to oldest, consider- and then, by default, sorts them from newest to oldest, considering
ing them in that order. them in that order.
Providing one of the patch level options (e.g. 1m--patch22m) changes the Providing one of the patch level options (e.g. 1m--patch22m) changes the
sort order of the satisfying versions, causing Bundler to consider the sort order of the satisfying versions, causing Bundler to consider the
@ -266,16 +266,16 @@ BUNDLE-UPDATE(1) BUNDLE-UPDATE(1)
"1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2, 2.0.0". "1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2, 2.0.0".
Combining the 1m--strict 22moption with any of the patch level options will Combining the 1m--strict 22moption with any of the patch level options will
remove any versions beyond the scope of the patch level option, to remove any versions beyond the scope of the patch level option, to en-
ensure that no gem is updated that far. sure that no gem is updated that far.
To continue the previous example, if both 1m--patch 22mand 1m--strict 22moptions To continue the previous example, if both 1m--patch 22mand 1m--strict 22moptions
are used, the available versions for resolution would be "1.0.4, 1.0.3, are used, the available versions for resolution would be "1.0.4, 1.0.3,
1.0.2". If 1m--minor 22mand 1m--strict 22mare used, it would be "1.1.1, 1.1.0, 1.0.2". If 1m--minor 22mand 1m--strict 22mare used, it would be "1.1.1, 1.1.0,
1.0.4, 1.0.3, 1.0.2". 1.0.4, 1.0.3, 1.0.2".
Gem requirements as defined in the Gemfile will still be the first Gem requirements as defined in the Gemfile will still be the first de-
determining factor for what versions are available. If the gem require- termining factor for what versions are available. If the gem require-
ment for 1mfoo 22min the Gemfile is '~> 1.0', that will accomplish the same ment for 1mfoo 22min the Gemfile is '~> 1.0', that will accomplish the same
thing as providing the 1m--minor 22mand 1m--strict 22moptions. thing as providing the 1m--minor 22mand 1m--strict 22moptions.
@ -328,8 +328,8 @@ BUNDLE-UPDATE(1) BUNDLE-UPDATE(1)
In case 1, bar is upgraded to 2.1.1, a minor version increase, because In case 1, bar is upgraded to 2.1.1, a minor version increase, because
the dependency from foo 1.4.5 required it. the dependency from foo 1.4.5 required it.
In case 2, only foo is requested to be unlocked, but bar is also In case 2, only foo is requested to be unlocked, but bar is also al-
allowed to move because it's not a declared dependency in the Gemfile. lowed to move because it's not a declared dependency in the Gemfile.
In case 3, bar goes up a whole major release, because a minor increase In case 3, bar goes up a whole major release, because a minor increase
is preferred now for foo, and when it goes to 1.5.1, it requires 3.0.0 is preferred now for foo, and when it goes to 1.5.1, it requires 3.0.0
@ -388,4 +388,4 @@ BUNDLE-UPDATE(1) BUNDLE-UPDATE(1)
December 2018 BUNDLE-UPDATE(1) January 2019 BUNDLE-UPDATE(1)

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE" "1" "November 2018" "" "" .TH "BUNDLE" "1" "January 2019" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\fR \- Ruby Dependency Management \fBbundle\fR \- Ruby Dependency Management
@ -116,6 +116,10 @@ Clean up unused gems in your Bundler directory
\fBbundle doctor(1)\fR \fIbundle\-doctor\.1\.html\fR \fBbundle doctor(1)\fR \fIbundle\-doctor\.1\.html\fR
Display warnings about common problems Display warnings about common problems
. .
.TP
\fBbundle remove(1)\fR \fIbundle\-remove\.1\.html\fR
Removes gems from the Gemfile
.
.SH "PLUGINS" .SH "PLUGINS"
When running a command that isn\'t listed in PRIMARY COMMANDS or UTILITIES, Bundler will try to find an executable on your path named \fBbundler\-<command>\fR and execute it, passing down any extra arguments to it\. When running a command that isn\'t listed in PRIMARY COMMANDS or UTILITIES, Bundler will try to find an executable on your path named \fBbundler\-<command>\fR and execute it, passing down any extra arguments to it\.
. .

View file

@ -56,8 +56,8 @@ BUNDLE(1) BUNDLE(1)
Generate binstubs for executables in a gem Generate binstubs for executables in a gem
1mbundle check(1) 4m22mbundle-check.1.html0m 1mbundle check(1) 4m22mbundle-check.1.html0m
Determine whether the requirements for your application are Determine whether the requirements for your application are in-
installed and available to Bundler stalled and available to Bundler
1mbundle show(1) 4m22mbundle-show.1.html0m 1mbundle show(1) 4m22mbundle-show.1.html0m
Show the source location of a particular gem in the bundle Show the source location of a particular gem in the bundle
@ -92,6 +92,9 @@ BUNDLE(1) BUNDLE(1)
1mbundle doctor(1) 4m22mbundle-doctor.1.html0m 1mbundle doctor(1) 4m22mbundle-doctor.1.html0m
Display warnings about common problems Display warnings about common problems
1mbundle remove(1) 4m22mbundle-remove.1.html0m
Removes gems from the Gemfile
1mPLUGINS0m 1mPLUGINS0m
When running a command that isn't listed in PRIMARY COMMANDS or UTILI- When running a command that isn't listed in PRIMARY COMMANDS or UTILI-
TIES, Bundler will try to find an executable on your path named TIES, Bundler will try to find an executable on your path named
@ -110,4 +113,4 @@ BUNDLE(1) BUNDLE(1)
November 2018 BUNDLE(1) January 2019 BUNDLE(1)

View file

@ -94,6 +94,9 @@ We divide `bundle` subcommands into primary commands and utilities:
* [`bundle doctor(1)`](bundle-doctor.1.html): * [`bundle doctor(1)`](bundle-doctor.1.html):
Display warnings about common problems Display warnings about common problems
* [`bundle remove(1)`](bundle-remove.1.html):
Removes gems from the Gemfile
## PLUGINS ## PLUGINS
When running a command that isn't listed in PRIMARY COMMANDS or UTILITIES, When running a command that isn't listed in PRIMARY COMMANDS or UTILITIES,

View file

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "GEMFILE" "5" "November 2018" "" "" .TH "GEMFILE" "5" "January 2019" "" ""
. .
.SH "NAME" .SH "NAME"
\fBGemfile\fR \- A format for describing gem dependencies for Ruby programs \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
@ -299,19 +299,19 @@ The full list of platforms and supported versions includes:
. .
.TP .TP
\fBruby\fR \fBruby\fR
1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5 1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5, 2\.6
. .
.TP .TP
\fBmri\fR \fBmri\fR
1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5 1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5, 2\.6
. .
.TP .TP
\fBmingw\fR \fBmingw\fR
1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5 1\.8, 1\.9, 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5, 2\.6
. .
.TP .TP
\fBx64_mingw\fR \fBx64_mingw\fR
2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5 2\.0, 2\.1, 2\.2, 2\.3, 2\.4, 2\.5, 2\.6
. .
.P .P
As with groups, you can specify one or more platforms: As with groups, you can specify one or more platforms:

View file

@ -216,13 +216,13 @@ used on platforms with Ruby 2.3, use:
The full list of platforms and supported versions includes: The full list of platforms and supported versions includes:
* `ruby`: * `ruby`:
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
* `mri`: * `mri`:
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
* `mingw`: * `mingw`:
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
* `x64_mingw`: * `x64_mingw`:
2.0, 2.1, 2.2, 2.3, 2.4, 2.5 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
As with groups, you can specify one or more platforms: As with groups, you can specify one or more platforms:

View file

@ -43,8 +43,8 @@ GEMFILE(5) GEMFILE(5)
Some gem sources require a username and password. Use bundle config(1) Some gem sources require a username and password. Use bundle config(1)
4mbundle-config.1.html24m to set the username and password for any of the 4mbundle-config.1.html24m to set the username and password for any of the
sources that need it. The command must be run once on each computer sources that need it. The command must be run once on each computer
that will install the Gemfile, but this keeps the credentials from that will install the Gemfile, but this keeps the credentials from be-
being stored in plain text in version control. ing stored in plain text in version control.
@ -98,8 +98,8 @@ GEMFILE(5) GEMFILE(5)
o Other implementations 4mhttps://www.ruby-lang.org/en/about/24m of Ruby o Other implementations 4mhttps://www.ruby-lang.org/en/about/24m of Ruby
exist. Some of the more well-known implementations include Rubinius exist. Some of the more well-known implementations include Rubinius
4mhttps://rubinius.com/24m, and JRuby 4mhttp://jruby.org/24m. Rubinius is an 4mhttps://rubinius.com/24m, and JRuby 4mhttp://jruby.org/24m. Rubinius is an
alternative implementation of Ruby written in Ruby. JRuby is an alternative implementation of Ruby written in Ruby. JRuby is an im-
implementation of Ruby on the JVM, short for Java Virtual Machine. plementation of Ruby on the JVM, short for Java Virtual Machine.
@ -227,8 +227,8 @@ GEMFILE(5) GEMFILE(5)
Note that on 1mbundle install22m, bundler downloads and evaluates all gems, Note that on 1mbundle install22m, bundler downloads and evaluates all gems,
in order to create a single canonical list of all of the required gems in order to create a single canonical list of all of the required gems
and their dependencies. This means that you cannot list different ver- and their dependencies. This means that you cannot list different ver-
sions of the same gems in different groups. For more details, see sions of the same gems in different groups. For more details, see Un-
Understanding Bundler 4mhttp://bundler.io/rationale.html24m. derstanding Bundler 4mhttp://bundler.io/rationale.html24m.
1mPLATFORMS0m 1mPLATFORMS0m
If a gem should only be used in a particular platform or set of plat- If a gem should only be used in a particular platform or set of plat-
@ -256,8 +256,8 @@ GEMFILE(5) GEMFILE(5)
1mmswin 22mWindows 1mmswin 22mWindows
You can restrict further by platform and version for all platforms You can restrict further by platform and version for all platforms 4mex-0m
4mexcept24m for 1mrbx22m, 1mjruby22m, 1mtruffleruby 22mand 1mmswin22m. 4mcept24m for 1mrbx22m, 1mjruby22m, 1mtruffleruby 22mand 1mmswin22m.
To specify a version in addition to a platform, append the version num- To specify a version in addition to a platform, append the version num-
ber without the delimiter to the platform. For example, to specify that ber without the delimiter to the platform. For example, to specify that
@ -271,14 +271,14 @@ GEMFILE(5) GEMFILE(5)
The full list of platforms and supported versions includes: The full list of platforms and supported versions includes:
1mruby 22m1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5 1mruby 22m1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
1mmri 22m1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5 1mmri 22m1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
1mmingw 22m1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5 1mmingw 22m1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
1mx64_mingw0m 1mx64_mingw0m
2.0, 2.1, 2.2, 2.3, 2.4, 2.5 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
As with groups, you can specify one or more platforms: As with groups, you can specify one or more platforms:
@ -313,8 +313,8 @@ GEMFILE(5) GEMFILE(5)
it will fall back on global sources using the ordering described in it will fall back on global sources using the ordering described in
4mSOURCE24m 4mPRIORITY24m. 4mSOURCE24m 4mPRIORITY24m.
Selecting a specific source repository this way also suppresses the Selecting a specific source repository this way also suppresses the am-
ambiguous gem warning described above in 4mGLOBAL24m 4mSOURCES24m 4m(#source)24m. biguous gem warning described above in 4mGLOBAL24m 4mSOURCES24m 4m(#source)24m.
Using the 1m:source 22moption for an individual gem will also make that Using the 1m:source 22moption for an individual gem will also make that
source available as a possible global source for any other gems which source available as a possible global source for any other gems which
@ -342,13 +342,13 @@ GEMFILE(5) GEMFILE(5)
can deliver malicious code and compromise your system. HTTPS and SSH can deliver malicious code and compromise your system. HTTPS and SSH
are strongly preferred. are strongly preferred.
The 1mgroup22m, 1mplatforms22m, and 1mrequire 22moptions are available and behave The 1mgroup22m, 1mplatforms22m, and 1mrequire 22moptions are available and behave ex-
exactly the same as they would for a normal gem. actly the same as they would for a normal gem.
A git repository 1mSHOULD 22mhave at least one file, at the root of the A git repository 1mSHOULD 22mhave at least one file, at the root of the di-
directory containing the gem, with the extension 1m.gemspec22m. This file rectory containing the gem, with the extension 1m.gemspec22m. This file 1mMUST0m
1mMUST 22mcontain a valid gem specification, as expected by the 1mgem build0m contain a valid gem specification, as expected by the 1mgem build 22mcom-
command. mand.
If a git repository does not have a 1m.gemspec22m, bundler will attempt to If a git repository does not have a 1m.gemspec22m, bundler will attempt to
create one, but it will not contain any dependencies, executables, or C create one, but it will not contain any dependencies, executables, or C
@ -419,8 +419,8 @@ GEMFILE(5) GEMFILE(5)
1mGIT SOURCE0m 1mGIT SOURCE0m
A custom git source can be defined via the 1mgit_source 22mmethod. Provide A custom git source can be defined via the 1mgit_source 22mmethod. Provide
the source's name as an argument, and a block which receives a single the source's name as an argument, and a block which receives a single
argument and interpolates it into a string to return the full repo argument and interpolates it into a string to return the full repo ad-
address: dress:
@ -510,8 +510,8 @@ GEMFILE(5) GEMFILE(5)
Since the 1mbitbucket 22mmethod is a specialization of 1mgit_source22m, it Since the 1mbitbucket 22mmethod is a specialization of 1mgit_source22m, it ac-
accepts a 1m:branch 22mnamed argument. cepts a 1m:branch 22mnamed argument.
1mPATH0m 1mPATH0m
You can specify that a gem is located in a particular location on the You can specify that a gem is located in a particular location on the
@ -573,8 +573,8 @@ GEMFILE(5) GEMFILE(5)
In the case of the group block form the :optional option can be given In the case of the group block form the :optional option can be given
to prevent a group from being installed unless listed in the 1m--with0m to prevent a group from being installed unless listed in the 1m--with 22mop-
option given to the 1mbundle install 22mcommand. tion given to the 1mbundle install 22mcommand.
In the case of the 1mgit 22mblock form, the 1m:ref22m, 1m:branch22m, 1m:tag22m, and 1m:sub-0m In the case of the 1mgit 22mblock form, the 1m:ref22m, 1m:branch22m, 1m:tag22m, and 1m:sub-0m
1mmodules 22moptions may be passed to the 1mgit 22mmethod, and all gems in the 1mmodules 22moptions may be passed to the 1mgit 22mmethod, and all gems in the
@ -584,8 +584,8 @@ GEMFILE(5) GEMFILE(5)
available as a possible global source for any other gems which do not available as a possible global source for any other gems which do not
specify explicit sources. Thus, when defining source blocks, it is rec- specify explicit sources. Thus, when defining source blocks, it is rec-
ommended that you also ensure all other gems in the Gemfile are using ommended that you also ensure all other gems in the Gemfile are using
explicit sources, either via source blocks or 1m:source 22mdirectives on explicit sources, either via source blocks or 1m:source 22mdirectives on in-
individual gems. dividual gems.
1mINSTALL_IF0m 1mINSTALL_IF0m
The 1minstall_if 22mmethod allows gems to be installed based on a proc or The 1minstall_if 22mmethod allows gems to be installed based on a proc or
@ -612,12 +612,12 @@ GEMFILE(5) GEMFILE(5)
cies listed in the 1m.gemspec 22mfile. cies listed in the 1m.gemspec 22mfile.
The 1mgemspec 22mmethod adds any runtime dependencies as gem requirements in The 1mgemspec 22mmethod adds any runtime dependencies as gem requirements in
the default group. It also adds development dependencies as gem the default group. It also adds development dependencies as gem re-
requirements in the 1mdevelopment 22mgroup. Finally, it adds a gem require- quirements in the 1mdevelopment 22mgroup. Finally, it adds a gem requirement
ment on your project (1m:path => '.'22m). In conjunction with 1mBundler.setup22m, on your project (1m:path => '.'22m). In conjunction with 1mBundler.setup22m, this
this allows you to require project files in your test code as you would allows you to require project files in your test code as you would if
if the project were installed as a gem; you need not manipulate the the project were installed as a gem; you need not manipulate the load
load path manually or require project files via relative paths. path manually or require project files via relative paths.
The 1mgemspec 22mmethod supports optional 1m:path22m, 1m:glob22m, 1m:name22m, and 1m:develop-0m The 1mgemspec 22mmethod supports optional 1m:path22m, 1m:glob22m, 1m:name22m, and 1m:develop-0m
1mment_group 22moptions, which control where bundler looks for the 1m.gemspec22m, 1mment_group 22moptions, which control where bundler looks for the 1m.gemspec22m,
@ -650,4 +650,4 @@ GEMFILE(5) GEMFILE(5)
November 2018 GEMFILE(5) January 2019 GEMFILE(5)

View file

@ -28,7 +28,7 @@ RSpec.describe "bundle executable" do
end end
context "with no arguments" do context "with no arguments" do
it "prints a concise help message", :bundler => "2" do it "prints a concise help message", :bundler => "3" do
bundle! "" bundle! ""
expect(last_command.stderr).to be_empty expect(last_command.stderr).to be_empty
expect(last_command.stdout).to include("Bundler version #{Bundler::VERSION}"). expect(last_command.stdout).to include("Bundler version #{Bundler::VERSION}").
@ -161,12 +161,12 @@ To install the latest version, run `gem install bundler --pre`
end end
RSpec.describe "bundler executable" do RSpec.describe "bundler executable" do
it "shows the bundler version just as the `bundle` executable does", :bundler => "< 2" do it "shows the bundler version just as the `bundle` executable does", :bundler => "< 3" do
bundler "--version" bundler "--version"
expect(out).to eq("Bundler version #{Bundler::VERSION}") expect(out).to eq("Bundler version #{Bundler::VERSION}")
end end
it "shows the bundler version just as the `bundle` executable does", :bundler => "2" do it "shows the bundler version just as the `bundle` executable does", :bundler => "3" do
bundler "--version" bundler "--version"
expect(out).to eq(Bundler::VERSION) expect(out).to eq(Bundler::VERSION)
end end

View file

@ -34,7 +34,7 @@ RSpec.describe Bundler::Definition do
end end
describe "detects changes" do describe "detects changes" do
it "for a path gem with changes", :bundler => "< 2" do it "for a path gem with changes", :bundler => "< 3" do
build_lib "foo", "1.0", :path => lib_path("foo") build_lib "foo", "1.0", :path => lib_path("foo")
install_gemfile <<-G install_gemfile <<-G
@ -72,7 +72,7 @@ RSpec.describe Bundler::Definition do
G G
end end
it "for a path gem with changes", :bundler => "2" do it "for a path gem with changes", :bundler => "3" do
build_lib "foo", "1.0", :path => lib_path("foo") build_lib "foo", "1.0", :path => lib_path("foo")
install_gemfile <<-G install_gemfile <<-G
@ -110,7 +110,7 @@ RSpec.describe Bundler::Definition do
G G
end end
it "for a path gem with deps and no changes", :bundler => "< 2" do it "for a path gem with deps and no changes", :bundler => "< 3" do
build_lib "foo", "1.0", :path => lib_path("foo") do |s| build_lib "foo", "1.0", :path => lib_path("foo") do |s|
s.add_dependency "rack", "1.0" s.add_dependency "rack", "1.0"
s.add_development_dependency "net-ssh", "1.0" s.add_development_dependency "net-ssh", "1.0"
@ -147,7 +147,7 @@ RSpec.describe Bundler::Definition do
G G
end end
it "for a path gem with deps and no changes", :bundler => "2" do it "for a path gem with deps and no changes", :bundler => "3" do
build_lib "foo", "1.0", :path => lib_path("foo") do |s| build_lib "foo", "1.0", :path => lib_path("foo") do |s|
s.add_dependency "rack", "1.0" s.add_dependency "rack", "1.0"
s.add_development_dependency "net-ssh", "1.0" s.add_development_dependency "net-ssh", "1.0"

View file

@ -32,7 +32,7 @@ RSpec.describe Bundler::Dsl do
end end
end end
context "default hosts (git, gist)", :bundler => "< 2" do context "default hosts (git, gist)", :bundler => "< 3" do
context "when github.https config is true" do context "when github.https config is true" do
before { bundle "config github.https true" } before { bundle "config github.https true" }
it "converts :github to :git using https" do it "converts :github to :git using https" do
@ -79,7 +79,7 @@ RSpec.describe Bundler::Dsl do
end end
end end
context "default git sources", :bundler => "2" do context "default git sources", :bundler => "3" do
it "has none" do it "has none" do
expect(subject.instance_variable_get(:@git_sources)).to eq({}) expect(subject.instance_variable_get(:@git_sources)).to eq({})
end end
@ -245,7 +245,7 @@ RSpec.describe Bundler::Dsl do
# gem 'spree_api' # gem 'spree_api'
# gem 'spree_backend' # gem 'spree_backend'
# end # end
describe "#github", :bundler => "< 2" do describe "#github", :bundler => "< 3" do
it "from github" do it "from github" do
spree_gems = %w[spree_core spree_api spree_backend] spree_gems = %w[spree_core spree_api spree_backend]
subject.github "spree" do subject.github "spree" do
@ -258,7 +258,7 @@ RSpec.describe Bundler::Dsl do
end end
end end
describe "#github", :bundler => "2" do describe "#github", :bundler => "3" do
it "from github" do it "from github" do
expect do expect do
spree_gems = %w[spree_core spree_api spree_backend] spree_gems = %w[spree_core spree_api spree_backend]

View file

@ -115,7 +115,7 @@ RSpec.describe Bundler::SourceList do
end end
end end
describe "#add_rubygems_remote", :bundler => "< 2" do describe "#add_rubygems_remote", :bundler => "< 3" do
let!(:returned_source) { source_list.add_rubygems_remote("https://rubygems.org/") } let!(:returned_source) { source_list.add_rubygems_remote("https://rubygems.org/") }
it "returns the aggregate rubygems source" do it "returns the aggregate rubygems source" do
@ -372,7 +372,7 @@ RSpec.describe Bundler::SourceList do
source_list.add_git_source("uri" => "git://first-git.org/path.git") source_list.add_git_source("uri" => "git://first-git.org/path.git")
end end
it "combines the rubygems sources into a single instance, removing duplicate remotes from the end", :bundler => "< 2" do it "combines the rubygems sources into a single instance, removing duplicate remotes from the end", :bundler => "< 3" do
expect(source_list.lock_sources).to eq [ expect(source_list.lock_sources).to eq [
Bundler::Source::Git.new("uri" => "git://first-git.org/path.git"), Bundler::Source::Git.new("uri" => "git://first-git.org/path.git"),
Bundler::Source::Git.new("uri" => "git://second-git.org/path.git"), Bundler::Source::Git.new("uri" => "git://second-git.org/path.git"),
@ -391,7 +391,7 @@ RSpec.describe Bundler::SourceList do
] ]
end end
it "returns all sources, without combining rubygems sources", :bundler => "2" do it "returns all sources, without combining rubygems sources", :bundler => "3" do
expect(source_list.lock_sources).to eq [ expect(source_list.lock_sources).to eq [
Bundler::Source::Rubygems.new, Bundler::Source::Rubygems.new,
Bundler::Source::Rubygems.new("remotes" => ["https://duplicate-rubygems.org"]), Bundler::Source::Rubygems.new("remotes" => ["https://duplicate-rubygems.org"]),

View file

@ -86,7 +86,7 @@
expect(bundled_app("vendor/cache/bar-1.0")).not_to exist expect(bundled_app("vendor/cache/bar-1.0")).not_to exist
end end
it "raises a warning without --all", :bundler => "< 2" do it "raises a warning without --all", :bundler => "< 3" do
build_lib "foo" build_lib "foo"
install_gemfile <<-G install_gemfile <<-G

View file

@ -134,6 +134,33 @@ RSpec.describe "bundle binstubs <gem>" do
if ENV["BUNDLER_SPEC_SUB_VERSION"] if ENV["BUNDLER_SPEC_SUB_VERSION"]
let(:system_bundler_version) { Bundler::VERSION } let(:system_bundler_version) { Bundler::VERSION }
end end
before do
gemfile <<-G
source "file:///Users/colby/Projects/bundler/tmp/gems/remote2"
gem "rack"
gem "prints_loaded_gems"
G
lockfile <<-G
GEM
remote: file:///Users/colby/Projects/bundler/tmp/gems/remote2/
specs:
prints_loaded_gems (1.0)
rack (1.2)
PLATFORMS
ruby
DEPENDENCIES
prints_loaded_gems
rack
BUNDLED WITH
#{system_bundler_version}
G
end
it "runs bundler" do it "runs bundler" do
sys_exec! "#{bundled_app("bin/bundle")} install" sys_exec! "#{bundled_app("bin/bundle")} install"
expect(out).to eq %(system bundler #{system_bundler_version}\n["install"]) expect(out).to eq %(system bundler #{system_bundler_version}\n["install"])
@ -313,7 +340,7 @@ RSpec.describe "bundle binstubs <gem>" do
expect(bundled_app("exec/rackup")).to exist expect(bundled_app("exec/rackup")).to exist
end end
it "setting is saved for bundle install", :bundler => "< 2" do it "setting is saved for bundle install", :bundler => "< 3" do
install_gemfile <<-G install_gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"
gem "rack" gem "rack"

View file

@ -92,7 +92,7 @@ RSpec.describe "bundle check" do
expect(out).to include("Bundler can't satisfy your Gemfile's dependencies.") expect(out).to include("Bundler can't satisfy your Gemfile's dependencies.")
end end
it "remembers --without option from install", :bundler => "< 2" do it "remembers --without option from install", :bundler => "< 3" do
gemfile <<-G gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"
group :foo do group :foo do
@ -238,7 +238,7 @@ RSpec.describe "bundle check" do
expect(last_command).to be_failure expect(last_command).to be_failure
end end
context "--path", :bundler => "< 2" do context "--path", :bundler => "< 3" do
before do before do
gemfile <<-G gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"
@ -254,7 +254,7 @@ RSpec.describe "bundle check" do
expect(out).to include("The Gemfile's dependencies are satisfied") expect(out).to include("The Gemfile's dependencies are satisfied")
end end
it "should write to .bundle/config", :bundler => "< 2" do it "should write to .bundle/config", :bundler => "< 3" do
bundle "check --path vendor/bundle" bundle "check --path vendor/bundle"
bundle! "check" bundle! "check"
end end

View file

@ -142,7 +142,7 @@ RSpec.describe "bundle clean" do
bundle :clean bundle :clean
digest = Digest(:SHA1).hexdigest(git_path.to_s) digest = Digest(:SHA1).hexdigest(git_path.to_s)
cache_path = Bundler::VERSION.start_with?("1.") ? vendored_gems("cache/bundler/git/foo-1.0-#{digest}") : home(".bundle/cache/git/foo-1.0-#{digest}") cache_path = Bundler.bundler_major_version < 3 ? vendored_gems("cache/bundler/git/foo-1.0-#{digest}") : home(".bundle/cache/git/foo-1.0-#{digest}")
expect(cache_path).to exist expect(cache_path).to exist
end end
@ -343,7 +343,7 @@ RSpec.describe "bundle clean" do
expect(out).to include("rack (1.0.0)").and include("thin (1.0)") expect(out).to include("rack (1.0.0)").and include("thin (1.0)")
end end
it "--clean should override the bundle setting on install", :bundler => "< 2" do it "--clean should override the bundle setting on install", :bundler => "< 3" do
gemfile <<-G gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"
@ -363,7 +363,7 @@ RSpec.describe "bundle clean" do
should_not_have_gems "thin-1.0" should_not_have_gems "thin-1.0"
end end
it "--clean should override the bundle setting on update", :bundler => "< 2" do it "--clean should override the bundle setting on update", :bundler => "< 3" do
build_repo2 build_repo2
gemfile <<-G gemfile <<-G
@ -383,7 +383,7 @@ RSpec.describe "bundle clean" do
should_not_have_gems "foo-1.0" should_not_have_gems "foo-1.0"
end end
it "automatically cleans when path has not been set", :bundler => "2" do it "automatically cleans when path has not been set", :bundler => "3" do
build_repo2 build_repo2
install_gemfile! <<-G install_gemfile! <<-G

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
RSpec.describe "bundle console", :bundler => "< 2" do RSpec.describe "bundle console", :bundler => "< 3" do
before :each do before :each do
install_gemfile <<-G install_gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"

View file

@ -570,22 +570,7 @@ RSpec.describe "bundle exec" do
it_behaves_like "it runs" it_behaves_like "it runs"
end end
context "the executable is empty", :bundler => "< 2" do context "the executable is empty" do
let(:executable) { "" }
let(:exit_code) { 0 }
let(:expected) { "#{path} is empty" }
let(:expected_err) { "" }
if LessThanProc.with(RUBY_VERSION).call("1.9")
# Kernel#exec in ruby < 1.9 will raise Errno::ENOEXEC if the command content is empty,
# even if the command is set as an executable.
pending "Kernel#exec is different"
else
it_behaves_like "it runs"
end
end
context "the executable is empty", :bundler => "2" do
let(:executable) { "" } let(:executable) { "" }
let(:exit_code) { 0 } let(:exit_code) { 0 }
@ -594,18 +579,7 @@ RSpec.describe "bundle exec" do
it_behaves_like "it runs" it_behaves_like "it runs"
end end
context "the executable raises", :bundler => "< 2" do context "the executable raises" do
let(:executable) { super() << "\nraise 'ERROR'" }
let(:exit_code) { 1 }
let(:expected) { super() << "\nbundler: failed to load command: #{path} (#{path})" }
let(:expected_err) do
"RuntimeError: ERROR\n #{path}:10" +
(Bundler.current_ruby.ruby_18? ? "" : ":in `<top (required)>'")
end
it_behaves_like "it runs"
end
context "the executable raises", :bundler => "2" do
let(:executable) { super() << "\nraise 'ERROR'" } let(:executable) { super() << "\nraise 'ERROR'" }
let(:exit_code) { 1 } let(:exit_code) { 1 }
let(:expected_err) do let(:expected_err) do
@ -615,16 +589,7 @@ RSpec.describe "bundle exec" do
it_behaves_like "it runs" it_behaves_like "it runs"
end end
context "the executable raises an error without a backtrace", :bundler => "< 2" do context "the executable raises an error without a backtrace" do
let(:executable) { super() << "\nclass Err < Exception\ndef backtrace; end;\nend\nraise Err" }
let(:exit_code) { 1 }
let(:expected) { super() << "\nbundler: failed to load command: #{path} (#{path})" }
let(:expected_err) { "Err: Err" }
it_behaves_like "it runs"
end
context "the executable raises an error without a backtrace", :bundler => "2" do
let(:executable) { super() << "\nclass Err < Exception\ndef backtrace; end;\nend\nraise Err" } let(:executable) { super() << "\nclass Err < Exception\ndef backtrace; end;\nend\nraise Err" }
let(:exit_code) { 1 } let(:exit_code) { 1 }
let(:expected_err) { "bundler: failed to load command: #{path} (#{path})\nErr: Err" } let(:expected_err) { "bundler: failed to load command: #{path} (#{path})\nErr: Err" }
@ -638,7 +603,7 @@ RSpec.describe "bundle exec" do
it_behaves_like "it runs" it_behaves_like "it runs"
end end
context "when Bundler.setup fails", :bundler => "< 2" do context "when Bundler.setup fails", :bundler => "< 3" do
before do before do
gemfile <<-G gemfile <<-G
gem 'rack', '2' gem 'rack', '2'
@ -655,7 +620,7 @@ RSpec.describe "bundle exec" do
it_behaves_like "it runs" it_behaves_like "it runs"
end end
context "when Bundler.setup fails", :bundler => "2" do context "when Bundler.setup fails", :bundler => "3" do
before do before do
gemfile <<-G gemfile <<-G
gem 'rack', '2' gem 'rack', '2'
@ -800,10 +765,11 @@ __FILE__: #{path.to_s.inspect}
it "overrides disable_shared_gems so bundler can be found" do it "overrides disable_shared_gems so bundler can be found" do
skip "bundler 1.16.x is not support with Ruby 2.6 on Travis CI" if RUBY_VERSION >= "2.6" skip "bundler 1.16.x is not support with Ruby 2.6 on Travis CI" if RUBY_VERSION >= "2.6"
system_gems :bundler
file = bundled_app("file_that_bundle_execs.rb") file = bundled_app("file_that_bundle_execs.rb")
create_file(file, <<-RB) create_file(file, <<-RB)
#!#{Gem.ruby} #!#{Gem.ruby}
puts `bundle exec echo foo` puts `#{system_bundle_bin_path} exec echo foo`
RB RB
file.chmod(0o777) file.chmod(0o777)
bundle! "exec #{file}", :system_bundler => true bundle! "exec #{file}", :system_bundler => true

View file

@ -1,19 +1,19 @@
# frozen_string_literal: true # frozen_string_literal: true
RSpec.describe "bundle init" do RSpec.describe "bundle init" do
it "generates a Gemfile", :bundler => "< 2" do it "generates a Gemfile", :bundler => "< 3" do
bundle! :init bundle! :init
expect(out).to include("Writing new Gemfile") expect(out).to include("Writing new Gemfile")
expect(bundled_app("Gemfile")).to be_file expect(bundled_app("Gemfile")).to be_file
end end
it "generates a gems.rb", :bundler => "2" do it "generates a gems.rb", :bundler => "3" do
bundle! :init bundle! :init
expect(out).to include("Writing new gems.rb") expect(out).to include("Writing new gems.rb")
expect(bundled_app("gems.rb")).to be_file expect(bundled_app("gems.rb")).to be_file
end end
context "when a Gemfile already exists", :bundler => "< 2" do context "when a Gemfile already exists", :bundler => "< 3" do
before do before do
create_file "Gemfile", <<-G create_file "Gemfile", <<-G
gem "rails" gem "rails"
@ -30,7 +30,7 @@ RSpec.describe "bundle init" do
end end
end end
context "when gems.rb already exists", :bundler => ">= 2" do context "when gems.rb already exists", :bundler => ">= 3" do
before do before do
create_file("gems.rb", <<-G) create_file("gems.rb", <<-G)
gem "rails" gem "rails"
@ -47,7 +47,7 @@ RSpec.describe "bundle init" do
end end
end end
context "when a Gemfile exists in a parent directory", :bundler => "< 2" do context "when a Gemfile exists in a parent directory", :bundler => "< 3" do
let(:subdir) { "child_dir" } let(:subdir) { "child_dir" }
it "lets users generate a Gemfile in a child directory" do it "lets users generate a Gemfile in a child directory" do
@ -82,7 +82,7 @@ RSpec.describe "bundle init" do
end end
end end
context "when a gems.rb file exists in a parent directory", :bundler => ">= 2" do context "when a gems.rb file exists in a parent directory", :bundler => ">= 3" do
let(:subdir) { "child_dir" } let(:subdir) { "child_dir" }
it "lets users generate a Gemfile in a child directory" do it "lets users generate a Gemfile in a child directory" do
@ -99,7 +99,7 @@ RSpec.describe "bundle init" do
end end
end end
context "given --gemspec option", :bundler => "< 2" do context "given --gemspec option", :bundler => "< 3" do
let(:spec_file) { tmp.join("test.gemspec") } let(:spec_file) { tmp.join("test.gemspec") }
it "should generate from an existing gemspec" do it "should generate from an existing gemspec" do
@ -115,7 +115,7 @@ RSpec.describe "bundle init" do
bundle :init, :gemspec => spec_file bundle :init, :gemspec => spec_file
gemfile = if Bundler::VERSION[0, 2] == "1." gemfile = if Bundler::VERSION[0, 2].to_i < 3
bundled_app("Gemfile").read bundled_app("Gemfile").read
else else
bundled_app("gems.rb").read bundled_app("gems.rb").read
@ -146,7 +146,7 @@ RSpec.describe "bundle init" do
context "when init_gems_rb setting is enabled" do context "when init_gems_rb setting is enabled" do
before { bundle "config init_gems_rb true" } before { bundle "config init_gems_rb true" }
context "given --gemspec option", :bundler => "< 2" do context "given --gemspec option", :bundler => "< 3" do
let(:spec_file) { tmp.join("test.gemspec") } let(:spec_file) { tmp.join("test.gemspec") }
before do before do

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
RSpec.describe "bundle inject", :bundler => "< 2" do RSpec.describe "bundle inject", :bundler => "< 3" do
before :each do before :each do
gemfile <<-G gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"
@ -79,7 +79,7 @@ Usage: "bundle inject GEM VERSION"
context "when frozen" do context "when frozen" do
before do before do
bundle "install" bundle "install"
if Bundler.feature_flag.bundler_2_mode? if Bundler.feature_flag.bundler_3_mode?
bundle! "config --local deployment true" bundle! "config --local deployment true"
else else
bundle! "config --local frozen true" bundle! "config --local frozen true"

View file

@ -29,7 +29,7 @@ RSpec.describe "bundle install with gem sources" do
expect(bundled_app("Gemfile.lock")).to exist expect(bundled_app("Gemfile.lock")).to exist
end end
it "does not create ./.bundle by default", :bundler => "< 2" do it "does not create ./.bundle by default", :bundler => "< 3" do
gemfile <<-G gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"
gem "rack" gem "rack"
@ -275,14 +275,14 @@ RSpec.describe "bundle install with gem sources" do
expect(the_bundle).to include_gems "rack 1.0" expect(the_bundle).to include_gems "rack 1.0"
end end
it "allows running bundle install --system without deleting foo", :bundler => "< 2" do it "allows running bundle install --system without deleting foo", :bundler => "< 3" do
bundle "install", forgotten_command_line_options(:path => "vendor") bundle "install", forgotten_command_line_options(:path => "vendor")
bundle "install", forgotten_command_line_options(:system => true) bundle "install", forgotten_command_line_options(:system => true)
FileUtils.rm_rf(bundled_app("vendor")) FileUtils.rm_rf(bundled_app("vendor"))
expect(the_bundle).to include_gems "rack 1.0" expect(the_bundle).to include_gems "rack 1.0"
end end
it "allows running bundle install --system after deleting foo", :bundler => "< 2" do it "allows running bundle install --system after deleting foo", :bundler => "< 3" do
bundle "install", forgotten_command_line_options(:path => "vendor") bundle "install", forgotten_command_line_options(:path => "vendor")
FileUtils.rm_rf(bundled_app("vendor")) FileUtils.rm_rf(bundled_app("vendor"))
bundle "install", forgotten_command_line_options(:system => true) bundle "install", forgotten_command_line_options(:system => true)
@ -290,7 +290,7 @@ RSpec.describe "bundle install with gem sources" do
end end
end end
it "finds gems in multiple sources", :bundler => "< 2" do it "finds gems in multiple sources", :bundler => "< 3" do
build_repo2 build_repo2
update_repo2 update_repo2

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
RSpec.describe "bundle list", :bundler => "2" do RSpec.describe "bundle list", :bundler => "3" do
before do before do
install_gemfile <<-G install_gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"

View file

@ -407,7 +407,7 @@ RSpec.describe "bundle outdated" do
expect(out).to include("Installing foo 1.0") expect(out).to include("Installing foo 1.0")
end end
context "after bundle install --deployment", :bundler => "< 2" do context "after bundle install --deployment", :bundler => "< 3" do
before do before do
install_gemfile <<-G, forgotten_command_line_options(:deployment => true) install_gemfile <<-G, forgotten_command_line_options(:deployment => true)
source "file://#{gem_repo2}" source "file://#{gem_repo2}"

View file

@ -141,7 +141,7 @@ RSpec.describe "bundle package" do
end end
end end
context "with --path", :bundler => "< 2" do context "with --path", :bundler => "< 3" do
it "sets root directory for gems" do it "sets root directory for gems" do
gemfile <<-D gemfile <<-D
source "file://#{gem_repo1}" source "file://#{gem_repo1}"

View file

@ -49,7 +49,7 @@ RSpec.describe "bundle pristine", :ruby_repo do
bundle! "pristine", :system_bundler => true bundle! "pristine", :system_bundler => true
bundle! "-v", :system_bundler => true bundle! "-v", :system_bundler => true
expected = if Bundler::VERSION < "2.0" expected = if Bundler::VERSION < "3.0"
"Bundler version" "Bundler version"
else else
Bundler::VERSION Bundler::VERSION

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
RSpec.describe "bundle show", :bundler => "< 2", :ruby => ">= 2.0" do RSpec.describe "bundle show", :bundler => "< 3", :ruby => ">= 2.0" do
context "with a standard Gemfile" do context "with a standard Gemfile" do
before :each do before :each do
install_gemfile <<-G install_gemfile <<-G
@ -36,7 +36,7 @@ RSpec.describe "bundle show", :bundler => "< 2", :ruby => ">= 2.0" do
it "prints path if gem exists in bundle" do it "prints path if gem exists in bundle" do
bundle "show rails" bundle "show rails"
expect(out).to eq( expect(out).to eq(
"[DEPRECATED FOR 2.0] use `bundle info rails` instead of `bundle show rails`\n" + "[DEPRECATED FOR 3.0] use `bundle info rails` instead of `bundle show rails`\n" +
default_bundle_path("gems", "rails-2.3.2").to_s default_bundle_path("gems", "rails-2.3.2").to_s
) )
end end
@ -44,7 +44,7 @@ RSpec.describe "bundle show", :bundler => "< 2", :ruby => ">= 2.0" do
it "prints the path to the running bundler" do it "prints the path to the running bundler" do
bundle "show bundler" bundle "show bundler"
expect(out).to eq( expect(out).to eq(
"[DEPRECATED FOR 2.0] use `bundle info bundler` instead of `bundle show bundler`\n" + "[DEPRECATED FOR 3.0] use `bundle info bundler` instead of `bundle show bundler`\n" +
root.to_s root.to_s
) )
end end
@ -52,7 +52,7 @@ RSpec.describe "bundle show", :bundler => "< 2", :ruby => ">= 2.0" do
it "prints path if gem exists in bundle (with --paths option)" do it "prints path if gem exists in bundle (with --paths option)" do
bundle "show rails --paths" bundle "show rails --paths"
expect(out).to eq( expect(out).to eq(
"[DEPRECATED FOR 2.0] use `bundle info rails --path` instead of `bundle show rails --paths`\n" + "[DEPRECATED FOR 3.0] use `bundle info rails --path` instead of `bundle show rails --paths`\n" +
default_bundle_path("gems", "rails-2.3.2").to_s default_bundle_path("gems", "rails-2.3.2").to_s
) )
end end
@ -64,7 +64,7 @@ RSpec.describe "bundle show", :bundler => "< 2", :ruby => ">= 2.0" do
expect(out).to include(default_bundle_path("gems", "rails-2.3.2").to_s) expect(out).to include(default_bundle_path("gems", "rails-2.3.2").to_s)
out_lines = out.split("\n") out_lines = out.split("\n")
expect(out_lines[0]).to eq("[DEPRECATED FOR 2.0] use `bundle list` instead of `bundle show --paths`") expect(out_lines[0]).to eq("[DEPRECATED FOR 3.0] use `bundle list` instead of `bundle show --paths`")
# Gem names are the last component of their path. # Gem names are the last component of their path.
gem_list = out_lines[1..-1].map {|p| p.split("/").last } gem_list = out_lines[1..-1].map {|p| p.split("/").last }

View file

@ -11,7 +11,7 @@ RSpec.describe "bundle update" do
G G
end end
describe "with no arguments", :bundler => "< 2" do describe "with no arguments", :bundler => "< 3" do
it "updates the entire bundle" do it "updates the entire bundle" do
update_repo2 do update_repo2 do
build_gem "activesupport", "3.0" build_gem "activesupport", "3.0"
@ -34,7 +34,7 @@ RSpec.describe "bundle update" do
end end
end end
describe "with --all", :bundler => "2" do describe "with --all", :bundler => "3" do
it "updates the entire bundle" do it "updates the entire bundle" do
update_repo2 do update_repo2 do
build_gem "activesupport", "3.0" build_gem "activesupport", "3.0"
@ -279,7 +279,7 @@ RSpec.describe "bundle update" do
end end
describe "in a frozen bundle" do describe "in a frozen bundle" do
it "should fail loudly", :bundler => "< 2" do it "should fail loudly", :bundler => "< 3" do
bundle! "install --deployment" bundle! "install --deployment"
bundle "update", :all => bundle_update_requires_all? bundle "update", :all => bundle_update_requires_all?
@ -288,14 +288,14 @@ RSpec.describe "bundle update" do
expect(out).to match(/freeze \nby running `bundle install --no-deployment`./m) expect(out).to match(/freeze \nby running `bundle install --no-deployment`./m)
end end
it "should suggest different command when frozen is set globally", :bundler => "< 2" do it "should suggest different command when frozen is set globally", :bundler => "< 3" do
bundle! "config --global frozen 1" bundle! "config --global frozen 1"
bundle "update", :all => bundle_update_requires_all? bundle "update", :all => bundle_update_requires_all?
expect(out).to match(/You are trying to install in deployment mode after changing.your Gemfile/m). expect(out).to match(/You are trying to install in deployment mode after changing.your Gemfile/m).
and match(/freeze \nby running `bundle config --delete frozen`./m) and match(/freeze \nby running `bundle config --delete frozen`./m)
end end
it "should suggest different command when frozen is set globally", :bundler => "2" do it "should suggest different command when frozen is set globally", :bundler => "3" do
bundle! "config --global deployment true" bundle! "config --global deployment true"
bundle "update", :all => bundle_update_requires_all? bundle "update", :all => bundle_update_requires_all?
expect(out).to match(/You are trying to install in deployment mode after changing.your Gemfile/m). expect(out).to match(/You are trying to install in deployment mode after changing.your Gemfile/m).
@ -304,7 +304,7 @@ RSpec.describe "bundle update" do
end end
describe "with --source option" do describe "with --source option" do
it "should not update gems not included in the source that happen to have the same name", :bundler => "< 2" do it "should not update gems not included in the source that happen to have the same name", :bundler => "< 3" do
install_gemfile! <<-G install_gemfile! <<-G
source "file://#{gem_repo2}" source "file://#{gem_repo2}"
gem "activesupport" gem "activesupport"
@ -315,7 +315,7 @@ RSpec.describe "bundle update" do
expect(the_bundle).to include_gem "activesupport 3.0" expect(the_bundle).to include_gem "activesupport 3.0"
end end
it "should not update gems not included in the source that happen to have the same name", :bundler => "2" do it "should not update gems not included in the source that happen to have the same name", :bundler => "3" do
install_gemfile! <<-G install_gemfile! <<-G
source "file://#{gem_repo2}" source "file://#{gem_repo2}"
gem "activesupport" gem "activesupport"
@ -358,7 +358,7 @@ RSpec.describe "bundle update" do
G G
end end
it "should not update the child dependencies of a gem that has the same name as the source", :bundler => "< 2" do it "should not update the child dependencies of a gem that has the same name as the source", :bundler => "< 3" do
update_repo2 do update_repo2 do
build_gem "fred", "2.0" build_gem "fred", "2.0"
build_gem "harry", "2.0" do |s| build_gem "harry", "2.0" do |s|
@ -371,7 +371,7 @@ RSpec.describe "bundle update" do
expect(the_bundle).to include_gems "fred 1.0" expect(the_bundle).to include_gems "fred 1.0"
end end
it "should not update the child dependencies of a gem that has the same name as the source", :bundler => "2" do it "should not update the child dependencies of a gem that has the same name as the source", :bundler => "3" do
update_repo2 do update_repo2 do
build_gem "fred", "2.0" build_gem "fred", "2.0"
build_gem "harry", "2.0" do |s| build_gem "harry", "2.0" do |s|
@ -403,7 +403,7 @@ RSpec.describe "bundle update" do
G G
end end
it "should not update the child dependencies of a gem that has the same name as the source", :bundler => "< 2" do it "should not update the child dependencies of a gem that has the same name as the source", :bundler => "< 3" do
update_repo2 do update_repo2 do
build_gem "george", "2.0" build_gem "george", "2.0"
build_gem "harry", "2.0" do |s| build_gem "harry", "2.0" do |s|
@ -417,7 +417,7 @@ RSpec.describe "bundle update" do
expect(the_bundle).to include_gems "george 1.0" expect(the_bundle).to include_gems "george 1.0"
end end
it "should not update the child dependencies of a gem that has the same name as the source", :bundler => "2" do it "should not update the child dependencies of a gem that has the same name as the source", :bundler => "3" do
update_repo2 do update_repo2 do
build_gem "george", "2.0" build_gem "george", "2.0"
build_gem "harry", "2.0" do |s| build_gem "harry", "2.0" do |s|
@ -561,14 +561,14 @@ RSpec.describe "bundle update when a gem depends on a newer version of bundler"
G G
end end
it "should explain that bundler conflicted", :bundler => "< 2" do it "should explain that bundler conflicted", :bundler => "< 3" do
bundle "update", :all => bundle_update_requires_all? bundle "update", :all => bundle_update_requires_all?
expect(last_command.stdboth).not_to match(/in snapshot/i) expect(last_command.stdboth).not_to match(/in snapshot/i)
expect(last_command.bundler_err).to match(/current Bundler version/i). expect(last_command.bundler_err).to match(/current Bundler version/i).
and match(/perhaps you need to update bundler/i) and match(/perhaps you need to update bundler/i)
end end
it "should warn that the newer version of Bundler would conflict", :bundler => "2" do it "should warn that the newer version of Bundler would conflict", :bundler => "3" do
bundle! "update", :all => true bundle! "update", :all => true
expect(last_command.bundler_err).to include("rails (3.0.1) has dependency bundler"). expect(last_command.bundler_err).to include("rails (3.0.1) has dependency bundler").
and include("so the dependency is being ignored") and include("so the dependency is being ignored")
@ -577,7 +577,7 @@ RSpec.describe "bundle update when a gem depends on a newer version of bundler"
end end
RSpec.describe "bundle update" do RSpec.describe "bundle update" do
it "shows the previous version of the gem when updated from rubygems source", :bundler => "< 2" do it "shows the previous version of the gem when updated from rubygems source", :bundler => "< 3" do
build_repo2 build_repo2
install_gemfile <<-G install_gemfile <<-G

View file

@ -2,36 +2,36 @@
RSpec.describe "bundle version" do RSpec.describe "bundle version" do
context "with -v" do context "with -v" do
it "outputs the version", :bundler => "< 2" do it "outputs the version", :bundler => "< 3" do
bundle! "-v" bundle! "-v"
expect(out).to eq("Bundler version #{Bundler::VERSION}") expect(out).to eq("Bundler version #{Bundler::VERSION}")
end end
it "outputs the version", :bundler => "2" do it "outputs the version", :bundler => "3" do
bundle! "-v" bundle! "-v"
expect(out).to eq(Bundler::VERSION) expect(out).to eq(Bundler::VERSION)
end end
end end
context "with --version" do context "with --version" do
it "outputs the version", :bundler => "< 2" do it "outputs the version", :bundler => "< 3" do
bundle! "--version" bundle! "--version"
expect(out).to eq("Bundler version #{Bundler::VERSION}") expect(out).to eq("Bundler version #{Bundler::VERSION}")
end end
it "outputs the version", :bundler => "2" do it "outputs the version", :bundler => "3" do
bundle! "--version" bundle! "--version"
expect(out).to eq(Bundler::VERSION) expect(out).to eq(Bundler::VERSION)
end end
end end
context "with version" do context "with version" do
it "outputs the version with build metadata", :bundler => "< 2" do it "outputs the version with build metadata", :bundler => "< 3" do
bundle! "version" bundle! "version"
expect(out).to match(/\ABundler version #{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit [a-fA-F0-9]{7,}\)\z/) expect(out).to match(/\ABundler version #{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit [a-fA-F0-9]{7,}\)\z/)
end end
it "outputs the version with build metadata", :bundler => "2" do it "outputs the version with build metadata", :bundler => "3" do
bundle! "version" bundle! "version"
expect(out).to match(/\A#{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit [a-fA-F0-9]{7,}\)\z/) expect(out).to match(/\A#{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit [a-fA-F0-9]{7,}\)\z/)
end end

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
RSpec.describe "bundle viz", :ruby => "1.9.3", :bundler => "< 2", :if => Bundler.which("dot") do RSpec.describe "bundle viz", :ruby => "1.9.3", :bundler => "< 3", :if => Bundler.which("dot") do
let(:ruby_graphviz) do let(:ruby_graphviz) do
graphviz_glob = base_system_gems.join("cache/ruby-graphviz*") graphviz_glob = base_system_gems.join("cache/ruby-graphviz*")
Pathname.glob(graphviz_glob).first Pathname.glob(graphviz_glob).first

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
RSpec.describe "bundle install", :bundler => "< 2" do RSpec.describe "bundle install", :bundler => "< 3" do
describe "when system_bindir is set" do describe "when system_bindir is set" do
# On OS X, Gem.bindir defaults to /usr/bin, so system_bindir is useful if # On OS X, Gem.bindir defaults to /usr/bin, so system_bindir is useful if
# you want to avoid sudo installs for system gems with OS X's default ruby # you want to avoid sudo installs for system gems with OS X's default ruby
@ -20,7 +20,7 @@ RSpec.describe "bundle install", :bundler => "< 2" do
end end
end end
describe "when multiple gems contain the same exe", :bundler => "< 2" do describe "when multiple gems contain the same exe", :bundler => "< 3" do
before do before do
build_repo2 do build_repo2 do
build_gem "fake", "14" do |s| build_gem "fake", "14" do |s|

View file

@ -8,7 +8,7 @@ RSpec.describe "install with --deployment or --frozen" do
G G
end end
context "with CLI flags", :bundler => "< 2" do context "with CLI flags", :bundler => "< 3" do
it "fails without a lockfile and says that --deployment requires a lock" do it "fails without a lockfile and says that --deployment requires a lock" do
bundle "install --deployment" bundle "install --deployment"
expect(out).to include("The --deployment flag requires a Gemfile.lock") expect(out).to include("The --deployment flag requires a Gemfile.lock")
@ -109,11 +109,11 @@ RSpec.describe "install with --deployment or --frozen" do
bundle "install" bundle "install"
end end
it "works with the --deployment flag if you didn't change anything", :bundler => "< 2" do it "works with the --deployment flag if you didn't change anything", :bundler => "< 3" do
bundle! "install --deployment" bundle! "install --deployment"
end end
it "works with the --frozen flag if you didn't change anything", :bundler => "< 2" do it "works with the --frozen flag if you didn't change anything", :bundler => "< 3" do
bundle! "install --frozen" bundle! "install --frozen"
end end
@ -165,7 +165,7 @@ RSpec.describe "install with --deployment or --frozen" do
expect(out).to include("The path `#{lib_path("path_gem-1.0")}` does not exist.") expect(out).to include("The path `#{lib_path("path_gem-1.0")}` does not exist.")
end end
it "can have --frozen set via an environment variable", :bundler => "< 2" do it "can have --frozen set via an environment variable", :bundler => "< 3" do
gemfile <<-G gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"
gem "rack" gem "rack"
@ -297,7 +297,7 @@ RSpec.describe "install with --deployment or --frozen" do
context "when replacing a host with the same host with credentials" do context "when replacing a host with the same host with credentials" do
let(:success_message) do let(:success_message) do
if Bundler::VERSION.split(".", 2).first == "1" if Bundler.bundler_major_version < 3
"Could not reach host localgemserver.test" "Could not reach host localgemserver.test"
else else
"Bundle complete!" "Bundle complete!"

View file

@ -433,7 +433,7 @@ RSpec.describe "bundle install from an existing gemspec" do
end end
end end
context "on ruby", :bundler => "< 2" do context "on ruby", :bundler => "< 3" do
before do before do
simulate_platform("ruby") simulate_platform("ruby")
bundle :install bundle :install
@ -534,7 +534,7 @@ RSpec.describe "bundle install from an existing gemspec" do
end end
end end
context "on ruby", :bundler => "2" do context "on ruby", :bundler => "3" do
before do before do
simulate_platform("ruby") simulate_platform("ruby")
bundle :install bundle :install

View file

@ -26,7 +26,7 @@ RSpec.describe "bundle install with git sources" do
expect(out).to eq("WIN") expect(out).to eq("WIN")
end end
it "caches the git repo", :bundler => "< 2" do it "caches the git repo", :bundler => "< 3" do
expect(Dir["#{default_bundle_path}/cache/bundler/git/foo-1.0-*"]).to have_attributes :size => 1 expect(Dir["#{default_bundle_path}/cache/bundler/git/foo-1.0-*"]).to have_attributes :size => 1
end end

View file

@ -192,19 +192,19 @@ RSpec.describe "bundle install with groups" do
expect(the_bundle).not_to include_gems "thin 1.0" expect(the_bundle).not_to include_gems "thin 1.0"
end end
it "does remove groups from without when passed at --with", :bundler => "< 2" do it "does remove groups from without when passed at --with", :bundler => "< 3" do
bundle :install, forgotten_command_line_options(:without => "emo") bundle :install, forgotten_command_line_options(:without => "emo")
bundle :install, forgotten_command_line_options(:with => "emo") bundle :install, forgotten_command_line_options(:with => "emo")
expect(the_bundle).to include_gems "activesupport 2.3.5" expect(the_bundle).to include_gems "activesupport 2.3.5"
end end
it "does remove groups from with when passed at --without", :bundler => "< 2" do it "does remove groups from with when passed at --without", :bundler => "< 3" do
bundle :install, forgotten_command_line_options(:with => "debugging") bundle :install, forgotten_command_line_options(:with => "debugging")
bundle :install, forgotten_command_line_options(:without => "debugging") bundle :install, forgotten_command_line_options(:without => "debugging")
expect(the_bundle).not_to include_gem "thin 1.0" expect(the_bundle).not_to include_gem "thin 1.0"
end end
it "errors out when passing a group to with and without via CLI flags", :bundler => "< 2" do it "errors out when passing a group to with and without via CLI flags", :bundler => "< 3" do
bundle :install, forgotten_command_line_options(:with => "emo debugging", :without => "emo") bundle :install, forgotten_command_line_options(:with => "emo debugging", :without => "emo")
expect(last_command).to be_failure expect(last_command).to be_failure
expect(out).to include("The offending groups are: emo") expect(out).to include("The offending groups are: emo")

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
RSpec.describe "bundle install with explicit source paths" do RSpec.describe "bundle install with explicit source paths" do
it "fetches gems with a global path source", :bundler => "< 2" do it "fetches gems with a global path source", :bundler => "< 3" do
build_lib "foo" build_lib "foo"
install_gemfile <<-G install_gemfile <<-G

View file

@ -230,7 +230,7 @@ RSpec.describe "bundle install across platforms" do
expect(the_bundle).to include_gems "nokogiri 1.4.2 JAVA", "weakling 0.0.3" expect(the_bundle).to include_gems "nokogiri 1.4.2 JAVA", "weakling 0.0.3"
end end
it "works with gems that have extra platform-specific runtime dependencies", :bundler => "< 2" do it "works with gems that have extra platform-specific runtime dependencies", :bundler => "< 3" do
simulate_platform x64_mac simulate_platform x64_mac
update_repo2 do update_repo2 do

View file

@ -28,7 +28,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
bundle "config major_deprecations true" bundle "config major_deprecations true"
end end
it "warns about ambiguous gems, but installs anyway, prioritizing sources last to first", :bundler => "< 2" do it "warns about ambiguous gems, but installs anyway, prioritizing sources last to first", :bundler => "< 3" do
bundle :install bundle :install
expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.") expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.")
@ -58,7 +58,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
bundle "config major_deprecations true" bundle "config major_deprecations true"
end end
it "warns about ambiguous gems, but installs anyway", :bundler => "< 2" do it "warns about ambiguous gems, but installs anyway", :bundler => "< 3" do
bundle :install bundle :install
expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.") expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.")
@ -248,7 +248,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
G G
end end
it "installs from the other source and warns about ambiguous gems", :bundler => "< 2" do it "installs from the other source and warns about ambiguous gems", :bundler => "< 3" do
bundle "config major_deprecations true" bundle "config major_deprecations true"
bundle :install bundle :install
expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.") expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.")
@ -276,7 +276,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
G G
end end
it "installs the dependency from the pinned source without warning", :bundler => "< 2" do it "installs the dependency from the pinned source without warning", :bundler => "< 3" do
bundle :install bundle :install
expect(out).not_to include("Warning: the gem 'rack' was found in multiple sources.") expect(out).not_to include("Warning: the gem 'rack' was found in multiple sources.")

View file

@ -269,7 +269,7 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(last_command.stdboth).not_to include "Double checking" expect(last_command.stdboth).not_to include "Double checking"
end end
it "fetches again when more dependencies are found in subsequent sources", :bundler => "< 2" do it "fetches again when more dependencies are found in subsequent sources", :bundler => "< 3" do
build_repo2 do build_repo2 do
build_gem "back_deps" do |s| build_gem "back_deps" do |s|
s.add_dependency "foo" s.add_dependency "foo"
@ -328,7 +328,7 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(the_bundle).to include_gems "rack 1.2" expect(the_bundle).to include_gems "rack 1.2"
end end
it "considers all possible versions of dependencies from all api gem sources", :bundler => "< 2" do it "considers all possible versions of dependencies from all api gem sources", :bundler => "< 3" do
# In this scenario, the gem "somegem" only exists in repo4. It depends on specific version of activesupport that # In this scenario, the gem "somegem" only exists in repo4. It depends on specific version of activesupport that
# exists only in repo1. There happens also be a version of activesupport in repo4, but not the one that version 1.0.0 # exists only in repo1. There happens also be a version of activesupport in repo4, but not the one that version 1.0.0
# of somegem wants. This test makes sure that bundler actually finds version 1.2.3 of active support in the other # of somegem wants. This test makes sure that bundler actually finds version 1.2.3 of active support in the other
@ -352,7 +352,7 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(the_bundle).to include_gems "activesupport 1.2.3" expect(the_bundle).to include_gems "activesupport 1.2.3"
end end
it "considers all possible versions of dependencies from all api gem sources when using blocks", :bundler => "< 2" do it "considers all possible versions of dependencies from all api gem sources when using blocks", :bundler => "< 3" do
# In this scenario, the gem "somegem" only exists in repo4. It depends on specific version of activesupport that # In this scenario, the gem "somegem" only exists in repo4. It depends on specific version of activesupport that
# exists only in repo1. There happens also be a version of activesupport in repo4, but not the one that version 1.0.0 # exists only in repo1. There happens also be a version of activesupport in repo4, but not the one that version 1.0.0
# of somegem wants. This test makes sure that bundler actually finds version 1.2.3 of active support in the other # of somegem wants. This test makes sure that bundler actually finds version 1.2.3 of active support in the other
@ -458,7 +458,7 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(the_bundle).to include_gems "foo 1.0" expect(the_bundle).to include_gems "foo 1.0"
end end
it "fetches again when more dependencies are found in subsequent sources using --deployment", :bundler => "< 2" do it "fetches again when more dependencies are found in subsequent sources using --deployment", :bundler => "< 3" do
build_repo2 do build_repo2 do
build_gem "back_deps" do |s| build_gem "back_deps" do |s|
s.add_dependency "foo" s.add_dependency "foo"
@ -522,7 +522,7 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(the_bundle).to include_gems "rails 2.3.2" expect(the_bundle).to include_gems "rails 2.3.2"
end end
it "installs the binstubs", :bundler => "< 2" do it "installs the binstubs", :bundler => "< 3" do
gemfile <<-G gemfile <<-G
source "#{source_uri}" source "#{source_uri}"
gem "rack" gem "rack"
@ -534,7 +534,7 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(out).to eq("1.0.0") expect(out).to eq("1.0.0")
end end
it "installs the bins when using --path and uses autoclean", :bundler => "< 2" do it "installs the bins when using --path and uses autoclean", :bundler => "< 3" do
gemfile <<-G gemfile <<-G
source "#{source_uri}" source "#{source_uri}"
gem "rack" gem "rack"
@ -545,7 +545,7 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(vendored_gems("bin/rackup")).to exist expect(vendored_gems("bin/rackup")).to exist
end end
it "installs the bins when using --path and uses bundle clean", :bundler => "< 2" do it "installs the bins when using --path and uses bundle clean", :bundler => "< 3" do
gemfile <<-G gemfile <<-G
source "#{source_uri}" source "#{source_uri}"
gem "rack" gem "rack"
@ -620,7 +620,7 @@ The checksum of /versions does not match the checksum provided by the server! So
expect(out).not_to include("#{user}:#{password}") expect(out).not_to include("#{user}:#{password}")
end end
it "strips http basic auth creds when warning about ambiguous sources", :bundler => "< 2" do it "strips http basic auth creds when warning about ambiguous sources", :bundler => "< 3" do
gemfile <<-G gemfile <<-G
source "#{basic_auth_source_uri}" source "#{basic_auth_source_uri}"
source "file://#{gem_repo1}" source "file://#{gem_repo1}"

View file

@ -243,7 +243,7 @@ RSpec.describe "gemcutter's dependency API" do
end end
end end
it "fetches again when more dependencies are found in subsequent sources", :bundler => "< 2" do it "fetches again when more dependencies are found in subsequent sources", :bundler => "< 3" do
build_repo2 do build_repo2 do
build_gem "back_deps" do |s| build_gem "back_deps" do |s|
s.add_dependency "foo" s.add_dependency "foo"
@ -302,7 +302,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(the_bundle).to include_gems "rack 1.2" expect(the_bundle).to include_gems "rack 1.2"
end end
it "considers all possible versions of dependencies from all api gem sources", :bundler => "< 2" do it "considers all possible versions of dependencies from all api gem sources", :bundler => "< 3" do
# In this scenario, the gem "somegem" only exists in repo4. It depends on specific version of activesupport that # In this scenario, the gem "somegem" only exists in repo4. It depends on specific version of activesupport that
# exists only in repo1. There happens also be a version of activesupport in repo4, but not the one that version 1.0.0 # exists only in repo1. There happens also be a version of activesupport in repo4, but not the one that version 1.0.0
# of somegem wants. This test makes sure that bundler actually finds version 1.2.3 of active support in the other # of somegem wants. This test makes sure that bundler actually finds version 1.2.3 of active support in the other
@ -372,7 +372,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(out).to include("Fetching source index from http://localgemserver.test/extra") expect(out).to include("Fetching source index from http://localgemserver.test/extra")
end end
it "does not fetch every spec if the index of gems is large when doing back deps", :bundler => "< 2" do it "does not fetch every spec if the index of gems is large when doing back deps", :bundler => "< 3" do
build_repo2 do build_repo2 do
build_gem "back_deps" do |s| build_gem "back_deps" do |s|
s.add_dependency "foo" s.add_dependency "foo"
@ -432,7 +432,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(the_bundle).to include_gems "foo 1.0" expect(the_bundle).to include_gems "foo 1.0"
end end
it "fetches again when more dependencies are found in subsequent sources using --deployment", :bundler => "< 2" do it "fetches again when more dependencies are found in subsequent sources using --deployment", :bundler => "< 3" do
build_repo2 do build_repo2 do
build_gem "back_deps" do |s| build_gem "back_deps" do |s|
s.add_dependency "foo" s.add_dependency "foo"
@ -496,7 +496,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(the_bundle).to include_gems "rails 2.3.2" expect(the_bundle).to include_gems "rails 2.3.2"
end end
it "installs the binstubs", :bundler => "< 2" do it "installs the binstubs", :bundler => "< 3" do
gemfile <<-G gemfile <<-G
source "#{source_uri}" source "#{source_uri}"
gem "rack" gem "rack"
@ -508,7 +508,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(out).to eq("1.0.0") expect(out).to eq("1.0.0")
end end
it "installs the bins when using --path and uses autoclean", :bundler => "< 2" do it "installs the bins when using --path and uses autoclean", :bundler => "< 3" do
gemfile <<-G gemfile <<-G
source "#{source_uri}" source "#{source_uri}"
gem "rack" gem "rack"
@ -519,7 +519,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(vendored_gems("bin/rackup")).to exist expect(vendored_gems("bin/rackup")).to exist
end end
it "installs the bins when using --path and uses bundle clean", :bundler => "< 2" do it "installs the bins when using --path and uses bundle clean", :bundler => "< 3" do
gemfile <<-G gemfile <<-G
source "#{source_uri}" source "#{source_uri}"
gem "rack" gem "rack"
@ -594,7 +594,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(out).not_to include("#{user}:#{password}") expect(out).not_to include("#{user}:#{password}")
end end
it "strips http basic auth creds when warning about ambiguous sources", :bundler => "< 2" do it "strips http basic auth creds when warning about ambiguous sources", :bundler => "< 3" do
gemfile <<-G gemfile <<-G
source "#{basic_auth_source_uri}" source "#{basic_auth_source_uri}"
source "file://#{gem_repo1}" source "file://#{gem_repo1}"

View file

@ -244,7 +244,7 @@ RSpec.describe "bundle flex_install" do
end end
describe "when adding a new source" do describe "when adding a new source" do
it "updates the lockfile", :bundler => "< 2" do it "updates the lockfile", :bundler => "< 3" do
build_repo2 build_repo2
install_gemfile! <<-G install_gemfile! <<-G
source "file://localhost#{gem_repo1}" source "file://localhost#{gem_repo1}"
@ -274,7 +274,7 @@ RSpec.describe "bundle flex_install" do
L L
end end
it "updates the lockfile", :bundler => "2" do it "updates the lockfile", :bundler => "3" do
build_repo2 build_repo2
install_gemfile! <<-G install_gemfile! <<-G
source "file://localhost#{gem_repo1}" source "file://localhost#{gem_repo1}"

View file

@ -197,7 +197,7 @@ RSpec.shared_examples "bundle install --standalone" do
expect(last_command.stderr).to eq("ZOMG LOAD ERROR") expect(last_command.stderr).to eq("ZOMG LOAD ERROR")
end end
it "allows --path to change the location of the standalone bundle", :bundler => "< 2" do it "allows --path to change the location of the standalone bundle", :bundler => "< 3" do
bundle! "install", forgotten_command_line_options(:path => "path/to/bundle").merge(:standalone => true) bundle! "install", forgotten_command_line_options(:path => "path/to/bundle").merge(:standalone => true)
Dir.chdir(bundled_app) do Dir.chdir(bundled_app) do
@ -213,7 +213,7 @@ RSpec.shared_examples "bundle install --standalone" do
expect(last_command.stdout).to eq("2.3.2") expect(last_command.stdout).to eq("2.3.2")
end end
it "allows --path to change the location of the standalone bundle", :bundler => "2" do it "allows --path to change the location of the standalone bundle", :bundler => "3" do
bundle! "install", forgotten_command_line_options(:path => "path/to/bundle").merge(:standalone => true) bundle! "install", forgotten_command_line_options(:path => "path/to/bundle").merge(:standalone => true)
path = File.expand_path("path/to/bundle") path = File.expand_path("path/to/bundle")
@ -273,7 +273,7 @@ RSpec.shared_examples "bundle install --standalone" do
end end
end end
describe "with --binstubs", :bundler => "< 2" do describe "with --binstubs", :bundler => "< 3" do
before do before do
gemfile <<-G gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"

View file

@ -2,7 +2,7 @@
RSpec.describe "bundle install" do RSpec.describe "bundle install" do
context "git sources" do context "git sources" do
it "displays the revision hash of the gem repository", :bundler => "< 2" do it "displays the revision hash of the gem repository", :bundler => "< 3" do
build_git "foo", "1.0", :path => lib_path("foo") build_git "foo", "1.0", :path => lib_path("foo")
install_gemfile <<-G install_gemfile <<-G
@ -14,7 +14,7 @@ RSpec.describe "bundle install" do
expect(the_bundle).to include_gems "foo 1.0", :source => "git@#{lib_path("foo")}" expect(the_bundle).to include_gems "foo 1.0", :source => "git@#{lib_path("foo")}"
end end
it "displays the ref of the gem repository when using branch~num as a ref", :bundler => "< 2" do it "displays the ref of the gem repository when using branch~num as a ref", :bundler => "< 3" do
build_git "foo", "1.0", :path => lib_path("foo") build_git "foo", "1.0", :path => lib_path("foo")
rev = revision_for(lib_path("foo"))[0..6] rev = revision_for(lib_path("foo"))[0..6]
update_git "foo", "2.0", :path => lib_path("foo"), :gemspec => true update_git "foo", "2.0", :path => lib_path("foo"), :gemspec => true

View file

@ -13,7 +13,7 @@ RSpec.describe "bundle install" do
G G
end end
it "does not use available system gems with bundle --path vendor/bundle", :bundler => "< 2" do it "does not use available system gems with bundle --path vendor/bundle", :bundler => "< 3" do
bundle! :install, forgotten_command_line_options(:path => "vendor/bundle") bundle! :install, forgotten_command_line_options(:path => "vendor/bundle")
expect(the_bundle).to include_gems "rack 1.0.0" expect(the_bundle).to include_gems "rack 1.0.0"
end end
@ -35,13 +35,13 @@ RSpec.describe "bundle install" do
expect(out).to include("gems are installed into `./vendor/bundle`") expect(out).to include("gems are installed into `./vendor/bundle`")
end end
it "disallows --path vendor/bundle --system", :bundler => "< 2" do it "disallows --path vendor/bundle --system", :bundler => "< 3" do
bundle "install --path vendor/bundle --system" bundle "install --path vendor/bundle --system"
expect(out).to include("Please choose only one option.") expect(out).to include("Please choose only one option.")
expect(exitstatus).to eq(15) if exitstatus expect(exitstatus).to eq(15) if exitstatus
end end
it "remembers to disable system gems after the first time with bundle --path vendor/bundle", :bundler => "< 2" do it "remembers to disable system gems after the first time with bundle --path vendor/bundle", :bundler => "< 3" do
bundle "install --path vendor/bundle" bundle "install --path vendor/bundle"
FileUtils.rm_rf bundled_app("vendor") FileUtils.rm_rf bundled_app("vendor")
bundle "install" bundle "install"
@ -53,7 +53,7 @@ RSpec.describe "bundle install" do
context "with path_relative_to_cwd set to true" do context "with path_relative_to_cwd set to true" do
before { bundle! "config path_relative_to_cwd true" } before { bundle! "config path_relative_to_cwd true" }
it "installs the bundle relatively to current working directory", :bundler => "< 2" do it "installs the bundle relatively to current working directory", :bundler => "< 3" do
Dir.chdir(bundled_app.parent) do Dir.chdir(bundled_app.parent) do
bundle! "install --gemfile='#{bundled_app}/Gemfile' --path vendor/bundle" bundle! "install --gemfile='#{bundled_app}/Gemfile' --path vendor/bundle"
expect(out).to include("installed into `./vendor/bundle`") expect(out).to include("installed into `./vendor/bundle`")
@ -113,7 +113,7 @@ RSpec.describe "bundle install" do
expect(the_bundle).to include_gems "rack 1.0.0" expect(the_bundle).to include_gems "rack 1.0.0"
end end
context "with global_path_appends_ruby_scope set", :bundler => "2" do context "with global_path_appends_ruby_scope set", :bundler => "3" do
it "installs gems to ." do it "installs gems to ." do
set_bundle_path(type, ".") set_bundle_path(type, ".")
bundle! "config --global disable_shared_gems true" bundle! "config --global disable_shared_gems true"
@ -147,7 +147,7 @@ RSpec.describe "bundle install" do
end end
end end
context "with global_path_appends_ruby_scope unset", :bundler => "< 2" do context "with global_path_appends_ruby_scope unset", :bundler => "< 3" do
it "installs gems to ." do it "installs gems to ." do
set_bundle_path(type, ".") set_bundle_path(type, ".")
bundle! "config --global disable_shared_gems true" bundle! "config --global disable_shared_gems true"

View file

@ -19,7 +19,7 @@ RSpec.describe "post bundle message" do
let(:bundle_complete_message) { "Bundle complete!" } let(:bundle_complete_message) { "Bundle complete!" }
let(:bundle_updated_message) { "Bundle updated!" } let(:bundle_updated_message) { "Bundle updated!" }
let(:installed_gems_stats) { "4 Gemfile dependencies, 5 gems now installed." } let(:installed_gems_stats) { "4 Gemfile dependencies, 5 gems now installed." }
let(:bundle_show_message) { Bundler::VERSION.split(".").first.to_i < 2 ? bundle_show_system_message : bundle_show_path_message } let(:bundle_show_message) { Bundler::VERSION.split(".").first.to_i < 3 ? bundle_show_system_message : bundle_show_path_message }
describe "for fresh bundle install" do describe "for fresh bundle install" do
it "without any options" do it "without any options" do
@ -101,7 +101,7 @@ RSpec.describe "post bundle message" do
end end
describe "with misspelled or non-existent gem name" do describe "with misspelled or non-existent gem name" do
it "should report a helpful error message", :bundler => "< 2" do it "should report a helpful error message", :bundler => "< 3" do
install_gemfile <<-G install_gemfile <<-G
source "file://localhost#{gem_repo1}" source "file://localhost#{gem_repo1}"
gem "rack" gem "rack"
@ -110,7 +110,7 @@ RSpec.describe "post bundle message" do
expect(out).to include("Could not find gem 'not-a-gem' in any of the gem sources listed in your Gemfile.") expect(out).to include("Could not find gem 'not-a-gem' in any of the gem sources listed in your Gemfile.")
end end
it "should report a helpful error message", :bundler => "2" do it "should report a helpful error message", :bundler => "3" do
install_gemfile <<-G install_gemfile <<-G
source "file://localhost#{gem_repo1}" source "file://localhost#{gem_repo1}"
gem "rack" gem "rack"

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
RSpec.describe "bundle install", :bundler => "< 2", :ruby => ">= 2.0" do RSpec.describe "bundle install", :bundler => "< 3", :ruby => ">= 2.0" do
before :each do before :each do
gemfile <<-G gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"
@ -65,12 +65,12 @@ RSpec.describe "bundle install", :bundler => "< 2", :ruby => ">= 2.0" do
it "shows a deprecation when single flag passed" do it "shows a deprecation when single flag passed" do
bundle! "install --force" bundle! "install --force"
expect(out).to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" expect(out).to include "[DEPRECATED FOR 3.0] The `--force` option has been renamed to `--redownload`"
end end
it "shows a deprecation when multiple flags passed" do it "shows a deprecation when multiple flags passed" do
bundle! "install --no-color --force" bundle! "install --no-color --force"
expect(out).to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" expect(out).to include "[DEPRECATED FOR 3.0] The `--force` option has been renamed to `--redownload`"
end end
end end

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
RSpec.describe "the lockfile format", :bundler => "< 2" do RSpec.describe "the lockfile format", :bundler => "< 3" do
include Bundler::GemHelpers include Bundler::GemHelpers
before { ENV["BUNDLER_SPEC_IGNORE_COMPATIBILITY_GUARD"] = "TRUE" } before { ENV["BUNDLER_SPEC_IGNORE_COMPATIBILITY_GUARD"] = "TRUE" }
@ -78,7 +78,7 @@ RSpec.describe "the lockfile format", :bundler => "< 2" do
it "does not update the lockfile's bundler version if nothing changed during bundle install", :ruby_repo do it "does not update the lockfile's bundler version if nothing changed during bundle install", :ruby_repo do
version = "#{Bundler::VERSION.split(".").first}.0.0.0.a" version = "#{Bundler::VERSION.split(".").first}.0.0.0.a"
lockfile <<-L lockfile normalize_uri_file(<<-L)
GEM GEM
remote: file://localhost#{gem_repo1}/ remote: file://localhost#{gem_repo1}/
specs: specs:
@ -94,13 +94,13 @@ RSpec.describe "the lockfile format", :bundler => "< 2" do
#{version} #{version}
L L
install_gemfile <<-G install_gemfile normalize_uri_file(<<-G)
source "file://localhost#{gem_repo1}" source "file://localhost#{gem_repo1}"
gem "rack" gem "rack"
G G
lockfile_should_be <<-G lockfile_should_be normalize_uri_file(<<-G)
GEM GEM
remote: file://localhost#{gem_repo1}/ remote: file://localhost#{gem_repo1}/
specs: specs:

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
RSpec.describe "the lockfile format", :bundler => "2" do RSpec.describe "the lockfile format", :bundler => "3" do
include Bundler::GemHelpers include Bundler::GemHelpers
before { ENV["BUNDLER_SPEC_IGNORE_COMPATIBILITY_GUARD"] = "TRUE" } before { ENV["BUNDLER_SPEC_IGNORE_COMPATIBILITY_GUARD"] = "TRUE" }
@ -428,7 +428,7 @@ RSpec.describe "the lockfile format", :bundler => "2" do
expect(the_bundle).to include_gems "net-sftp 1.1.1", "net-ssh 1.0.0" expect(the_bundle).to include_gems "net-sftp 1.1.1", "net-ssh 1.0.0"
end end
it "generates a simple lockfile for a single pinned source, gem with a version requirement", :bundler => "< 2" do it "generates a simple lockfile for a single pinned source, gem with a version requirement", :bundler => "< 3" do
git = build_git "foo" git = build_git "foo"
install_gemfile <<-G install_gemfile <<-G

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
RSpec.describe "bundle_ruby", :bundler => "< 2" do RSpec.describe "bundle_ruby", :bundler => "< 3" do
context "without patchlevel" do context "without patchlevel" do
it "returns the ruby version" do it "returns the ruby version" do
gemfile <<-G gemfile <<-G

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
RSpec.describe "major deprecations", :bundler => "< 2" do RSpec.describe "major deprecations", :bundler => "< 3" do
let(:warnings) { last_command.bundler_err } # change to err in 2.0 let(:warnings) { last_command.bundler_err } # change to err in 2.0
let(:warnings_without_version_messages) { warnings.gsub(/#{Spec::Matchers::MAJOR_DEPRECATION}Bundler will only support ruby(gems)? >= .*/, "") } let(:warnings_without_version_messages) { warnings.gsub(/#{Spec::Matchers::MAJOR_DEPRECATION}Bundler will only support ruby(gems)? >= .*/, "") }
@ -200,25 +200,25 @@ RSpec.describe "major deprecations", :bundler => "< 2" do
context "with github gems" do context "with github gems" do
it "warns about the https change" do it "warns about the https change" do
msg = <<-EOS msg = <<-EOS
The :github git source is deprecated, and will be removed in Bundler 2.0. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work: The :github git source is deprecated, and will be removed in Bundler 3.0. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work:
git_source(:github) {|repo_name| "https://github.com/\#{repo_name}.git" } git_source(:github) {|repo_name| "https://github.com/\#{repo_name}.git" }
EOS EOS
expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, msg) expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg)
subject.gem("sparks", :github => "indirect/sparks") subject.gem("sparks", :github => "indirect/sparks")
end end
it "upgrades to https on request" do it "upgrades to https on request" do
Bundler.settings.temporary "github.https" => true Bundler.settings.temporary "github.https" => true
msg = <<-EOS msg = <<-EOS
The :github git source is deprecated, and will be removed in Bundler 2.0. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work: The :github git source is deprecated, and will be removed in Bundler 3.0. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work:
git_source(:github) {|repo_name| "https://github.com/\#{repo_name}.git" } git_source(:github) {|repo_name| "https://github.com/\#{repo_name}.git" }
EOS EOS
expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, msg) expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg)
expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, "The `github.https` setting will be removed") expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, "The `github.https` setting will be removed")
subject.gem("sparks", :github => "indirect/sparks") subject.gem("sparks", :github => "indirect/sparks")
github_uri = "https://github.com/indirect/sparks.git" github_uri = "https://github.com/indirect/sparks.git"
expect(subject.dependencies.first.source.uri).to eq(github_uri) expect(subject.dependencies.first.source.uri).to eq(github_uri)
@ -229,7 +229,7 @@ The :github git source is deprecated, and will be removed in Bundler 2.0. Change
it "warns about removal" do it "warns about removal" do
allow(Bundler.ui).to receive(:deprecate) allow(Bundler.ui).to receive(:deprecate)
msg = <<-EOS msg = <<-EOS
The :bitbucket git source is deprecated, and will be removed in Bundler 2.0. Add this code to the top of your Gemfile to ensure it continues to work: The :bitbucket git source is deprecated, and will be removed in Bundler 3.0. Add this code to the top of your Gemfile to ensure it continues to work:
git_source(:bitbucket) do |repo_name| git_source(:bitbucket) do |repo_name|
user_name, repo_name = repo_name.split("/") user_name, repo_name = repo_name.split("/")
@ -238,7 +238,7 @@ The :bitbucket git source is deprecated, and will be removed in Bundler 2.0. Add
end end
EOS EOS
expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, msg) expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg)
subject.gem("not-really-a-gem", :bitbucket => "mcorp/flatlab-rails") subject.gem("not-really-a-gem", :bitbucket => "mcorp/flatlab-rails")
end end
end end
@ -247,10 +247,10 @@ The :bitbucket git source is deprecated, and will be removed in Bundler 2.0. Add
it "warns about removal" do it "warns about removal" do
allow(Bundler.ui).to receive(:deprecate) allow(Bundler.ui).to receive(:deprecate)
msg = "The :gist git source is deprecated, and will be removed " \ msg = "The :gist git source is deprecated, and will be removed " \
"in Bundler 2.0. Add this code to the top of your Gemfile to ensure it " \ "in Bundler 3.0. Add this code to the top of your Gemfile to ensure it " \
"continues to work:\n\n git_source(:gist) {|repo_name| " \ "continues to work:\n\n git_source(:gist) {|repo_name| " \
"\"https://gist.github.com/\#{repo_name}.git\" }\n\n" "\"https://gist.github.com/\#{repo_name}.git\" }\n\n"
expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, msg) expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg)
subject.gem("not-really-a-gem", :gist => "1234") subject.gem("not-really-a-gem", :gist => "1234")
end end
end end

View file

@ -4,7 +4,7 @@ RSpec.describe "bundle platform" do
context "without flags" do context "without flags" do
let(:bundle_platform_platforms_string) do let(:bundle_platform_platforms_string) do
platforms = [rb] platforms = [rb]
platforms.unshift(specific_local_platform) if Bundler.feature_flag.bundler_2_mode? platforms.unshift(specific_local_platform) if Bundler.feature_flag.bundler_3_mode?
platforms.map {|pl| "* #{pl}" }.join("\n") platforms.map {|pl| "* #{pl}" }.join("\n")
end end
@ -633,7 +633,7 @@ G
end end
end end
it "fails if ruby version doesn't match", :bundler => "< 2" do it "fails if ruby version doesn't match", :bundler => "< 3" do
gemfile <<-G gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"
gem "rails" gem "rails"
@ -645,7 +645,7 @@ G
should_be_ruby_version_incorrect should_be_ruby_version_incorrect
end end
it "fails if engine doesn't match", :bundler => "< 2" do it "fails if engine doesn't match", :bundler => "< 3" do
gemfile <<-G gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"
gem "rails" gem "rails"
@ -657,7 +657,7 @@ G
should_be_engine_incorrect should_be_engine_incorrect
end end
it "fails if engine version doesn't match", :bundler => "< 2" do it "fails if engine version doesn't match", :bundler => "< 3" do
simulate_ruby_engine "jruby" do simulate_ruby_engine "jruby" do
gemfile <<-G gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"
@ -671,7 +671,7 @@ G
end end
end end
it "fails when patchlevel doesn't match", :bundler => "< 2" do it "fails when patchlevel doesn't match", :bundler => "< 3" do
gemfile <<-G gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"
gem "rack" gem "rack"
@ -928,7 +928,7 @@ G
end end
end end
context "bundle console", :bundler => "< 2" do context "bundle console", :bundler => "< 3" do
before do before do
install_gemfile <<-G install_gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"

View file

@ -67,7 +67,7 @@ RSpec.describe "real source plugins" do
expect(the_bundle).to include_gems("a-path-gem 1.0") expect(the_bundle).to include_gems("a-path-gem 1.0")
end end
it "writes to lock file", :bundler => "< 2" do it "writes to lock file", :bundler => "< 3" do
bundle "install" bundle "install"
lockfile_should_be <<-G lockfile_should_be <<-G
@ -92,7 +92,7 @@ RSpec.describe "real source plugins" do
G G
end end
it "writes to lock file", :bundler => "2" do it "writes to lock file", :bundler => "3" do
bundle "install" bundle "install"
lockfile_should_be <<-G lockfile_should_be <<-G
@ -359,7 +359,7 @@ RSpec.describe "real source plugins" do
expect(the_bundle).to include_gems("ma-gitp-gem 1.0") expect(the_bundle).to include_gems("ma-gitp-gem 1.0")
end end
it "writes to lock file", :bundler => "< 2" do it "writes to lock file", :bundler => "< 3" do
revision = revision_for(lib_path("ma-gitp-gem-1.0")) revision = revision_for(lib_path("ma-gitp-gem-1.0"))
bundle "install" bundle "install"
@ -386,7 +386,7 @@ RSpec.describe "real source plugins" do
G G
end end
it "writes to lock file", :bundler => "2" do it "writes to lock file", :bundler => "3" do
revision = revision_for(lib_path("ma-gitp-gem-1.0")) revision = revision_for(lib_path("ma-gitp-gem-1.0"))
bundle "install" bundle "install"

View file

@ -181,6 +181,7 @@ RSpec.describe "The library itself" do
gem.coc gem.coc
gem.mit gem.mit
inline inline
lockfile_upgrade_warning
lockfile_uses_separate_rubygems_sources lockfile_uses_separate_rubygems_sources
use_gem_version_promoter_for_major_updates use_gem_version_promoter_for_major_updates
viz_command viz_command
@ -260,7 +261,11 @@ RSpec.describe "The library itself" do
end end
end end
expect(last_command.stdboth.split("\n")).to be_well_formed warnings = last_command.stdboth.split("\n")
# ignore warnings around deprecated Object#=~ method in RubyGems
warnings.reject! {|w| w =~ %r{rubygems\/version.rb.*deprecated\ Object#=~} }
expect(warnings).to be_well_formed
end end
end end
end end

View file

@ -57,7 +57,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
expect(lockfile).to include("activemodel (3.0.5)") expect(lockfile).to include("activemodel (3.0.5)")
end end
it "resolves dependencies correctly", :ruby => "1.9.3" do it "resolves dependencies correctly", :ruby => "<= 1.9.3" do
gemfile <<-G gemfile <<-G
source "https://rubygems.org" source "https://rubygems.org"
@ -70,7 +70,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
expect(lockfile).to include("capybara (2.2.1)") expect(lockfile).to include("capybara (2.2.1)")
end end
it "installs the latest version of gxapi_rails", :ruby => "1.9.3" do it "installs the latest version of gxapi_rails", :ruby => "<= 1.9.3" do
gemfile <<-G gemfile <<-G
source "https://rubygems.org" source "https://rubygems.org"
@ -188,7 +188,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
activemodel (= 4.2.7.1) activemodel (= 4.2.7.1)
activerecord (= 4.2.7.1) activerecord (= 4.2.7.1)
activesupport (= 4.2.7.1) activesupport (= 4.2.7.1)
bundler (>= 1.3.0, < 2.0) bundler (>= 1.3.0, < 3.0)
railties (= 4.2.7.1) railties (= 4.2.7.1)
sprockets-rails sprockets-rails
rails-deprecated_sanitizer (1.0.3) rails-deprecated_sanitizer (1.0.3)

View file

@ -99,7 +99,7 @@ RSpec.describe "Running bin/* commands" do
expect(bundled_app("bin/rackup")).not_to exist expect(bundled_app("bin/rackup")).not_to exist
end end
it "allows you to stop installing binstubs", :bundler => "< 2" do it "allows you to stop installing binstubs", :bundler => "< 3" do
bundle! "install --binstubs bin/" bundle! "install --binstubs bin/"
bundled_app("bin/rackup").rmtree bundled_app("bin/rackup").rmtree
bundle! "install --binstubs \"\"" bundle! "install --binstubs \"\""
@ -110,7 +110,7 @@ RSpec.describe "Running bin/* commands" do
expect(out).to include("You have not configured a value for `bin`") expect(out).to include("You have not configured a value for `bin`")
end end
it "remembers that the option was specified", :bundler => "< 2" do it "remembers that the option was specified", :bundler => "< 3" do
gemfile <<-G gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"
gem "activesupport" gem "activesupport"

View file

@ -886,7 +886,9 @@ end
end end
end end
it "should succesfully require 'bundler/setup'", :ruby_repo do # Can't make this pass on 2.6 since the ruby standard library has the same $LOAD_PATH
# entry as bundler (since it's a default gem)
it "should successfully require 'bundler/setup'", :ruby_repo, :ruby => "< 2.6" do
install_gemfile "" install_gemfile ""
ENV["GEM_PATH"] = symlinked_gem_home.path ENV["GEM_PATH"] = symlinked_gem_home.path
@ -1395,7 +1397,7 @@ end
end end
describe "after setup" do describe "after setup" do
it "allows calling #gem on random objects", :bundler => "< 2" do it "allows calling #gem on random objects", :bundler => "< 3" do
install_gemfile <<-G install_gemfile <<-G
source "file:#{gem_repo1}" source "file:#{gem_repo1}"
gem "rack" gem "rack"
@ -1410,7 +1412,7 @@ end
expect(out).to eq("rack-1.0.0") expect(out).to eq("rack-1.0.0")
end end
it "keeps Kernel#gem private", :bundler => "2" do it "keeps Kernel#gem private", :bundler => "3" do
install_gemfile! <<-G install_gemfile! <<-G
source "file:#{gem_repo1}" source "file:#{gem_repo1}"
gem "rack" gem "rack"

View file

@ -63,7 +63,7 @@ RSpec.describe "Bundler.with_env helpers" do
end end
end end
describe "Bundler.clean_env", :bundler => "< 2" do describe "Bundler.clean_env", :bundler => "< 3" do
before do before do
bundle "config path vendor/bundle" bundle "config path vendor/bundle"
gemfile "" gemfile ""
@ -116,7 +116,7 @@ RSpec.describe "Bundler.with_env helpers" do
end end
end end
describe "Bundler.with_clean_env", :bundler => "< 2" do describe "Bundler.with_clean_env", :bundler => "< 3" do
it "should set ENV to clean_env in the block" do it "should set ENV to clean_env in the block" do
expected = Bundler.clean_env expected = Bundler.clean_env
actual = Bundler.with_clean_env { ENV.to_hash } actual = Bundler.with_clean_env { ENV.to_hash }
@ -132,14 +132,14 @@ RSpec.describe "Bundler.with_env helpers" do
end end
end end
describe "Bundler.clean_system", :ruby => ">= 1.9", :bundler => "< 2" do describe "Bundler.clean_system", :ruby => ">= 1.9", :bundler => "< 3" do
it "runs system inside with_clean_env" do it "runs system inside with_clean_env" do
Bundler.clean_system(%(echo 'if [ "$BUNDLE_PATH" = "" ]; then exit 42; else exit 1; fi' | /bin/sh)) Bundler.clean_system(%(echo 'if [ "$BUNDLE_PATH" = "" ]; then exit 42; else exit 1; fi' | /bin/sh))
expect($?.exitstatus).to eq(42) expect($?.exitstatus).to eq(42)
end end
end end
describe "Bundler.clean_exec", :ruby => ">= 1.9", :bundler => "< 2" do describe "Bundler.clean_exec", :ruby => ">= 1.9", :bundler => "< 3" do
it "runs exec inside with_clean_env" do it "runs exec inside with_clean_env" do
pid = Kernel.fork do pid = Kernel.fork do
Bundler.clean_exec(%(echo 'if [ "$BUNDLE_PATH" = "" ]; then exit 42; else exit 1; fi' | /bin/sh)) Bundler.clean_exec(%(echo 'if [ "$BUNDLE_PATH" = "" ]; then exit 42; else exit 1; fi' | /bin/sh))

View file

@ -40,7 +40,7 @@ if ENV.select {|k, _v| k =~ /TRAVIS/ }.any? && Gem::Version.new(Gem::VERSION) >
end end
end end
if File.expand_path(__FILE__) =~ %r{([^\w/\.-])} if File.expand_path(__FILE__) =~ %r{([^\w/\.:\-])}
abort "The bundler specs cannot be run from a path that contains special characters (particularly #{$1.inspect})" abort "The bundler specs cannot be run from a path that contains special characters (particularly #{$1.inspect})"
end end

View file

@ -53,7 +53,7 @@ module Spec
end end
def bundle_update_requires_all? def bundle_update_requires_all?
Bundler::VERSION.start_with?("1.") ? nil : true Bundler::VERSION.start_with?("2.") ? nil : true
end end
def in_app_root(&blk) def in_app_root(&blk)
@ -104,7 +104,7 @@ module Spec
bundle_bin = options.delete("bundle_bin") || bindir.join("bundle") bundle_bin = options.delete("bundle_bin") || bindir.join("bundle")
if system_bundler = options.delete(:system_bundler) if system_bundler = options.delete(:system_bundler)
bundle_bin = "-S bundle" bundle_bin = system_bundle_bin_path
end end
env = options.delete(:env) || {} env = options.delete(:env) || {}
@ -152,7 +152,7 @@ module Spec
bang :bundle bang :bundle
def forgotten_command_line_options(options) def forgotten_command_line_options(options)
remembered = Bundler::VERSION.split(".", 2).first == "1" remembered = Bundler.bundler_major_version < 3
options = options.map do |k, v| options = options.map do |k, v|
k = Array(k)[remembered ? 0 : -1] k = Array(k)[remembered ? 0 : -1]
v = '""' if v && v.to_s.empty? v = '""' if v && v.to_s.empty?

View file

@ -29,7 +29,7 @@ module Spec
end end
def default_bundle_path(*path) def default_bundle_path(*path)
if Bundler::VERSION.split(".").first.to_i < 2 if Bundler::VERSION.split(".").first.to_i < 3
system_gem_path(*path) system_gem_path(*path)
else else
bundled_app(*[".bundle", ENV.fetch("BUNDLER_SPEC_RUBY_ENGINE", Gem.ruby_engine), Gem::ConfigMap[:ruby_version], *path].compact) bundled_app(*[".bundle", ENV.fetch("BUNDLER_SPEC_RUBY_ENGINE", Gem.ruby_engine), Gem::ConfigMap[:ruby_version], *path].compact)
@ -90,6 +90,10 @@ module Spec
tmp("gems/system", *path) tmp("gems/system", *path)
end end
def system_bundle_bin_path
system_gem_path("bin/bundle")
end
def lib_path(*args) def lib_path(*args)
tmp("libs", *args) tmp("libs", *args)
end end

View file

@ -106,7 +106,7 @@ module Spec
end end
def local_platforms def local_platforms
if Bundler::VERSION.split(".").first.to_i > 1 if Bundler::VERSION.split(".").first.to_i > 2
[local, specific_local_platform] [local, specific_local_platform]
else else
[local] [local]

View file

@ -299,7 +299,7 @@ RSpec.describe "bundle update" do
G G
end end
it "the --source flag updates version of gems that were originally pulled in by the source", :bundler => "< 2" do it "the --source flag updates version of gems that were originally pulled in by the source", :bundler => "> 3" do
spec_lines = lib_path("bar/foo.gemspec").read.split("\n") spec_lines = lib_path("bar/foo.gemspec").read.split("\n")
spec_lines[5] = "s.version = '2.0'" spec_lines[5] = "s.version = '2.0'"
@ -335,7 +335,7 @@ RSpec.describe "bundle update" do
G G
end end
it "the --source flag updates version of gems that were originally pulled in by the source", :bundler => "2" do it "the --source flag updates version of gems that were originally pulled in by the source", :bundler => "3" do
spec_lines = lib_path("bar/foo.gemspec").read.split("\n") spec_lines = lib_path("bar/foo.gemspec").read.split("\n")
spec_lines[5] = "s.version = '2.0'" spec_lines[5] = "s.version = '2.0'"

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
RSpec.describe "bundle update", :bundler => "< 2", :ruby => ">= 2.0" do RSpec.describe "bundle update", :bundler => "< 3", :ruby => ">= 2.0" do
before :each do before :each do
install_gemfile <<-G install_gemfile <<-G
source "file://#{gem_repo1}" source "file://#{gem_repo1}"
@ -13,24 +13,24 @@ RSpec.describe "bundle update", :bundler => "< 2", :ruby => ">= 2.0" do
describe "with --force" do describe "with --force" do
it "shows a deprecation when single flag passed" do it "shows a deprecation when single flag passed" do
bundle! "update rack --force" bundle! "update rack --force"
expect(out).to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" expect(out).to include "[DEPRECATED FOR 3.0] The `--force` option has been renamed to `--redownload`"
end end
it "shows a deprecation when multiple flags passed" do it "shows a deprecation when multiple flags passed" do
bundle! "update rack --no-color --force" bundle! "update rack --no-color --force"
expect(out).to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" expect(out).to include "[DEPRECATED FOR 3.0] The `--force` option has been renamed to `--redownload`"
end end
end end
describe "with --redownload" do describe "with --redownload" do
it "does not show a deprecation when single flag passed" do it "does not show a deprecation when single flag passed" do
bundle! "update rack --redownload" bundle! "update rack --redownload"
expect(out).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" expect(out).not_to include "[DEPRECATED FOR 3.0] The `--force` option has been renamed to `--redownload`"
end end
it "does not show a deprecation when single multiple flags passed" do it "does not show a deprecation when single multiple flags passed" do
bundle! "update rack --no-color --redownload" bundle! "update rack --no-color --redownload"
expect(out).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" expect(out).not_to include "[DEPRECATED FOR 3.0] The `--force` option has been renamed to `--redownload`"
end end
end end
end end