ruby-changes:53818
From: hsbt <ko1@a...>
Date: Tue, 27 Nov 2018 21:08:27 +0900 (JST)
Subject: [ruby-changes:53818] hsbt:r66036 (trunk): Merge bundler-2.0.0.pre.2 from upstream.
hsbt 2018-11-27 21:08:19 +0900 (Tue, 27 Nov 2018) New Revision: 66036 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66036 Log: Merge bundler-2.0.0.pre.2 from upstream. Modified files: trunk/lib/bundler/build_metadata.rb trunk/lib/bundler/dsl.rb trunk/lib/bundler/feature_flag.rb trunk/lib/bundler/templates/newgem/Gemfile.tt trunk/lib/bundler/version.rb trunk/man/bundle-add.1 trunk/man/bundle-add.1.txt trunk/man/bundle-binstubs.1 trunk/man/bundle-binstubs.1.txt trunk/man/bundle-check.1 trunk/man/bundle-check.1.txt trunk/man/bundle-clean.1 trunk/man/bundle-clean.1.txt trunk/man/bundle-doctor.1 trunk/man/bundle-doctor.1.txt trunk/man/bundle-exec.1 trunk/man/bundle-exec.1.txt trunk/man/bundle-gem.1 trunk/man/bundle-gem.1.txt trunk/man/bundle-info.1 trunk/man/bundle-info.1.txt trunk/man/bundle-init.1 trunk/man/bundle-init.1.txt trunk/man/bundle-inject.1 trunk/man/bundle-inject.1.txt trunk/man/bundle-list.1 trunk/man/bundle-list.1.txt trunk/man/bundle-lock.1 trunk/man/bundle-lock.1.txt trunk/man/bundle-open.1 trunk/man/bundle-open.1.txt trunk/man/bundle-outdated.1 trunk/man/bundle-outdated.1.txt trunk/man/bundle-package.1 trunk/man/bundle-package.1.txt trunk/man/bundle-platform.1 trunk/man/bundle-platform.1.txt trunk/man/bundle-pristine.1 trunk/man/bundle-pristine.1.txt trunk/man/bundle-remove.1 trunk/man/bundle-remove.1.txt trunk/man/bundle-show.1 trunk/man/bundle-show.1.txt trunk/man/bundle-viz.1 trunk/man/bundle-viz.1.txt trunk/man/bundle.1 trunk/man/bundle.1.txt trunk/man/gemfile.5 trunk/man/gemfile.5.txt trunk/spec/bundler/bundler/dsl_spec.rb trunk/spec/bundler/other/major_deprecation_spec.rb Index: spec/bundler/other/major_deprecation_spec.rb =================================================================== --- spec/bundler/other/major_deprecation_spec.rb (revision 66035) +++ spec/bundler/other/major_deprecation_spec.rb (revision 66036) @@ -200,7 +200,7 @@ RSpec.describe "major deprecations", :bu https://github.com/ruby/ruby/blob/trunk/spec/bundler/other/major_deprecation_spec.rb#L200 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" } @@ -212,7 +212,7 @@ The :github git source is deprecated, an https://github.com/ruby/ruby/blob/trunk/spec/bundler/other/major_deprecation_spec.rb#L212 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" } @@ -229,7 +229,7 @@ The :github git source is deprecated, an https://github.com/ruby/ruby/blob/trunk/spec/bundler/other/major_deprecation_spec.rb#L229 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("/") @@ -247,7 +247,7 @@ The :bitbucket git source is deprecated, https://github.com/ruby/ruby/blob/trunk/spec/bundler/other/major_deprecation_spec.rb#L247 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(3, msg) Index: spec/bundler/bundler/dsl_spec.rb =================================================================== --- spec/bundler/bundler/dsl_spec.rb (revision 66035) +++ spec/bundler/bundler/dsl_spec.rb (revision 66036) @@ -25,7 +25,23 @@ 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 "github_https feature flag" do + it "is true when github.https is true" do + bundle "config github.https true" + expect(Bundler.feature_flag.github_https?).to eq "true" + end + end + 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 + subject.gem("sparks", :github => "indirect/sparks") + github_uri = "https://github.com/indirect/sparks.git" + expect(subject.dependencies.first.source.uri).to eq(github_uri) + end + end + it "converts :github to :git" do subject.gem("sparks", :github => "indirect/sparks") github_uri = "git://github.com/indirect/sparks.git" Index: lib/bundler/dsl.rb =================================================================== --- lib/bundler/dsl.rb (revision 66035) +++ lib/bundler/dsl.rb (revision 66036) @@ -474,7 +474,7 @@ repo_name ||= user_name https://github.com/ruby/ruby/blob/trunk/lib/bundler/dsl.rb#L474 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 @@ -499,7 +499,7 @@ repo_name ||= user_name https://github.com/ruby/ruby/blob/trunk/lib/bundler/dsl.rb#L499 end Bundler::SharedHelpers.major_deprecation 3, <<-EOS -The :#{name} git source is deprecated, and will be removed in Bundler 2.0.#{additional_message} Add this code to the top of your Gemfile to ensure it continues to work: +The :#{name} git source is deprecated, and will be removed in Bundler 3.0.#{additional_message} Add this code to the top of your Gemfile to ensure it continues to work: git_source(:#{name}) #{replacement} Index: lib/bundler/templates/newgem/Gemfile.tt =================================================================== --- lib/bundler/templates/newgem/Gemfile.tt (revision 66035) +++ lib/bundler/templates/newgem/Gemfile.tt (revision 66036) @@ -1,6 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/lib/bundler/templates/newgem/Gemfile.tt#L1 source "https://rubygems.org" -git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } - # Specify your gem's dependencies in <%= config[:name] %>.gemspec gemspec Index: lib/bundler/build_metadata.rb =================================================================== --- lib/bundler/build_metadata.rb (revision 66035) +++ lib/bundler/build_metadata.rb (revision 66036) @@ -28,12 +28,19 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/build_metadata.rb#L28 # If Bundler has been installed without its .git directory and without a # commit instance variable then we can't determine its commits SHA. git_dir = File.join(File.expand_path("../../..", __FILE__), ".git") - return "unknown" unless File.directory?(git_dir) + if File.directory?(git_dir) + return @git_commit_sha = Dir.chdir(git_dir) { `git rev-parse --short HEAD`.strip.freeze } + end - # Otherwise shell out to git. - @git_commit_sha = Dir.chdir(File.expand_path("..", __FILE__)) do - `git rev-parse --short HEAD`.strip.freeze + # If Bundler is a submodule in RubyGems, get the submodule commit + git_sub_dir = File.join(File.expand_path("../../../..", __FILE__), ".git") + if File.directory?(git_sub_dir) + return @git_commit_sha = Dir.chdir(git_sub_dir) do + `git ls-tree --abbrev=8 HEAD bundler`.split(/\s/).fetch(2, "").strip.freeze + end end + + @git_commit_sha ||= "unknown" end # Whether this is an official release build of Bundler. Index: lib/bundler/feature_flag.rb =================================================================== --- lib/bundler/feature_flag.rb (revision 66035) +++ lib/bundler/feature_flag.rb (revision 66036) @@ -61,6 +61,8 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/feature_flag.rb#L61 settings_option(:default_cli_command) { bundler_3_mode? ? :cli_help : :install } + settings_method(:github_https?, "github.https") { bundler_2_mode? } + def initialize(bundler_version) @bundler_version = Gem::Version.create(bundler_version) end Index: lib/bundler/version.rb =================================================================== --- lib/bundler/version.rb (revision 66035) +++ lib/bundler/version.rb (revision 66036) @@ -7,7 +7,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/version.rb#L7 # 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 = "2.0.0.pre.1" unless defined?(::Bundler::VERSION) + VERSION = "2.0.0.pre.2" unless defined?(::Bundler::VERSION) def self.overwrite_loaded_gem_version begin Index: man/bundle-remove.1.txt =================================================================== --- man/bundle-remove.1.txt (revision 66035) +++ man/bundle-remove.1.txt (revision 66036) @@ -31,4 +31,4 @@ BUNDLE-REMOVE(1) BUNDLE-REMOVE https://github.com/ruby/ruby/blob/trunk/man/bundle-remove.1.txt#L31 - October 2018 BUNDLE-REMOVE(1) + November 2018 BUNDLE-REMOVE(1) Index: man/bundle-check.1 =================================================================== --- man/bundle-check.1 (revision 66035) +++ man/bundle-check.1 (revision 66036) @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/man/bundle-check.1#L1 .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-CHECK" "1" "June 2018" "" "" +.TH "BUNDLE\-CHECK" "1" "November 2018" "" "" . .SH "NAME" \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems Index: man/bundle-open.1.txt =================================================================== --- man/bundle-open.1.txt (revision 66035) +++ man/bundle-open.1.txt (revision 66036) @@ -26,4 +26,4 @@ BUNDLE-OPEN(1) BUNDLE-OPEN(1) https://github.com/ruby/ruby/blob/trunk/man/bundle-open.1.txt#L26 - May 2018 BUNDLE-OPEN(1) + November 2018 BUNDLE-OPEN(1) Index: man/bundle-clean.1 =================================================================== --- man/bundle-clean.1 (revision 66035) +++ man/bundle-clean.1 (revision 66036) @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/man/bundle-clean.1#L1 .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-CLEAN" "1" "May 2018" "" "" +.TH "BUNDLE\-CLEAN" "1" "November 2018" "" "" . .SH "NAME" \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory Index: man/bundle-inject.1.txt =================================================================== --- man/bundle-inject.1.txt (revision 66035) +++ man/bundle-inject.1.txt (revision 66036) @@ -29,4 +29,4 @@ BUNDLE-INJECT(1) BUNDLE-INJECT https://github.com/ruby/ruby/blob/trunk/man/bundle-inject.1.txt#L29 - June 2018 BUNDLE-INJECT(1) + November 2018 BUNDLE-INJECT(1) Index: man/bundle-info.1 =================================================================== --- man/bundle-info.1 (revision 66035) +++ man/bundle-info.1 (revision 66036) @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/man/bundle-info.1#L1 .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-INFO" "1" "May 2018" "" "" +.TH "BUNDLE\-INFO" "1" "November 2018" "" "" . .SH "NAME" \fBbundle\-info\fR \- Show information for the given gem in your bundle Index: man/bundle-show.1.txt =================================================================== --- man/bundle-show.1.txt (revision 66035) +++ man/bundle-show.1.txt (revision 66036) @@ -24,4 +24,4 @@ BUNDLE-SHOW(1) BUNDLE-SHOW(1) https://github.com/ruby/ruby/blob/trunk/man/bundle-show.1.txt#L24 - October 2018 BUNDLE-SHOW(1) + November 2018 BUNDLE-SHOW(1) Index: man/bundle-platform.1.txt =================================================================== --- man/bundle-platform.1.txt (revision 66035) +++ man/bundle-platform.1.txt (revision 66036) @@ -54,4 +54,4 @@ BUNDLE-PLATFORM(1) BUNDLE-PLATFO https://github.com/ruby/ruby/blob/trunk/man/bundle-platform.1.txt#L54 - May 2018 BUNDLE-PLATFORM(1) + November 2018 BUNDLE-PLATFORM(1) Index: man/gemfile.5 =================================================================== --- man/gemfile.5 (revision 66035) +++ man/gemfile.5 (revision 66036) @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/man/gemfile.5#L1 .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GEMFILE" "5" "October 2018" "" "" +.TH "GEMFILE" "5" "November 2018" "" "" . .SH "NAME" \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs Index: man/bundle-lock.1.txt =================================================================== --- man/bundle-lock.1.txt (revision 66035) +++ man/bundle-lock.1.txt (revision 66036) @@ -90,4 +90,4 @@ BUNDLE-LOCK(1) BUNDLE-LOCK(1) https://github.com/ruby/ruby/blob/trunk/man/bundle-lock.1.txt#L90 - October 2018 BUNDLE-LOCK(1) + November 2018 BUNDLE-LOCK(1) Index: man/bundle-add.1.txt =================================================================== --- man/bundle-add.1.txt (revision 66035) +++ man/bundle-add.1.txt (revision 66036) @@ -49,4 +49,4 @@ BUNDLE-ADD(1) BUNDLE-ADD(1) https://github.com/ruby/ruby/blob/trunk/man/bundle-add.1.txt#L49 - October 2018 BUNDLE-ADD(1) + November 2018 BUNDLE-ADD(1) Index: man/bundle-doctor.1.txt =================================================================== --- man/bundle-doctor.1.txt (revision 66035) +++ man/bundle-doctor.1.txt (revision 66036) @@ -41,4 +41,4 @@ BUNDLE-DOCTOR(1) BUNDLE-DOCTOR https://github.com/ruby/ruby/blob/trunk/man/bundle-doctor.1.txt#L41 - June 2018 BUNDLE-DOCTOR(1) + November 2018 BUNDLE-DOCTOR(1) Index: man/bundle-package.1.txt =================================================================== --- man/bundle-package.1.txt (revision 66035) +++ man/bundle-package.1.txt (revision 66036) @@ -76,4 +76,4 @@ BUNDLE-PACKAGE(1) BUNDLE-PACKAG https://github.com/ruby/ruby/blob/trunk/man/bundle-package.1.txt#L76 - October 2018 BUNDLE-PACKAGE(1) + November 2018 BUNDLE-PACKAGE(1) Index: man/bundle-list.1 =================================================================== --- man/bundle-list.1 (revision 66035) +++ man/bundle-list.1 (revision 66036) @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/man/bundle-list.1#L1 .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-LIST" "1" "October 2018" "" "" +.TH "BUNDLE\-LIST" "1" "November 2018" "" "" . .SH "NAME" \fBbundle\-list\fR \- List all the gems in the bundle Index: man/bundle-pristine.1.txt =================================================================== --- man/bundle-pristine.1.txt (revision 66035) +++ man/bundle-pristine.1.txt (revision 66036) @@ -41,4 +41,4 @@ BUNDLE-PRISTINE(1) BUNDLE-PRISTI https://github.com/ruby/ruby/blob/trunk/man/bundle-pristine.1.txt#L41 - May 2018 BUNDLE-PRISTINE(1) + November 2018 BUNDLE-PRISTINE(1) Index: man/bundle.1.txt =================================================================== --- man/bundle.1.txt (revision 66035) +++ man/bundle.1.txt (revision 66036) @@ -110,4 +110,4 @@ BUNDLE(1) BUNDLE(1) https://github.com/ruby/ruby/blob/trunk/man/bundle.1.txt#L110 - October 2018 BUNDLE(1) + November 2018 BUNDLE(1) Index: man/bundle-exec.1 =================================================================== --- man/bundle-exec.1 (revision 66035) +++ man/bundle-exec.1 (revision 66036) @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/man/bundle-exec.1#L1 .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-EXEC" "1" "October 2018" "" "" +.TH "BUNDLE\-EXEC" "1" "November 2018" "" "" . .SH "NAME" \fBbundle\-exec\fR \- Execute a command in the context of the bundle Index: man/bundle-viz.1.txt =================================================================== --- man/bundle-viz.1.txt (revision 66035) +++ man/bundle-viz.1.txt (revision 66036) @@ -36,4 +36,4 @@ BUNDLE-VIZ(1) BUNDLE-VIZ(1) https://github.com/ruby/ruby/blob/trunk/man/bundle-viz.1.txt#L36 - October 2018 BUNDLE-VIZ(1) + November 2018 BUNDLE-VIZ(1) Index: man/bundle-open.1 =================================================================== --- man/bundle-open.1 (revision 66035) +++ man/bundle-open.1 (revision 66036) @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/man/bundle-open.1#L1 .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-OPEN" "1" "May 2018" "" "" +.TH "BUNDLE\-OPEN" "1" "November 2018" "" "" . .SH "NAME" \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle Index: man/bundle-inject.1 =================================================================== --- man/bundle-inject.1 (revision 66035) +++ man/bundle-inject.1 (revision 66036) @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/man/bundle-inject.1#L1 .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-INJECT" "1" "June 2018" "" "" +.TH "BUNDLE\-INJECT" "1" "November 2018" "" "" . .SH "NAME" \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile Index: man/bundle-init.1.txt =================================================================== --- man/bundle-init.1.txt (revision 66035) +++ man/bundle-init.1.txt (revision 66036) @@ -31,4 +31,4 @@ BUNDLE-INIT(1) BUNDLE-INIT(1) https://github.com/ruby/ruby/blob/trunk/man/bundle-init.1.txt#L31 - June 2018 BUNDLE-INIT(1) + November 2018 BUNDLE-INIT(1) Index: man/bundle-gem.1.txt =================================================================== --- man/bundle-gem.1.txt (revision 66035) +++ man/bundle-gem.1.txt (revision 66036) @@ -88,4 +88,4 @@ BUNDLE-GEM(1) BUNDLE-GEM(1) https://github.com/ruby/ruby/blob/trunk/man/bundle-gem.1.txt#L88 - October 2018 BUNDLE-GEM(1) + November 2018 BUNDLE-GEM(1) Index: man/bundle-lock.1 =================================================================== --- man/bundle-lock.1 (revision 66035) +++ man/bundle-lock.1 (revision 66036) @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/man/bundle-lock.1#L1 .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-LOCK" "1" "October 2018" "" "" +.TH "BUNDLE\-LOCK" "1" "November 2018" "" "" . .SH "NAME" \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing Index: man/bundle-package.1 =================================================================== --- man/bundle-package.1 (revision 66035) +++ man/bundle-package.1 (revision 66036) @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/man/bundle-package.1#L1 .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-PACKAGE" "1" "October 2018" "" "" +.TH "BUNDLE\-PACKAGE" "1" "November 2018" "" "" . .SH "NAME" \fBbundle\-package\fR \- Package your needed \fB\.gem\fR files into your application Index: man/bundle-add.1 =================================================================== --- man/bundle-add.1 (revision 66035) +++ man/bundle-add.1 (revision 66036) @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/man/bundle-add.1#L1 .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE\-ADD" "1" "October 2018" "" "" +.TH "BUNDLE\-ADD" "1" "November 2018" "" "" . .SH "NAME" \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install Index: man/bundle-check.1.txt =================================================================== --- (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/