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
Родитель 4bbbbb6a3f
Коммит e97741e12a
97 изменённых файлов: 578 добавлений и 551 удалений

Просмотреть файл

@ -8,8 +8,6 @@ rescue LoadError
require File.expand_path("../bundler/version", __FILE__)
end
require "shellwords"
Gem::Specification.new do |s|
s.name = "bundler"
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 "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 use them to generate the long-form help for each command.
# s.files += Dir.glob("man/**/*")

Просмотреть файл

@ -119,7 +119,7 @@ module Bundler
end
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
end
@ -283,7 +283,7 @@ EOF
# @deprecated Use `original_env` instead
# @return [Hash] Environment with all bundler-related variables removed
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
if env.key?("BUNDLER_ORIG_MANPATH")

Просмотреть файл

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

Просмотреть файл

@ -1,7 +1,7 @@
# frozen_string_literal: true
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"
# Capistrano task for Bundler.

Просмотреть файл

@ -229,7 +229,7 @@ module Bundler
"Include gems that are part of the specified named group."
map "i" => "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"
Bundler.settings.temporary(:no_install => false) do
Install.new(options.dup).run
@ -275,7 +275,7 @@ module Bundler
method_option "all", :type => :boolean, :banner =>
"Update everything."
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"
Update.new(options, gems).run
end
@ -303,7 +303,7 @@ module Bundler
old_argv = ARGV.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
require "bundler/cli/show"
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 :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
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"
Viz.new(options.dup).run
end
@ -608,7 +608,7 @@ module Bundler
method_option "group", :type => :string, :banner =>
"Install gem into a bundler group"
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"
Inject.new(options.dup, name, version).run
end

Просмотреть файл

@ -9,7 +9,7 @@ module Bundler
end
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>`"
group ? Bundler.require(:default, *(group.split.map!(&:to_sym))) : Bundler.require

Просмотреть файл

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

Просмотреть файл

@ -22,7 +22,7 @@ module Bundler
if Bundler.feature_flag.update_requires_all_flag?
raise InvalidOption, "To update everything, pass the `--all` flag."
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]
raise InvalidOption, "Cannot specify --all along with specific options."
end

Просмотреть файл

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

Просмотреть файл

@ -331,7 +331,7 @@ module Bundler
# i.e., Windows with `git config core.autocrlf=true`
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
current_major = Gem::Version.create(Bundler::VERSION).segments.first

Просмотреть файл

@ -1,7 +1,7 @@
# frozen_string_literal: true
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 " \
"Bundler via the capistrano-bundler gem. Use it instead."

Просмотреть файл

@ -194,7 +194,7 @@ module Bundler
" end\n\n"
raise DeprecatedError, msg if Bundler.feature_flag.disable_multisource?
SharedHelpers.major_deprecation(2, msg.strip)
SharedHelpers.major_deprecation(3, msg.strip)
end
source_options = normalize_hash(options).merge(
@ -305,8 +305,8 @@ module Bundler
# end
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
# TODO: 2.0 upgrade this setting to the default
if Bundler.feature_flag.github_https?
Bundler::SharedHelpers.major_deprecation 2, "The `github.https` setting will be removed"
if Bundler.settings["github.https"]
Bundler::SharedHelpers.major_deprecation 3, "The `github.https` setting will be removed"
"https://github.com/#{repo_name}.git"
else
"git://github.com/#{repo_name}.git"
@ -456,7 +456,7 @@ repo_name ||= user_name
def normalize_source(source)
case source
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://" \
"rubygems.org' if possible, or 'http://rubygems.org' if not."
"http://rubygems.org"
@ -474,13 +474,13 @@ repo_name ||= user_name
msg = "This Gemfile contains multiple primary sources. " \
"Each source after the first must include a block to indicate which gems " \
"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 " \
"`bundle config --delete disable_multisource`"
end
raise GemfileEvalError, msg
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 " \
"may result in installing unexpected gems. To resolve this warning, use " \
"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"
end
Bundler::SharedHelpers.major_deprecation 2, <<-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:
Bundler::SharedHelpers.major_deprecation 3, <<-EOS
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}

Просмотреть файл

@ -27,38 +27,39 @@ module Bundler
(1..10).each {|v| define_method("bundler_#{v}_mode?") { major_version >= v } }
settings_flag(:allow_bundler_dependency_conflicts) { bundler_2_mode? }
settings_flag(:allow_offline_install) { bundler_2_mode? }
settings_flag(:auto_clean_without_path) { bundler_2_mode? }
settings_flag(:auto_config_jobs) { bundler_2_mode? }
settings_flag(:cache_all) { bundler_2_mode? }
settings_flag(:cache_command_is_package) { bundler_2_mode? }
settings_flag(:console_command) { !bundler_2_mode? }
settings_flag(:default_install_uses_path) { bundler_2_mode? }
settings_flag(:deployment_means_frozen) { bundler_2_mode? }
settings_flag(:disable_multisource) { bundler_2_mode? }
settings_flag(:allow_bundler_dependency_conflicts) { bundler_3_mode? }
settings_flag(:allow_offline_install) { bundler_3_mode? }
settings_flag(:auto_clean_without_path) { bundler_3_mode? }
settings_flag(:auto_config_jobs) { bundler_3_mode? }
settings_flag(:cache_all) { bundler_3_mode? }
settings_flag(:cache_command_is_package) { bundler_3_mode? }
settings_flag(:console_command) { !bundler_3_mode? }
settings_flag(:default_install_uses_path) { bundler_3_mode? }
settings_flag(:deployment_means_frozen) { bundler_3_mode? }
settings_flag(:disable_multisource) { bundler_3_mode? }
settings_flag(:error_on_stderr) { bundler_2_mode? }
settings_flag(:forget_cli_options) { bundler_2_mode? }
settings_flag(:global_path_appends_ruby_scope) { bundler_2_mode? }
settings_flag(:global_gem_cache) { bundler_2_mode? }
settings_flag(:init_gems_rb) { bundler_2_mode? }
settings_flag(:list_command) { bundler_2_mode? }
settings_flag(:lockfile_uses_separate_rubygems_sources) { bundler_2_mode? }
settings_flag(:only_update_to_newer_versions) { bundler_2_mode? }
settings_flag(:path_relative_to_cwd) { bundler_2_mode? }
settings_flag(:forget_cli_options) { bundler_3_mode? }
settings_flag(:global_path_appends_ruby_scope) { bundler_3_mode? }
settings_flag(:global_gem_cache) { bundler_3_mode? }
settings_flag(:init_gems_rb) { bundler_3_mode? }
settings_flag(:list_command) { bundler_3_mode? }
settings_flag(:lockfile_uses_separate_rubygems_sources) { bundler_3_mode? }
settings_flag(:lockfile_upgrade_warning) { bundler_3_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(:prefer_gems_rb) { bundler_2_mode? }
settings_flag(:print_only_version_number) { bundler_2_mode? }
settings_flag(:setup_makes_kernel_gem_public) { !bundler_2_mode? }
settings_flag(:skip_default_git_sources) { bundler_2_mode? }
settings_flag(:specific_platform) { bundler_2_mode? }
settings_flag(:suppress_install_using_messages) { bundler_2_mode? }
settings_flag(:unlock_source_unlocks_spec) { !bundler_2_mode? }
settings_flag(:update_requires_all_flag) { bundler_2_mode? }
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_2_mode? }
settings_flag(:viz_command) { !bundler_2_mode? }
settings_flag(:prefer_gems_rb) { bundler_3_mode? }
settings_flag(:print_only_version_number) { bundler_3_mode? }
settings_flag(:setup_makes_kernel_gem_public) { !bundler_3_mode? }
settings_flag(:skip_default_git_sources) { bundler_3_mode? }
settings_flag(:specific_platform) { bundler_3_mode? }
settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
settings_flag(:unlock_source_unlocks_spec) { !bundler_3_mode? }
settings_flag(:update_requires_all_flag) { bundler_3_mode? }
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_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? }

Просмотреть файл

@ -465,7 +465,7 @@ module Bundler
raise Gem::Exception, "no default executable for #{spec.full_name}" unless exec_name ||= spec.default_executable
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" \
"You should run `bundle binstub #{gem_name}` " \
"to work around a system/bundle conflict."

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -7,7 +7,7 @@ module Bundler
# We're doing this because we might write tests that deal
# with other versions of bundler and we are unsure how to
# 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
begin

Просмотреть файл

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

Просмотреть файл

@ -3,7 +3,7 @@
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 }

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.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"
\fBbundle\-config\fR \- Set bundler configuration options

Просмотреть файл

@ -44,8 +44,8 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
1mapp/.bundle/config22m.
Executing 1mbundle config --delete <name> 22mwill delete the configuration
in both local and global sources. Not compatible with --global or
--local flag.
in both local and global sources. Not compatible with --global or --lo-
cal flag.
Executing bundle with the 1mBUNDLE_IGNORE_CONFIG 22menvironment variable set
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-
ment's 1mPATH 22mvariable. For instance, if the 1mrails 22mgem comes with
a 1mrails 22mexecutable, this flag will create a 1mbin/rails 22mexecutable
that ensures that all referred dependencies will be resolved
using the bundled gems.
that ensures that all referred dependencies will be resolved us-
ing the bundled gems.
1mdeployment0m
In deployment mode, Bundler will 'roll-out' the bundle for 1mpro-0m
1mduction 22muse. Please check carefully if you want to have this
option enabled in 1mdevelopment 22mor 1mtest 22menvironments.
1mduction 22muse. Please check carefully if you want to have this op-
tion enabled in 1mdevelopment 22mor 1mtest 22menvironments.
1mpath 22mThe location to install the specified gems to. This defaults to
Rubygems' setting. Bundler shares this location with Rubygems,
@ -143,8 +143,8 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
4mdle-install.1.html24m.
o 1mallow_bundler_dependency_conflicts 22m(1mBUNDLE_ALLOW_BUNDLER_DEPEN-0m
1mDENCY_CONFLICTS22m): Allow resolving to specifications that have
dependencies on 1mbundler 22mthat are incompatible with the running
1mDENCY_CONFLICTS22m): Allow resolving to specifications that have de-
pendencies on 1mbundler 22mthat are incompatible with the running
Bundler version.
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
not been set and Bundler is not installing into the system gems.
o 1mauto_install 22m(1mBUNDLE_AUTO_INSTALL22m): Automatically run 1mbundle0m
1minstall 22mwhen gems are missing.
o 1mauto_install 22m(1mBUNDLE_AUTO_INSTALL22m): Automatically run 1mbundle in-0m
1mstall 22mwhen gems are missing.
o 1mbin 22m(1mBUNDLE_BIN22m): Install executables from gems in the bundle to
the specified directory. Defaults to 1mfalse22m.
@ -183,8 +183,8 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
Defaults to 1mirb22m.
o 1mdefault_install_uses_path 22m(1mBUNDLE_DEFAULT_INSTALL_USES_PATH22m):
Whether a 1mbundle install 22mwithout an explicit 1m--path 22margument
defaults to installing gems in 1m.bundle22m.
Whether a 1mbundle install 22mwithout an explicit 1m--path 22margument de-
faults to installing gems in 1m.bundle22m.
o 1mdeployment 22m(1mBUNDLE_DEPLOYMENT22m): Disallow changes to the 1mGemfile22m.
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-
vided by RubyGems.
o 1mdisable_exec_load 22m(1mBUNDLE_DISABLE_EXEC_LOAD22m): Stop Bundler from
using 1mload 22mto launch an executable in-process in 1mbundle exec22m.
o 1mdisable_exec_load 22m(1mBUNDLE_DISABLE_EXEC_LOAD22m): Stop Bundler from us-
ing 1mload 22mto launch an executable in-process in 1mbundle exec22m.
o 1mdisable_local_branch_check 22m(1mBUNDLE_DISABLE_LOCAL_BRANCH_CHECK22m):
Allow Bundler to use a local git override without a branch speci-
fied in the Gemfile.
o 1mdisable_local_branch_check 22m(1mBUNDLE_DISABLE_LOCAL_BRANCH_CHECK22m): Al-
low Bundler to use a local git override without a branch specified
in the Gemfile.
o 1mdisable_multisource 22m(1mBUNDLE_DISABLE_MULTISOURCE22m): When set, Gem-
files containing multiple sources will produce errors instead of
@ -242,10 +242,9 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
cache all gems globally, rather than locally to the installing Ruby
installation.
o 1mglobal_path_appends_ruby_scope 22m(1mBUN-0m
1mDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE22m): Whether Bundler should append
the Ruby scope (e.g. engine and ABI version) to a globally-config-
ured path.
o 1mglobal_path_appends_ruby_scope 22m(1mBUNDLE_GLOBAL_PATH_AP-0m
1mPENDS_RUBY_SCOPE22m): Whether Bundler should append the Ruby scope
(e.g. engine and ABI version) to a globally-configured path.
o 1mignore_messages 22m(1mBUNDLE_IGNORE_MESSAGES22m): When set, no post install
messages will be printed. To silence a single gem, use dot notation
@ -315,8 +314,8 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
Bundler should skip adding default git source shortcuts to the Gem-
file DSL.
o 1mspecific_platform 22m(1mBUNDLE_SPECIFIC_PLATFORM22m): Allow bundler to
resolve for the specific running platform and store it in the lock-
o 1mspecific_platform 22m(1mBUNDLE_SPECIFIC_PLATFORM22m): Allow bundler to re-
solve for the specific running platform and store it in the lock-
file, instead of only using a generic platform. A specific platform
is the exact platform triple reported by 1mGem::Platform.local22m, such
as 1mx86_64-darwin-16 22mor 1muniversal-java-1.822m. On the other hand,
@ -372,9 +371,9 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
ronment variables will take preference over global settings.
1mLOCAL GIT REPOS0m
Bundler also allows you to work against a git repository locally
instead of using the remote version. This can be achieved by setting up
a local override:
Bundler also allows you to work against a git repository locally in-
stead of using the remote version. This can be achieved by setting up a
local override:
@ -398,8 +397,8 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
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
ensure the local override was pushed, otherwise you may point to a com-
mit that only exists in your local machine. You'll also need to CGI
escape your usernames and passwords as well.
mit that only exists in your local machine. You'll also need to CGI es-
cape your usernames and passwords as well.
Bundler does many checks to ensure a developer won't work with invalid
references. Particularly, we force a developer to specify a branch in
@ -526,4 +525,4 @@ BUNDLE-CONFIG(1) BUNDLE-CONFIG(1)
December 2018 BUNDLE-CONFIG(1)
January 2019 BUNDLE-CONFIG(1)

Просмотреть файл

@ -14,8 +14,8 @@ BUNDLE-EXEC(1) BUNDLE-EXEC(1)
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
1mfile(5)22m][Gemfile(5)] and installed via bundle install(1) 4mbun-0m
4mdle-install.1.html24m, you should run 1mbundle exec rspec spec/my_spec.rb22m.
1mfile(5)22m][Gemfile(5)] and installed via bundle install(1) 4mbundle-in-0m
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
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.
1mBUNDLE INSTALL --BINSTUBS0m
If you use the 1m--binstubs 22mflag in bundle install(1) 4mbun-0m
4mdle-install.1.html24m, Bundler will automatically create a directory
(which defaults to 1mapp_root/bin22m) containing all of the executables
available from gems in the bundle.
If you use the 1m--binstubs 22mflag in bundle install(1) 4mbundle-in-0m
4mstall.1.html24m, Bundler will automatically create a directory (which de-
faults to 1mapp_root/bin22m) containing all of the executables available
from gems in the bundle.
After using 1m--binstubs22m, 1mbin/rspec spec/my_spec.rb 22mis identical to 1mbun-0m
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
executes the command you specify in full.
o make sure that it's still possible to shell out to 1mbundle 22mfrom
inside a command invoked by 1mbundle exec 22m(using 1m$BUNDLE_BIN_PATH22m)
o make sure that it's still possible to shell out to 1mbundle 22mfrom in-
side a command invoked by 1mbundle exec 22m(using 1m$BUNDLE_BIN_PATH22m)
o put the directory containing executables (like 1mrails22m, 1mrspec22m,
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-
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
rare few cases, this could cause some subtle side-effects (such as
dependence on the exact contents of 1m$0 22mor 1m__FILE__22m) and the optimiza-
tion can be disabled by enabling the 1mdisable_exec_load 22msetting.
rare few cases, this could cause some subtle side-effects (such as de-
pendence on the exact contents of 1m$0 22mor 1m__FILE__22m) and the optimization
can be disabled by enabling the 1mdisable_exec_load 22msetting.
1mShelling out0m
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
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
inside the block will be given the environment present before Bundler
was activated. For example, Homebrew commands run Ruby, but don't work
inside a bundle:
use the 1mwith_clean_env 22mmethod with a block. Any subshells created in-
side the block will be given the environment present before Bundler was
activated. For example, Homebrew commands run Ruby, but don't work in-
side a bundle:

Просмотреть файл

@ -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
be used to test and publish the gem to rubygems.org.
The generated project skeleton can be customized with OPTIONS, as
explained below. Note that these options can also be specified via
The generated project skeleton can be customized with OPTIONS, as ex-
plained below. Note that these options can also be specified via
Bundler's global configuration file using the following names:
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-
erated project. Your name from the global git config is used for
the copyright statement. If this option is unspecified, an
interactive prompt will be displayed and the answer will be
saved in Bundler's global config for future 1mbundle gem 22muse.
the copyright statement. If this option is unspecified, an in-
teractive prompt will be displayed and the answer will be saved
in Bundler's global config for future 1mbundle gem 22muse.
1m--no-mit0m
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
Specify the test framework that Bundler should use when generat-
ing the project. Acceptable values are 1mminitest 22mand 1mrspec22m. The
1mGEM_NAME.gemspec 22mwill be configured and a skeleton test/spec
directory will be created based on this option. If this option
is unspecified, an interactive prompt will be displayed and the
answer will be saved in Bundler's global config for future 1mbun-0m
1mdle gem 22muse. If no option is specified, the default testing
framework is RSpec.
1mGEM_NAME.gemspec 22mwill be configured and a skeleton test/spec di-
rectory will be created based on this option. If this option is
unspecified, an interactive prompt will be displayed and the an-
swer will be saved in Bundler's global config for future 1mbundle0m
1mgem 22muse. If no option is specified, the default testing frame-
work is RSpec.
1m-e22m, 1m--edit[=EDITOR]0m
Open the resulting GEM_NAME.gemspec in EDITOR, or the default

Просмотреть файл

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.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"
\fBbundle\-install\fR \- Install the dependencies specified in your Gemfile

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -10,15 +10,15 @@ BUNDLE-PACKAGE(1) BUNDLE-PACKAGE(1)
1mDESCRIPTION0m
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
install(1)][bundle-install], use the gems in the cache in preference to
1mdor/cache 22mdirectory. In the future, when running [bundle in-
stall(1)][bundle-install], use the gems in the cache in preference to
the ones on 1mrubygems.org22m.
1mGIT AND PATH GEMS0m
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
enabled via the 1m--all 22moption. Once used, the 1m--all 22moption will be
remembered.
1m:path 22mdependencies besides .gem files. This needs to be explicitly en-
abled via the 1m--all 22moption. Once used, the 1m--all 22moption will be remem-
bered.
1mSUPPORT FOR MULTIPLE PLATFORMS0m
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
platformed 1mnokogiri 22mexists.
Even though the 1mnokogiri 22mgem for the Ruby platform is 4mtechnically0m
acceptable on JRuby, it has a C extension that does not run on JRuby.
As a result, bundler will, by default, still connect to 1mrubygems.org 22mto
Even though the 1mnokogiri 22mgem for the Ruby platform is 4mtechnically24m ac-
ceptable on JRuby, it has a C extension that does not run on JRuby. As
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
your platform.

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.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"
\fBbundle\-update\fR \- Update your gems to the latest available versions

Просмотреть файл

@ -35,8 +35,8 @@ BUNDLE-UPDATE(1) BUNDLE-UPDATE(1)
1m--source rails0m
1m--local0m
Do not attempt to fetch gems remotely and use the gem cache
instead.
Do not attempt to fetch gems remotely and use the gem cache in-
stead.
1m--ruby 22mUpdate the locked version of Ruby to the current version of
Ruby.
@ -79,8 +79,8 @@ BUNDLE-UPDATE(1) BUNDLE-UPDATE(1)
shared dependencies to be updated.
1mUPDATING ALL GEMS0m
If you run 1mbundle update --all22m, bundler will ignore any previously
installed gems and resolve all dependencies again based on the latest
If you run 1mbundle update --all22m, bundler will ignore any previously in-
stalled gems and resolve all dependencies again based on the latest
versions of all gems available in the sources.
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,
bundler will resolve all of the dependencies, all the way down, and
install what you need:
bundler will resolve all of the dependencies, all the way down, and in-
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
1mfile.lock22m, and resolve all the dependencies again. Keep in mind that
this process can result in a significantly different set of the 25
gems, based on the requirements of new gems that the gem authors
released since the last time you ran 1mbundle update --all22m.
gems, based on the requirements of new gems that the gem authors re-
leased since the last time you ran 1mbundle update --all22m.
1mUPDATING A LIST OF GEMS0m
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
depends on 1mrack ~> 1.022m. If you run bundle install, you get:
The 1mthin 22mgem depends on 1mrack >= 1.022m, while 1mrack-perftools-profiler 22mde-
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
share 1mrack 22min common. If you run 1mbundle update thin22m, bundler will
update 1mdaemons22m, 1meventmachine 22mand 1mrack22m, which are dependencies of 1mthin22m,
share 1mrack 22min common. If you run 1mbundle update thin22m, bundler will up-
date 1mdaemons22m, 1meventmachine 22mand 1mrack22m, which are dependencies of 1mthin22m,
but not 1mopen4 22mor 1mperftools.rb22m, which are dependencies of
1mrack-perftools_profiler22m. Note that 1mbundle update thin 22mwill update 1mrack0m
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:
In this scenario, updating the 1mthin 22mversion manually in the Gemfile(5),
and then running bundle install(1) 4mbundle-install.1.html24m will only
update 1mdaemons 22mand 1meventmachine22m, but not 1mrack22m. For more information,
see the 1mCONSERVATIVE UPDATING 22msection of bundle install(1) 4mbun-0m
4mdle-install.1.html24m.
and then running bundle install(1) 4mbundle-install.1.html24m will only up-
date 1mdaemons 22mand 1meventmachine22m, but not 1mrack22m. For more information, see
the 1mCONSERVATIVE UPDATING 22msection of bundle install(1) 4mbundle-in-0m
4mstall.1.html24m.
Starting with 1.14, specifying the 1m--conservative 22moption will also pre-
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
| 1m--major22m.
When Bundler is resolving what versions to use to satisfy declared
requirements in the Gemfile or in parent gems, it looks up all avail-
able versions, filters out any versions that don't satisfy the require-
ment, and then, by default, sorts them from newest to oldest, consider-
ing them in that order.
When Bundler is resolving what versions to use to satisfy declared re-
quirements in the Gemfile or in parent gems, it looks up all available
versions, filters out any versions that don't satisfy the requirement,
and then, by default, sorts them from newest to oldest, considering
them in that order.
Providing one of the patch level options (e.g. 1m--patch22m) changes 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".
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
ensure that no gem is updated that far.
remove any versions beyond the scope of the patch level option, to en-
sure that no gem is updated that far.
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,
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".
Gem requirements as defined in the Gemfile will still be the first
determining factor for what versions are available. If the gem require-
Gem requirements as defined in the Gemfile will still be the first de-
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
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
the dependency from foo 1.4.5 required it.
In case 2, only foo is requested to be unlocked, but bar is also
allowed to move because it's not a declared dependency in the Gemfile.
In case 2, only foo is requested to be unlocked, but bar is also al-
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
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)

Просмотреть файл

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE" "1" "November 2018" "" ""
.TH "BUNDLE" "1" "January 2019" "" ""
.
.SH "NAME"
\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
Display warnings about common problems
.
.TP
\fBbundle remove(1)\fR \fIbundle\-remove\.1\.html\fR
Removes gems from the Gemfile
.
.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\.
.

Просмотреть файл

@ -56,8 +56,8 @@ BUNDLE(1) BUNDLE(1)
Generate binstubs for executables in a gem
1mbundle check(1) 4m22mbundle-check.1.html0m
Determine whether the requirements for your application are
installed and available to Bundler
Determine whether the requirements for your application are in-
stalled and available to Bundler
1mbundle show(1) 4m22mbundle-show.1.html0m
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
Display warnings about common problems
1mbundle remove(1) 4m22mbundle-remove.1.html0m
Removes gems from the Gemfile
1mPLUGINS0m
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
@ -110,4 +113,4 @@ BUNDLE(1) BUNDLE(1)
November 2018 BUNDLE(1)
January 2019 BUNDLE(1)

Просмотреть файл

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

Просмотреть файл

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GEMFILE" "5" "November 2018" "" ""
.TH "GEMFILE" "5" "January 2019" "" ""
.
.SH "NAME"
\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
\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
\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
\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
\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
As with groups, you can specify one or more platforms:

Просмотреть файл

@ -216,13 +216,13 @@ used on platforms with Ruby 2.3, use:
The full list of platforms and supported versions includes:
* `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`:
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`:
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`:
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:

Просмотреть файл

@ -43,8 +43,8 @@ GEMFILE(5) GEMFILE(5)
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
sources that need it. The command must be run once on each computer
that will install the Gemfile, but this keeps the credentials from
being stored in plain text in version control.
that will install the Gemfile, but this keeps the credentials from be-
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
exist. Some of the more well-known implementations include Rubinius
4mhttps://rubinius.com/24m, and JRuby 4mhttp://jruby.org/24m. Rubinius is an
alternative implementation of Ruby written in Ruby. JRuby is an
implementation of Ruby on the JVM, short for Java Virtual Machine.
alternative implementation of Ruby written in Ruby. JRuby is an im-
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,
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-
sions of the same gems in different groups. For more details, see
Understanding Bundler 4mhttp://bundler.io/rationale.html24m.
sions of the same gems in different groups. For more details, see Un-
derstanding Bundler 4mhttp://bundler.io/rationale.html24m.
1mPLATFORMS0m
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
You can restrict further by platform and version for all platforms
4mexcept24m for 1mrbx22m, 1mjruby22m, 1mtruffleruby 22mand 1mmswin22m.
You can restrict further by platform and version for all platforms 4mex-0m
4mcept24m for 1mrbx22m, 1mjruby22m, 1mtruffleruby 22mand 1mmswin22m.
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
@ -271,14 +271,14 @@ GEMFILE(5) GEMFILE(5)
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
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:
@ -313,8 +313,8 @@ GEMFILE(5) GEMFILE(5)
it will fall back on global sources using the ordering described in
4mSOURCE24m 4mPRIORITY24m.
Selecting a specific source repository this way also suppresses the
ambiguous gem warning described above in 4mGLOBAL24m 4mSOURCES24m 4m(#source)24m.
Selecting a specific source repository this way also suppresses the am-
biguous gem warning described above in 4mGLOBAL24m 4mSOURCES24m 4m(#source)24m.
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
@ -342,13 +342,13 @@ GEMFILE(5) GEMFILE(5)
can deliver malicious code and compromise your system. HTTPS and SSH
are strongly preferred.
The 1mgroup22m, 1mplatforms22m, and 1mrequire 22moptions are available and behave
exactly the same as they would for a normal gem.
The 1mgroup22m, 1mplatforms22m, and 1mrequire 22moptions are available and behave ex-
actly the same as they would for a normal gem.
A git repository 1mSHOULD 22mhave at least one file, at the root of the
directory containing the gem, with the extension 1m.gemspec22m. This file
1mMUST 22mcontain a valid gem specification, as expected by the 1mgem build0m
command.
A git repository 1mSHOULD 22mhave at least one file, at the root of the di-
rectory containing the gem, with the extension 1m.gemspec22m. This file 1mMUST0m
contain a valid gem specification, as expected by the 1mgem build 22mcom-
mand.
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
@ -419,8 +419,8 @@ GEMFILE(5) GEMFILE(5)
1mGIT SOURCE0m
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
argument and interpolates it into a string to return the full repo
address:
argument and interpolates it into a string to return the full repo ad-
dress:
@ -510,8 +510,8 @@ GEMFILE(5) GEMFILE(5)
Since the 1mbitbucket 22mmethod is a specialization of 1mgit_source22m, it
accepts a 1m:branch 22mnamed argument.
Since the 1mbitbucket 22mmethod is a specialization of 1mgit_source22m, it ac-
cepts a 1m:branch 22mnamed argument.
1mPATH0m
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
to prevent a group from being installed unless listed in the 1m--with0m
option given to the 1mbundle install 22mcommand.
to prevent a group from being installed unless listed in the 1m--with 22mop-
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
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
specify explicit sources. Thus, when defining source blocks, it is rec-
ommended that you also ensure all other gems in the Gemfile are using
explicit sources, either via source blocks or 1m:source 22mdirectives on
individual gems.
explicit sources, either via source blocks or 1m:source 22mdirectives on in-
dividual gems.
1mINSTALL_IF0m
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.
The 1mgemspec 22mmethod adds any runtime dependencies as gem requirements in
the default group. It also adds development dependencies as gem
requirements in the 1mdevelopment 22mgroup. Finally, it adds a gem require-
ment on your project (1m:path => '.'22m). In conjunction with 1mBundler.setup22m,
this allows you to require project files in your test code as you would
if the project were installed as a gem; you need not manipulate the
load path manually or require project files via relative paths.
the default group. It also adds development dependencies as gem re-
quirements in the 1mdevelopment 22mgroup. Finally, it adds a gem requirement
on your project (1m:path => '.'22m). In conjunction with 1mBundler.setup22m, this
allows you to require project files in your test code as you would if
the project were installed as a gem; you need not manipulate the load
path manually or require project files via relative paths.
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,
@ -650,4 +650,4 @@ GEMFILE(5) GEMFILE(5)
November 2018 GEMFILE(5)
January 2019 GEMFILE(5)

Просмотреть файл

@ -28,7 +28,7 @@ RSpec.describe "bundle executable" do
end
context "with no arguments" do
it "prints a concise help message", :bundler => "2" do
it "prints a concise help message", :bundler => "3" do
bundle! ""
expect(last_command.stderr).to be_empty
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
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"
expect(out).to eq("Bundler version #{Bundler::VERSION}")
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"
expect(out).to eq(Bundler::VERSION)
end

Просмотреть файл

@ -34,7 +34,7 @@ RSpec.describe Bundler::Definition do
end
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")
install_gemfile <<-G
@ -72,7 +72,7 @@ RSpec.describe Bundler::Definition do
G
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")
install_gemfile <<-G
@ -110,7 +110,7 @@ RSpec.describe Bundler::Definition do
G
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|
s.add_dependency "rack", "1.0"
s.add_development_dependency "net-ssh", "1.0"
@ -147,7 +147,7 @@ RSpec.describe Bundler::Definition do
G
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|
s.add_dependency "rack", "1.0"
s.add_development_dependency "net-ssh", "1.0"

Просмотреть файл

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

Просмотреть файл

@ -115,7 +115,7 @@ RSpec.describe Bundler::SourceList do
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/") }
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")
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 [
Bundler::Source::Git.new("uri" => "git://first-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
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 [
Bundler::Source::Rubygems.new,
Bundler::Source::Rubygems.new("remotes" => ["https://duplicate-rubygems.org"]),

2
spec/bundler/cache/path_spec.rb поставляемый
Просмотреть файл

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

Просмотреть файл

@ -134,6 +134,33 @@ RSpec.describe "bundle binstubs <gem>" do
if ENV["BUNDLER_SPEC_SUB_VERSION"]
let(:system_bundler_version) { Bundler::VERSION }
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
sys_exec! "#{bundled_app("bin/bundle")} 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
end
it "setting is saved for bundle install", :bundler => "< 2" do
it "setting is saved for bundle install", :bundler => "< 3" do
install_gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"

Просмотреть файл

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

Просмотреть файл

@ -142,7 +142,7 @@ RSpec.describe "bundle clean" do
bundle :clean
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
end
@ -343,7 +343,7 @@ RSpec.describe "bundle clean" do
expect(out).to include("rack (1.0.0)").and include("thin (1.0)")
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
source "file://#{gem_repo1}"
@ -363,7 +363,7 @@ RSpec.describe "bundle clean" do
should_not_have_gems "thin-1.0"
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
gemfile <<-G
@ -383,7 +383,7 @@ RSpec.describe "bundle clean" do
should_not_have_gems "foo-1.0"
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
install_gemfile! <<-G

Просмотреть файл

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

Просмотреть файл

@ -570,22 +570,7 @@ RSpec.describe "bundle exec" do
it_behaves_like "it runs"
end
context "the executable is empty", :bundler => "< 2" 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
context "the executable is empty" do
let(:executable) { "" }
let(:exit_code) { 0 }
@ -594,18 +579,7 @@ RSpec.describe "bundle exec" do
it_behaves_like "it runs"
end
context "the executable raises", :bundler => "< 2" 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
context "the executable raises" do
let(:executable) { super() << "\nraise 'ERROR'" }
let(:exit_code) { 1 }
let(:expected_err) do
@ -615,16 +589,7 @@ RSpec.describe "bundle exec" do
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(: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
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_err) { "bundler: failed to load command: #{path} (#{path})\nErr: Err" }
@ -638,7 +603,7 @@ RSpec.describe "bundle exec" do
it_behaves_like "it runs"
end
context "when Bundler.setup fails", :bundler => "< 2" do
context "when Bundler.setup fails", :bundler => "< 3" do
before do
gemfile <<-G
gem 'rack', '2'
@ -655,7 +620,7 @@ RSpec.describe "bundle exec" do
it_behaves_like "it runs"
end
context "when Bundler.setup fails", :bundler => "2" do
context "when Bundler.setup fails", :bundler => "3" do
before do
gemfile <<-G
gem 'rack', '2'
@ -800,10 +765,11 @@ __FILE__: #{path.to_s.inspect}
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"
system_gems :bundler
file = bundled_app("file_that_bundle_execs.rb")
create_file(file, <<-RB)
#!#{Gem.ruby}
puts `bundle exec echo foo`
puts `#{system_bundle_bin_path} exec echo foo`
RB
file.chmod(0o777)
bundle! "exec #{file}", :system_bundler => true

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -1,6 +1,6 @@
# 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
before :each do
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
bundle "show rails"
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
)
end
@ -44,7 +44,7 @@ RSpec.describe "bundle show", :bundler => "< 2", :ruby => ">= 2.0" do
it "prints the path to the running bundler" do
bundle "show bundler"
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
)
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
bundle "show rails --paths"
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
)
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)
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_list = out_lines[1..-1].map {|p| p.split("/").last }

Просмотреть файл

@ -11,7 +11,7 @@ RSpec.describe "bundle update" do
G
end
describe "with no arguments", :bundler => "< 2" do
describe "with no arguments", :bundler => "< 3" do
it "updates the entire bundle" do
update_repo2 do
build_gem "activesupport", "3.0"
@ -34,7 +34,7 @@ RSpec.describe "bundle update" do
end
end
describe "with --all", :bundler => "2" do
describe "with --all", :bundler => "3" do
it "updates the entire bundle" do
update_repo2 do
build_gem "activesupport", "3.0"
@ -279,7 +279,7 @@ RSpec.describe "bundle update" do
end
describe "in a frozen bundle" do
it "should fail loudly", :bundler => "< 2" do
it "should fail loudly", :bundler => "< 3" do
bundle! "install --deployment"
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)
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 "update", :all => bundle_update_requires_all?
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)
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 "update", :all => bundle_update_requires_all?
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
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
source "file://#{gem_repo2}"
gem "activesupport"
@ -315,7 +315,7 @@ RSpec.describe "bundle update" do
expect(the_bundle).to include_gem "activesupport 3.0"
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
source "file://#{gem_repo2}"
gem "activesupport"
@ -358,7 +358,7 @@ RSpec.describe "bundle update" do
G
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
build_gem "fred", "2.0"
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"
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
build_gem "fred", "2.0"
build_gem "harry", "2.0" do |s|
@ -403,7 +403,7 @@ RSpec.describe "bundle update" do
G
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
build_gem "george", "2.0"
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"
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
build_gem "george", "2.0"
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
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?
expect(last_command.stdboth).not_to match(/in snapshot/i)
expect(last_command.bundler_err).to match(/current Bundler version/i).
and match(/perhaps you need to update bundler/i)
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
expect(last_command.bundler_err).to include("rails (3.0.1) has dependency bundler").
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
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
install_gemfile <<-G

Просмотреть файл

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

Просмотреть файл

@ -1,6 +1,6 @@
# 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
graphviz_glob = base_system_gems.join("cache/ruby-graphviz*")
Pathname.glob(graphviz_glob).first

Просмотреть файл

@ -1,6 +1,6 @@
# 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
# 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
@ -20,7 +20,7 @@ RSpec.describe "bundle install", :bundler => "< 2" do
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
build_repo2 do
build_gem "fake", "14" do |s|

Просмотреть файл

@ -8,7 +8,7 @@ RSpec.describe "install with --deployment or --frozen" do
G
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
bundle "install --deployment"
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"
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"
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"
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.")
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
source "file://#{gem_repo1}"
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
let(:success_message) do
if Bundler::VERSION.split(".", 2).first == "1"
if Bundler.bundler_major_version < 3
"Could not reach host localgemserver.test"
else
"Bundle complete!"

Просмотреть файл

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

Просмотреть файл

@ -26,7 +26,7 @@ RSpec.describe "bundle install with git sources" do
expect(out).to eq("WIN")
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
end

Просмотреть файл

@ -192,19 +192,19 @@ RSpec.describe "bundle install with groups" do
expect(the_bundle).not_to include_gems "thin 1.0"
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(:with => "emo")
expect(the_bundle).to include_gems "activesupport 2.3.5"
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(:without => "debugging")
expect(the_bundle).not_to include_gem "thin 1.0"
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")
expect(last_command).to be_failure
expect(out).to include("The offending groups are: emo")

Просмотреть файл

@ -1,7 +1,7 @@
# frozen_string_literal: true
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"
install_gemfile <<-G

Просмотреть файл

@ -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"
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
update_repo2 do

Просмотреть файл

@ -28,7 +28,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
bundle "config major_deprecations true"
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
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"
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
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
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 :install
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
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
expect(out).not_to include("Warning: the gem 'rack' was found in multiple sources.")

Просмотреть файл

@ -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"
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_gem "back_deps" do |s|
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"
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
# 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
@ -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"
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
# 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
@ -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"
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_gem "back_deps" do |s|
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"
end
it "installs the binstubs", :bundler => "< 2" do
it "installs the binstubs", :bundler => "< 3" do
gemfile <<-G
source "#{source_uri}"
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")
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
source "#{source_uri}"
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
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
source "#{source_uri}"
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}")
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
source "#{basic_auth_source_uri}"
source "file://#{gem_repo1}"

Просмотреть файл

@ -243,7 +243,7 @@ RSpec.describe "gemcutter's dependency API" do
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_gem "back_deps" do |s|
s.add_dependency "foo"
@ -302,7 +302,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(the_bundle).to include_gems "rack 1.2"
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
# 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
@ -372,7 +372,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(out).to include("Fetching source index from http://localgemserver.test/extra")
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_gem "back_deps" do |s|
s.add_dependency "foo"
@ -432,7 +432,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(the_bundle).to include_gems "foo 1.0"
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_gem "back_deps" do |s|
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"
end
it "installs the binstubs", :bundler => "< 2" do
it "installs the binstubs", :bundler => "< 3" do
gemfile <<-G
source "#{source_uri}"
gem "rack"
@ -508,7 +508,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(out).to eq("1.0.0")
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
source "#{source_uri}"
gem "rack"
@ -519,7 +519,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(vendored_gems("bin/rackup")).to exist
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
source "#{source_uri}"
gem "rack"
@ -594,7 +594,7 @@ RSpec.describe "gemcutter's dependency API" do
expect(out).not_to include("#{user}:#{password}")
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
source "#{basic_auth_source_uri}"
source "file://#{gem_repo1}"

Просмотреть файл

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

Просмотреть файл

@ -197,7 +197,7 @@ RSpec.shared_examples "bundle install --standalone" do
expect(last_command.stderr).to eq("ZOMG LOAD ERROR")
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)
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")
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)
path = File.expand_path("path/to/bundle")
@ -273,7 +273,7 @@ RSpec.shared_examples "bundle install --standalone" do
end
end
describe "with --binstubs", :bundler => "< 2" do
describe "with --binstubs", :bundler => "< 3" do
before do
gemfile <<-G
source "file://#{gem_repo1}"

Просмотреть файл

@ -2,7 +2,7 @@
RSpec.describe "bundle install" 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")
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")}"
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")
rev = revision_for(lib_path("foo"))[0..6]
update_git "foo", "2.0", :path => lib_path("foo"), :gemspec => true

Просмотреть файл

@ -13,7 +13,7 @@ RSpec.describe "bundle install" do
G
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")
expect(the_bundle).to include_gems "rack 1.0.0"
end
@ -35,13 +35,13 @@ RSpec.describe "bundle install" do
expect(out).to include("gems are installed into `./vendor/bundle`")
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"
expect(out).to include("Please choose only one option.")
expect(exitstatus).to eq(15) if exitstatus
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"
FileUtils.rm_rf bundled_app("vendor")
bundle "install"
@ -53,7 +53,7 @@ RSpec.describe "bundle install" do
context "with path_relative_to_cwd set to true" do
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
bundle! "install --gemfile='#{bundled_app}/Gemfile' --path 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"
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
set_bundle_path(type, ".")
bundle! "config --global disable_shared_gems true"
@ -147,7 +147,7 @@ RSpec.describe "bundle install" do
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
set_bundle_path(type, ".")
bundle! "config --global disable_shared_gems true"

Просмотреть файл

@ -19,7 +19,7 @@ RSpec.describe "post bundle message" do
let(:bundle_complete_message) { "Bundle complete!" }
let(:bundle_updated_message) { "Bundle updated!" }
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
it "without any options" do
@ -101,7 +101,7 @@ RSpec.describe "post bundle message" do
end
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
source "file://localhost#{gem_repo1}"
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.")
end
it "should report a helpful error message", :bundler => "2" do
it "should report a helpful error message", :bundler => "3" do
install_gemfile <<-G
source "file://localhost#{gem_repo1}"
gem "rack"

Просмотреть файл

@ -1,6 +1,6 @@
# 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
gemfile <<-G
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
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
it "shows a deprecation when multiple flags passed" do
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

Просмотреть файл

@ -1,6 +1,6 @@
# frozen_string_literal: true
RSpec.describe "the lockfile format", :bundler => "< 2" do
RSpec.describe "the lockfile format", :bundler => "< 3" do
include Bundler::GemHelpers
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
version = "#{Bundler::VERSION.split(".").first}.0.0.0.a"
lockfile <<-L
lockfile normalize_uri_file(<<-L)
GEM
remote: file://localhost#{gem_repo1}/
specs:
@ -94,13 +94,13 @@ RSpec.describe "the lockfile format", :bundler => "< 2" do
#{version}
L
install_gemfile <<-G
install_gemfile normalize_uri_file(<<-G)
source "file://localhost#{gem_repo1}"
gem "rack"
G
lockfile_should_be <<-G
lockfile_should_be normalize_uri_file(<<-G)
GEM
remote: file://localhost#{gem_repo1}/
specs:

Просмотреть файл

@ -1,6 +1,6 @@
# frozen_string_literal: true
RSpec.describe "the lockfile format", :bundler => "2" do
RSpec.describe "the lockfile format", :bundler => "3" do
include Bundler::GemHelpers
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"
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"
install_gemfile <<-G

Просмотреть файл

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

Просмотреть файл

@ -1,6 +1,6 @@
# 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_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
it "warns about the https change" do
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" }
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")
end
it "upgrades to https on request" do
Bundler.settings.temporary "github.https" => true
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" }
EOS
expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(2, 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, msg)
expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, "The `github.https` setting will be removed")
subject.gem("sparks", :github => "indirect/sparks")
github_uri = "https://github.com/indirect/sparks.git"
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
allow(Bundler.ui).to receive(:deprecate)
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|
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
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")
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
allow(Bundler.ui).to receive(:deprecate)
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| " \
"\"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")
end
end

Просмотреть файл

@ -4,7 +4,7 @@ RSpec.describe "bundle platform" do
context "without flags" do
let(:bundle_platform_platforms_string) do
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")
end
@ -633,7 +633,7 @@ G
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
source "file://#{gem_repo1}"
gem "rails"
@ -645,7 +645,7 @@ G
should_be_ruby_version_incorrect
end
it "fails if engine doesn't match", :bundler => "< 2" do
it "fails if engine doesn't match", :bundler => "< 3" do
gemfile <<-G
source "file://#{gem_repo1}"
gem "rails"
@ -657,7 +657,7 @@ G
should_be_engine_incorrect
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
gemfile <<-G
source "file://#{gem_repo1}"
@ -671,7 +671,7 @@ G
end
end
it "fails when patchlevel doesn't match", :bundler => "< 2" do
it "fails when patchlevel doesn't match", :bundler => "< 3" do
gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
@ -928,7 +928,7 @@ G
end
end
context "bundle console", :bundler => "< 2" do
context "bundle console", :bundler => "< 3" do
before do
install_gemfile <<-G
source "file://#{gem_repo1}"

Просмотреть файл

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

Просмотреть файл

@ -181,6 +181,7 @@ RSpec.describe "The library itself" do
gem.coc
gem.mit
inline
lockfile_upgrade_warning
lockfile_uses_separate_rubygems_sources
use_gem_version_promoter_for_major_updates
viz_command
@ -260,7 +261,11 @@ RSpec.describe "The library itself" do
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

Просмотреть файл

@ -57,7 +57,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
expect(lockfile).to include("activemodel (3.0.5)")
end
it "resolves dependencies correctly", :ruby => "1.9.3" do
it "resolves dependencies correctly", :ruby => "<= 1.9.3" do
gemfile <<-G
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)")
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
source "https://rubygems.org"
@ -188,7 +188,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
activemodel (= 4.2.7.1)
activerecord (= 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)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)

Просмотреть файл

@ -99,7 +99,7 @@ RSpec.describe "Running bin/* commands" do
expect(bundled_app("bin/rackup")).not_to exist
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/"
bundled_app("bin/rackup").rmtree
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`")
end
it "remembers that the option was specified", :bundler => "< 2" do
it "remembers that the option was specified", :bundler => "< 3" do
gemfile <<-G
source "file://#{gem_repo1}"
gem "activesupport"

Просмотреть файл

@ -886,7 +886,9 @@ 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 ""
ENV["GEM_PATH"] = symlinked_gem_home.path
@ -1395,7 +1397,7 @@ end
end
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
source "file:#{gem_repo1}"
gem "rack"
@ -1410,7 +1412,7 @@ end
expect(out).to eq("rack-1.0.0")
end
it "keeps Kernel#gem private", :bundler => "2" do
it "keeps Kernel#gem private", :bundler => "3" do
install_gemfile! <<-G
source "file:#{gem_repo1}"
gem "rack"

Просмотреть файл

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

Просмотреть файл

@ -40,7 +40,7 @@ if ENV.select {|k, _v| k =~ /TRAVIS/ }.any? && Gem::Version.new(Gem::VERSION) >
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})"
end

Просмотреть файл

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

Просмотреть файл

@ -29,7 +29,7 @@ module Spec
end
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)
else
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)
end
def system_bundle_bin_path
system_gem_path("bin/bundle")
end
def lib_path(*args)
tmp("libs", *args)
end

Просмотреть файл

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

Просмотреть файл

@ -299,7 +299,7 @@ RSpec.describe "bundle update" do
G
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[5] = "s.version = '2.0'"
@ -335,7 +335,7 @@ RSpec.describe "bundle update" do
G
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[5] = "s.version = '2.0'"

Просмотреть файл

@ -1,6 +1,6 @@
# 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
install_gemfile <<-G
source "file://#{gem_repo1}"
@ -13,24 +13,24 @@ RSpec.describe "bundle update", :bundler => "< 2", :ruby => ">= 2.0" do
describe "with --force" do
it "shows a deprecation when single flag passed" do
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
it "shows a deprecation when multiple flags passed" do
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
describe "with --redownload" do
it "does not show a deprecation when single flag passed" do
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
it "does not show a deprecation when single multiple flags passed" do
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