[前][次][番号順一覧][スレッド一覧]

ruby-changes:53456

From: hsbt <ko1@a...>
Date: Mon, 12 Nov 2018 09:53:22 +0900 (JST)
Subject: [ruby-changes:53456] hsbt:r65672 (trunk): Merge Bundler-2.0.0.pre1 from upstream.

hsbt	2018-11-12 09:53:15 +0900 (Mon, 12 Nov 2018)

  New Revision: 65672

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65672

  Log:
    Merge Bundler-2.0.0.pre1 from upstream.

  Modified files:
    trunk/bin/bundle_ruby
    trunk/lib/bundler/capistrano.rb
    trunk/lib/bundler/cli/console.rb
    trunk/lib/bundler/cli/install.rb
    trunk/lib/bundler/cli/update.rb
    trunk/lib/bundler/cli.rb
    trunk/lib/bundler/definition.rb
    trunk/lib/bundler/deployment.rb
    trunk/lib/bundler/dsl.rb
    trunk/lib/bundler/feature_flag.rb
    trunk/lib/bundler/rubygems_integration.rb
    trunk/lib/bundler/settings.rb
    trunk/lib/bundler/shared_helpers.rb
    trunk/lib/bundler/version.rb
    trunk/lib/bundler/vlad.rb
    trunk/lib/bundler.rb
    trunk/spec/bundler/bundler/ui/shell_spec.rb
    trunk/spec/bundler/commands/binstubs_spec.rb
    trunk/spec/bundler/commands/clean_spec.rb
    trunk/spec/bundler/commands/exec_spec.rb
    trunk/spec/bundler/commands/init_spec.rb
    trunk/spec/bundler/commands/pristine_spec.rb
    trunk/spec/bundler/commands/show_spec.rb
    trunk/spec/bundler/install/deploy_spec.rb
    trunk/spec/bundler/install/post_bundle_message_spec.rb
    trunk/spec/bundler/install/redownload_spec.rb
    trunk/spec/bundler/other/major_deprecation_spec.rb
    trunk/spec/bundler/other/platform_spec.rb
    trunk/spec/bundler/quality_spec.rb
    trunk/spec/bundler/realworld/edgecases_spec.rb
    trunk/spec/bundler/runtime/gem_tasks_spec.rb
    trunk/spec/bundler/support/helpers.rb
    trunk/spec/bundler/support/path.rb
    trunk/spec/bundler/support/platforms.rb
    trunk/spec/bundler/support/rubygems_ext.rb
    trunk/spec/bundler/update/redownload_spec.rb
Index: bin/bundle_ruby
===================================================================
--- bin/bundle_ruby	(revision 65671)
+++ bin/bundle_ruby	(revision 65672)
@@ -3,7 +3,7 @@ https://github.com/ruby/ruby/blob/trunk/bin/bundle_ruby#L3
 
 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 }
 
Index: spec/bundler/runtime/gem_tasks_spec.rb
===================================================================
--- spec/bundler/runtime/gem_tasks_spec.rb	(revision 65671)
+++ spec/bundler/runtime/gem_tasks_spec.rb	(revision 65672)
@@ -19,7 +19,7 @@ RSpec.describe "require 'bundler/gem_tas https://github.com/ruby/ruby/blob/trunk/spec/bundler/runtime/gem_tasks_spec.rb#L19
 
   it "includes the relevant tasks" do
     with_gem_path_as(Spec::Path.base_system_gems.to_s) do
-      sys_exec "ruby -S rake -T"
+      sys_exec "#{rake} -T"
     end
 
     expect(err).to eq("")
@@ -37,7 +37,7 @@ RSpec.describe "require 'bundler/gem_tas https://github.com/ruby/ruby/blob/trunk/spec/bundler/runtime/gem_tasks_spec.rb#L37
 
   it "adds 'pkg' to rake/clean's CLOBBER" do
     with_gem_path_as(Spec::Path.base_system_gems.to_s) do
-      sys_exec! %('#{Gem.ruby}' -S rake -e 'load "Rakefile"; puts CLOBBER.inspect')
+      sys_exec! %(#{rake} -e 'load "Rakefile"; puts CLOBBER.inspect')
     end
     expect(last_command.stdout).to eq '["pkg"]'
   end
Index: spec/bundler/quality_spec.rb
===================================================================
--- spec/bundler/quality_spec.rb	(revision 65671)
+++ spec/bundler/quality_spec.rb	(revision 65672)
@@ -181,6 +181,7 @@ RSpec.describe "The library itself" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/quality_spec.rb#L181
       gem.coc
       gem.mit
       inline
+      lockfile_upgrade_warning
       lockfile_uses_separate_rubygems_sources
       use_gem_version_promoter_for_major_updates
       viz_command
Index: spec/bundler/install/redownload_spec.rb
===================================================================
--- spec/bundler/install/redownload_spec.rb	(revision 65671)
+++ spec/bundler/install/redownload_spec.rb	(revision 65672)
@@ -65,12 +65,12 @@ RSpec.describe "bundle install", :bundle https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/redownload_spec.rb#L65
 
     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
 
Index: spec/bundler/install/post_bundle_message_spec.rb
===================================================================
--- spec/bundler/install/post_bundle_message_spec.rb	(revision 65671)
+++ spec/bundler/install/post_bundle_message_spec.rb	(revision 65672)
@@ -19,7 +19,7 @@ RSpec.describe "post bundle message" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/post_bundle_message_spec.rb#L19
   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
Index: spec/bundler/install/deploy_spec.rb
===================================================================
--- spec/bundler/install/deploy_spec.rb	(revision 65671)
+++ spec/bundler/install/deploy_spec.rb	(revision 65672)
@@ -297,7 +297,7 @@ RSpec.describe "install with --deploymen https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/deploy_spec.rb#L297
 
     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!"
Index: spec/bundler/bundler/ui/shell_spec.rb
===================================================================
--- spec/bundler/bundler/ui/shell_spec.rb	(revision 65671)
+++ spec/bundler/bundler/ui/shell_spec.rb	(revision 65672)
@@ -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 => "< 3" do
+    it "prints to stdout", :bundler => "< 2" 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 => "< 3" do
+    it "prints to stdout", :bundler => "< 2" do
       expect { subject.error("error!!!") }.to output("error!!!\n").to_stdout
     end
 
Index: spec/bundler/realworld/edgecases_spec.rb
===================================================================
--- spec/bundler/realworld/edgecases_spec.rb	(revision 65671)
+++ spec/bundler/realworld/edgecases_spec.rb	(revision 65672)
@@ -57,7 +57,7 @@ RSpec.describe "real world edgecases", : https://github.com/ruby/ruby/blob/trunk/spec/bundler/realworld/edgecases_spec.rb#L57
     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", : https://github.com/ruby/ruby/blob/trunk/spec/bundler/realworld/edgecases_spec.rb#L70
     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"
 
Index: spec/bundler/support/helpers.rb
===================================================================
--- spec/bundler/support/helpers.rb	(revision 65671)
+++ spec/bundler/support/helpers.rb	(revision 65672)
@@ -53,7 +53,7 @@ module Spec https://github.com/ruby/ruby/blob/trunk/spec/bundler/support/helpers.rb#L53
     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)
@@ -152,7 +152,7 @@ module Spec https://github.com/ruby/ruby/blob/trunk/spec/bundler/support/helpers.rb#L152
     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?
Index: spec/bundler/support/platforms.rb
===================================================================
--- spec/bundler/support/platforms.rb	(revision 65671)
+++ spec/bundler/support/platforms.rb	(revision 65672)
@@ -106,7 +106,7 @@ module Spec https://github.com/ruby/ruby/blob/trunk/spec/bundler/support/platforms.rb#L106
     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]
Index: spec/bundler/support/rubygems_ext.rb
===================================================================
--- spec/bundler/support/rubygems_ext.rb	(revision 65671)
+++ spec/bundler/support/rubygems_ext.rb	(revision 65672)
@@ -33,7 +33,7 @@ module Spec https://github.com/ruby/ruby/blob/trunk/spec/bundler/support/rubygems_ext.rb#L33
 
       ENV["BUNDLE_PATH"] = nil
       ENV["GEM_HOME"] = ENV["GEM_PATH"] = Path.base_system_gems.to_s
-      ENV["PATH"] = ["#{Path.root}/exe", "#{Path.system_gem_path}/bin", ENV["PATH"]].join(File::PATH_SEPARATOR)
+      ENV["PATH"] = [Path.bindir, "#{Path.system_gem_path}/bin", ENV["PATH"]].join(File::PATH_SEPARATOR)
 
       manifest = DEPS.to_a.sort_by(&:first).map {|k, v| "#{k} => #{v}\n" }
       manifest_path = "#{Path.base_system_gems}/manifest.txt"
Index: spec/bundler/support/path.rb
===================================================================
--- spec/bundler/support/path.rb	(revision 65671)
+++ spec/bundler/support/path.rb	(revision 65672)
@@ -29,7 +29,7 @@ module Spec https://github.com/ruby/ruby/blob/trunk/spec/bundler/support/path.rb#L29
     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)
Index: spec/bundler/commands/show_spec.rb
===================================================================
--- spec/bundler/commands/show_spec.rb	(revision 65671)
+++ spec/bundler/commands/show_spec.rb	(revision 65672)
@@ -36,7 +36,7 @@ RSpec.describe "bundle show", :bundler = https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/show_spec.rb#L36
       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 = https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/show_spec.rb#L44
       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 = https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/show_spec.rb#L52
       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 = https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/show_spec.rb#L64
         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 }
Index: spec/bundler/commands/clean_spec.rb
===================================================================
--- spec/bundler/commands/clean_spec.rb	(revision 65671)
+++ spec/bundler/commands/clean_spec.rb	(revision 65672)
@@ -142,7 +142,7 @@ RSpec.describe "bundle clean" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/clean_spec.rb#L142
     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
 
Index: spec/bundler/commands/exec_spec.rb
===================================================================
--- spec/bundler/commands/exec_spec.rb	(revision 65671)
+++ spec/bundler/commands/exec_spec.rb	(revision 65672)
@@ -570,22 +570,7 @@ RSpec.describe "bundle exec" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/exec_spec.rb#L570
       it_behaves_like "it runs"
     end
 
-    context "the executable is empty", :bundler => "< 3" 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 => "3" do
+    context "the executable is empty" do
       let(:executable) { "" }
 
       let(:exit_code) { 0 }
@@ -594,18 +579,7 @@ RSpec.describe "bundle exec" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/exec_spec.rb#L579
       it_behaves_like "it runs"
     end
 
-    context "the executable raises", :bundler => "< 3" 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 => "3" 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 https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/exec_spec.rb#L589
       it_behaves_like "it runs"
     end
 
-    context "the executable raises an error without a backtrace", :bundler => "< 3" 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 => "3" 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" }
Index: spec/bundler/commands/binstubs_spec.rb
===================================================================
--- spec/bundler/commands/binstubs_spec.rb	(revision 65671)
+++ spec/bundler/commands/binstubs_spec.rb	(revision 65672)
@@ -134,6 +134,33 @@ RSpec.describe "bundle binstubs <gem>" d https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L134
         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"])
Index: spec/bundler/commands/pristine_spec.rb
===================================================================
--- spec/bundler/commands/pristine_spec.rb	(revision 65671)
+++ spec/bundler/commands/pristine_spec.rb	(revision 65672)
@@ -49,7 +49,7 @@ RSpec.describe "bundle pristine", :ruby_ https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/pristine_spec.rb#L49
       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
Index: spec/bundler/commands/init_spec.rb
===================================================================
--- spec/bundler/commands/init_spec.rb	(revision 65671)
+++ spec/bundler/commands/init_spec.rb	(revision 65672)
@@ -115,7 +115,7 @@ RSpec.describe "bundle init" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/init_spec.rb#L115
 
       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
Index: spec/bundler/other/platform_spec.rb
===================================================================
--- spec/bundler/other/platform_spec.rb	(revision 65671)
+++ spec/bundler/other/platform_spec.rb	(revision 65672)
@@ -4,7 +4,7 @@ RSpec.describe "bundle platform" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/other/platform_spec.rb#L4
   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
 
Index: spec/bundler/other/major_deprecation_spec.rb
===================================================================
--- spec/bundler/other/major_deprecation_spec.rb	(revision 65671)
+++ spec/bundler/other/major_deprecation_spec.rb	(revision 65672)
@@ -205,7 +205,7 @@ The :github git source is deprecated, an https://github.com/ruby/ruby/blob/trunk/spec/bundler/other/major_deprecation_spec.rb#L205
     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
 
@@ -217,8 +217,8 @@ The :github git source is deprecated, an https://github.com/ruby/ruby/blob/trunk/spec/bundler/other/major_deprecation_spec.rb#L217
     git_source(:github) {|repo_name| "https (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]