ruby-changes:53307
From: hsbt <ko1@a...>
Date: Sun, 4 Nov 2018 10:15:40 +0900 (JST)
Subject: [ruby-changes:53307] hsbt:r65523 (trunk): Merge upstream changes from 2-0-stable branch of bundler/bundler.
hsbt 2018-11-04 10:14:48 +0900 (Sun, 04 Nov 2018) New Revision: 65523 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65523 Log: Merge upstream changes from 2-0-stable branch of bundler/bundler. * It update bundler 2 mode to bundler 3. Modified files: trunk/lib/bundler/feature_flag.rb trunk/man/bundle-config.1 trunk/man/bundle-config.1.txt trunk/man/bundle-install.1 trunk/man/bundle-install.1.txt trunk/man/bundle-update.1 trunk/man/bundle-update.1.txt trunk/spec/bundler/bundler/cli_spec.rb trunk/spec/bundler/bundler/definition_spec.rb trunk/spec/bundler/bundler/dsl_spec.rb trunk/spec/bundler/bundler/source_list_spec.rb trunk/spec/bundler/bundler/ui/shell_spec.rb trunk/spec/bundler/cache/path_spec.rb trunk/spec/bundler/commands/binstubs_spec.rb trunk/spec/bundler/commands/check_spec.rb trunk/spec/bundler/commands/clean_spec.rb trunk/spec/bundler/commands/console_spec.rb trunk/spec/bundler/commands/exec_spec.rb trunk/spec/bundler/commands/init_spec.rb trunk/spec/bundler/commands/inject_spec.rb trunk/spec/bundler/commands/install_spec.rb trunk/spec/bundler/commands/list_spec.rb trunk/spec/bundler/commands/outdated_spec.rb trunk/spec/bundler/commands/package_spec.rb trunk/spec/bundler/commands/show_spec.rb trunk/spec/bundler/commands/update_spec.rb trunk/spec/bundler/commands/version_spec.rb trunk/spec/bundler/commands/viz_spec.rb trunk/spec/bundler/install/binstubs_spec.rb trunk/spec/bundler/install/deploy_spec.rb trunk/spec/bundler/install/gemfile/gemspec_spec.rb trunk/spec/bundler/install/gemfile/git_spec.rb trunk/spec/bundler/install/gemfile/groups_spec.rb trunk/spec/bundler/install/gemfile/path_spec.rb trunk/spec/bundler/install/gemfile/platform_spec.rb trunk/spec/bundler/install/gemfile/sources_spec.rb trunk/spec/bundler/install/gems/compact_index_spec.rb trunk/spec/bundler/install/gems/dependency_api_spec.rb trunk/spec/bundler/install/gems/flex_spec.rb trunk/spec/bundler/install/gems/standalone_spec.rb trunk/spec/bundler/install/git_spec.rb trunk/spec/bundler/install/path_spec.rb trunk/spec/bundler/install/post_bundle_message_spec.rb trunk/spec/bundler/install/redownload_spec.rb trunk/spec/bundler/lock/lockfile_bundler_1_spec.rb trunk/spec/bundler/lock/lockfile_spec.rb trunk/spec/bundler/other/bundle_ruby_spec.rb trunk/spec/bundler/other/major_deprecation_spec.rb trunk/spec/bundler/other/platform_spec.rb trunk/spec/bundler/plugins/source/example_spec.rb trunk/spec/bundler/runtime/executable_spec.rb trunk/spec/bundler/runtime/setup_spec.rb trunk/spec/bundler/runtime/with_clean_env_spec.rb trunk/spec/bundler/update/git_spec.rb trunk/spec/bundler/update/redownload_spec.rb Index: spec/bundler/install/gemfile/path_spec.rb =================================================================== --- spec/bundler/install/gemfile/path_spec.rb (revision 65522) +++ spec/bundler/install/gemfile/path_spec.rb (revision 65523) @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/path_spec.rb#L1 # 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 Index: spec/bundler/install/gemfile/git_spec.rb =================================================================== --- spec/bundler/install/gemfile/git_spec.rb (revision 65522) +++ spec/bundler/install/gemfile/git_spec.rb (revision 65523) @@ -26,7 +26,7 @@ RSpec.describe "bundle install with git https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/git_spec.rb#L26 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 Index: spec/bundler/install/path_spec.rb =================================================================== --- spec/bundler/install/path_spec.rb (revision 65522) +++ spec/bundler/install/path_spec.rb (revision 65523) @@ -13,7 +13,7 @@ RSpec.describe "bundle install" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/path_spec.rb#L13 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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/path_spec.rb#L35 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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/path_spec.rb#L53 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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/path_spec.rb#L113 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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/path_spec.rb#L147 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" Index: spec/bundler/install/gems/standalone_spec.rb =================================================================== --- spec/bundler/install/gems/standalone_spec.rb (revision 65522) +++ spec/bundler/install/gems/standalone_spec.rb (revision 65523) @@ -197,7 +197,7 @@ RSpec.shared_examples "bundle install -- https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gems/standalone_spec.rb#L197 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 -- https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gems/standalone_spec.rb#L213 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 -- https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gems/standalone_spec.rb#L273 end end - describe "with --binstubs", :bundler => "< 2" do + describe "with --binstubs", :bundler => "< 3" do before do gemfile <<-G source "file://#{gem_repo1}" Index: spec/bundler/lock/lockfile_spec.rb =================================================================== --- spec/bundler/lock/lockfile_spec.rb (revision 65522) +++ spec/bundler/lock/lockfile_spec.rb (revision 65523) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/bundler/lock/lockfile_spec.rb#L1 # 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", :b https://github.com/ruby/ruby/blob/trunk/spec/bundler/lock/lockfile_spec.rb#L428 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 Index: spec/bundler/bundler/definition_spec.rb =================================================================== --- spec/bundler/bundler/definition_spec.rb (revision 65522) +++ spec/bundler/bundler/definition_spec.rb (revision 65523) @@ -32,7 +32,7 @@ RSpec.describe Bundler::Definition do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/definition_spec.rb#L32 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 @@ -70,7 +70,7 @@ RSpec.describe Bundler::Definition do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/definition_spec.rb#L70 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 @@ -108,7 +108,7 @@ RSpec.describe Bundler::Definition do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/definition_spec.rb#L108 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" @@ -145,7 +145,7 @@ RSpec.describe Bundler::Definition do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/definition_spec.rb#L145 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" Index: spec/bundler/bundler/cli_spec.rb =================================================================== --- spec/bundler/bundler/cli_spec.rb (revision 65522) +++ spec/bundler/bundler/cli_spec.rb (revision 65523) @@ -28,7 +28,7 @@ RSpec.describe "bundle executable" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/cli_spec.rb#L28 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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/cli_spec.rb#L161 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 Index: spec/bundler/bundler/source_list_spec.rb =================================================================== --- spec/bundler/bundler/source_list_spec.rb (revision 65522) +++ spec/bundler/bundler/source_list_spec.rb (revision 65523) @@ -115,7 +115,7 @@ RSpec.describe Bundler::SourceList do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/source_list_spec.rb#L115 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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/source_list_spec.rb#L372 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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/source_list_spec.rb#L391 ] 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"]), Index: spec/bundler/bundler/ui/shell_spec.rb =================================================================== --- spec/bundler/bundler/ui/shell_spec.rb (revision 65522) +++ spec/bundler/bundler/ui/shell_spec.rb (revision 65523) @@ -21,7 +21,7 @@ RSpec.describe Bundler::UI::Shell do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/ui/shell_spec.rb#L21 describe "#warn" do before { subject.level = "warn" } - it "prints to stdout", :bundler => "< 2" do + it "prints to stdout", :bundler => "< 3" do expect { subject.warn("warning") }.to output("warning\n").to_stdout end @@ -46,7 +46,7 @@ RSpec.describe Bundler::UI::Shell do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/ui/shell_spec.rb#L46 describe "#error" do before { subject.level = "error" } - it "prints to stdout", :bundler => "< 2" do + it "prints to stdout", :bundler => "< 3" do expect { subject.error("error!!!") }.to output("error!!!\n").to_stdout end Index: spec/bundler/bundler/dsl_spec.rb =================================================================== --- spec/bundler/bundler/dsl_spec.rb (revision 65522) +++ spec/bundler/bundler/dsl_spec.rb (revision 65523) @@ -25,7 +25,7 @@ RSpec.describe Bundler::Dsl do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/dsl_spec.rb#L25 expect { subject.git_source(:example) }.to raise_error(Bundler::InvalidOption) end - context "default hosts (git, gist)", :bundler => "< 2" do + context "default hosts (git, gist)", :bundler => "< 3" do it "converts :github to :git" do subject.gem("sparks", :github => "indirect/sparks") github_uri = "git://github.com/indirect/sparks.git" @@ -63,7 +63,7 @@ RSpec.describe Bundler::Dsl do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/dsl_spec.rb#L63 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 @@ -229,7 +229,7 @@ RSpec.describe Bundler::Dsl do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/dsl_spec.rb#L229 # 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 @@ -242,7 +242,7 @@ RSpec.describe Bundler::Dsl do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/dsl_spec.rb#L242 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] Index: spec/bundler/commands/viz_spec.rb =================================================================== --- spec/bundler/commands/viz_spec.rb (revision 65522) +++ spec/bundler/commands/viz_spec.rb (revision 65523) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/viz_spec.rb#L1 # 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 Index: spec/bundler/commands/outdated_spec.rb =================================================================== --- spec/bundler/commands/outdated_spec.rb (revision 65522) +++ spec/bundler/commands/outdated_spec.rb (revision 65523) @@ -407,7 +407,7 @@ RSpec.describe "bundle outdated" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/outdated_spec.rb#L407 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}" Index: spec/bundler/commands/list_spec.rb =================================================================== --- spec/bundler/commands/list_spec.rb (revision 65522) +++ spec/bundler/commands/list_spec.rb (revision 65523) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/list_spec.rb#L1 # 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}" Index: spec/bundler/commands/inject_spec.rb =================================================================== --- spec/bundler/commands/inject_spec.rb (revision 65522) +++ spec/bundler/commands/inject_spec.rb (revision 65523) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/inject_spec.rb#L1 # 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}" Index: spec/bundler/commands/check_spec.rb =================================================================== --- spec/bundler/commands/check_spec.rb (revision 65522) +++ spec/bundler/commands/check_spec.rb (revision 65523) @@ -92,7 +92,7 @@ RSpec.describe "bundle check" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/check_spec.rb#L92 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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/check_spec.rb#L238 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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/check_spec.rb#L254 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 Index: spec/bundler/commands/show_spec.rb =================================================================== --- spec/bundler/commands/show_spec.rb (revision 65522) +++ spec/bundler/commands/show_spec.rb (revision 65523) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/show_spec.rb#L1 # 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 Index: spec/bundler/commands/update_spec.rb =================================================================== --- spec/bundler/commands/update_spec.rb (revision 65522) +++ spec/bundler/commands/update_spec.rb (revision 65523) @@ -11,7 +11,7 @@ R (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/