Merge bundler-2.0.0.pre.2 from upstream.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
hsbt 2018-11-27 12:08:19 +00:00
Родитель 86cb3d319f
Коммит fc9509bdd2
51 изменённых файлов: 81 добавлений и 58 удалений

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

@ -28,12 +28,19 @@ module Bundler
# 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)
# Otherwise shell out to git.
@git_commit_sha = Dir.chdir(File.expand_path("..", __FILE__)) do
`git rev-parse --short HEAD`.strip.freeze
if File.directory?(git_dir)
return @git_commit_sha = Dir.chdir(git_dir) { `git rev-parse --short HEAD`.strip.freeze }
end
# 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.

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

@ -474,7 +474,7 @@ 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
@ -499,7 +499,7 @@ repo_name ||= user_name
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}

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

@ -61,6 +61,8 @@ module Bundler
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

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

@ -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 = "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

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

@ -1,7 +1,7 @@
.\" 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

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

@ -49,4 +49,4 @@ BUNDLE-ADD(1) BUNDLE-ADD(1)
October 2018 BUNDLE-ADD(1)
November 2018 BUNDLE-ADD(1)

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

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-BINSTUBS" "1" "October 2018" "" ""
.TH "BUNDLE\-BINSTUBS" "1" "November 2018" "" ""
.
.SH "NAME"
\fBbundle\-binstubs\fR \- Install the binstubs of the listed gems

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

@ -45,4 +45,4 @@ BUNDLE-BINSTUBS(1) BUNDLE-BINSTUBS(1)
October 2018 BUNDLE-BINSTUBS(1)
November 2018 BUNDLE-BINSTUBS(1)

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

@ -1,7 +1,7 @@
.\" 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

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

@ -30,4 +30,4 @@ BUNDLE-CHECK(1) BUNDLE-CHECK(1)
June 2018 BUNDLE-CHECK(1)
November 2018 BUNDLE-CHECK(1)

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

@ -1,7 +1,7 @@
.\" 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

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

@ -23,4 +23,4 @@ BUNDLE-CLEAN(1) BUNDLE-CLEAN(1)
May 2018 BUNDLE-CLEAN(1)
November 2018 BUNDLE-CLEAN(1)

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

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-DOCTOR" "1" "June 2018" "" ""
.TH "BUNDLE\-DOCTOR" "1" "November 2018" "" ""
.
.SH "NAME"
\fBbundle\-doctor\fR \- Checks the bundle for common problems

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

@ -41,4 +41,4 @@ BUNDLE-DOCTOR(1) BUNDLE-DOCTOR(1)
June 2018 BUNDLE-DOCTOR(1)
November 2018 BUNDLE-DOCTOR(1)

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

@ -1,7 +1,7 @@
.\" 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

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

@ -175,4 +175,4 @@ BUNDLE-EXEC(1) BUNDLE-EXEC(1)
October 2018 BUNDLE-EXEC(1)
November 2018 BUNDLE-EXEC(1)

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

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-GEM" "1" "October 2018" "" ""
.TH "BUNDLE\-GEM" "1" "November 2018" "" ""
.
.SH "NAME"
\fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem

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

@ -88,4 +88,4 @@ BUNDLE-GEM(1) BUNDLE-GEM(1)
October 2018 BUNDLE-GEM(1)
November 2018 BUNDLE-GEM(1)

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

@ -1,7 +1,7 @@
.\" 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

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

@ -18,4 +18,4 @@ BUNDLE-INFO(1) BUNDLE-INFO(1)
May 2018 BUNDLE-INFO(1)
November 2018 BUNDLE-INFO(1)

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

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-INIT" "1" "June 2018" "" ""
.TH "BUNDLE\-INIT" "1" "November 2018" "" ""
.
.SH "NAME"
\fBbundle\-init\fR \- Generates a Gemfile into the current working directory

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

@ -31,4 +31,4 @@ BUNDLE-INIT(1) BUNDLE-INIT(1)
June 2018 BUNDLE-INIT(1)
November 2018 BUNDLE-INIT(1)

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

@ -1,7 +1,7 @@
.\" 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

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

@ -29,4 +29,4 @@ BUNDLE-INJECT(1) BUNDLE-INJECT(1)
June 2018 BUNDLE-INJECT(1)
November 2018 BUNDLE-INJECT(1)

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

@ -1,7 +1,7 @@
.\" 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

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

@ -40,4 +40,4 @@ BUNDLE-LIST(1) BUNDLE-LIST(1)
October 2018 BUNDLE-LIST(1)
November 2018 BUNDLE-LIST(1)

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

@ -1,7 +1,7 @@
.\" 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

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

@ -90,4 +90,4 @@ BUNDLE-LOCK(1) BUNDLE-LOCK(1)
October 2018 BUNDLE-LOCK(1)
November 2018 BUNDLE-LOCK(1)

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

@ -1,7 +1,7 @@
.\" 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

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

@ -26,4 +26,4 @@ BUNDLE-OPEN(1) BUNDLE-OPEN(1)
May 2018 BUNDLE-OPEN(1)
November 2018 BUNDLE-OPEN(1)

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

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-OUTDATED" "1" "October 2018" "" ""
.TH "BUNDLE\-OUTDATED" "1" "November 2018" "" ""
.
.SH "NAME"
\fBbundle\-outdated\fR \- List installed gems with newer versions available

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

@ -128,4 +128,4 @@ BUNDLE-OUTDATED(1) BUNDLE-OUTDATED(1)
October 2018 BUNDLE-OUTDATED(1)
November 2018 BUNDLE-OUTDATED(1)

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

@ -1,7 +1,7 @@
.\" 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

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

@ -76,4 +76,4 @@ BUNDLE-PACKAGE(1) BUNDLE-PACKAGE(1)
October 2018 BUNDLE-PACKAGE(1)
November 2018 BUNDLE-PACKAGE(1)

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

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-PLATFORM" "1" "May 2018" "" ""
.TH "BUNDLE\-PLATFORM" "1" "November 2018" "" ""
.
.SH "NAME"
\fBbundle\-platform\fR \- Displays platform compatibility information

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

@ -54,4 +54,4 @@ BUNDLE-PLATFORM(1) BUNDLE-PLATFORM(1)
May 2018 BUNDLE-PLATFORM(1)
November 2018 BUNDLE-PLATFORM(1)

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

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-PRISTINE" "1" "May 2018" "" ""
.TH "BUNDLE\-PRISTINE" "1" "November 2018" "" ""
.
.SH "NAME"
\fBbundle\-pristine\fR \- Restores installed gems to their pristine condition

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

@ -41,4 +41,4 @@ BUNDLE-PRISTINE(1) BUNDLE-PRISTINE(1)
May 2018 BUNDLE-PRISTINE(1)
November 2018 BUNDLE-PRISTINE(1)

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

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-REMOVE" "1" "October 2018" "" ""
.TH "BUNDLE\-REMOVE" "1" "November 2018" "" ""
.
.SH "NAME"
\fBbundle\-remove\fR \- Removes gems from the Gemfile

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

@ -31,4 +31,4 @@ BUNDLE-REMOVE(1) BUNDLE-REMOVE(1)
October 2018 BUNDLE-REMOVE(1)
November 2018 BUNDLE-REMOVE(1)

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

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-SHOW" "1" "October 2018" "" ""
.TH "BUNDLE\-SHOW" "1" "November 2018" "" ""
.
.SH "NAME"
\fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem

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

@ -24,4 +24,4 @@ BUNDLE-SHOW(1) BUNDLE-SHOW(1)
October 2018 BUNDLE-SHOW(1)
November 2018 BUNDLE-SHOW(1)

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

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE\-VIZ" "1" "October 2018" "" ""
.TH "BUNDLE\-VIZ" "1" "November 2018" "" ""
.
.SH "NAME"
\fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile

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

@ -36,4 +36,4 @@ BUNDLE-VIZ(1) BUNDLE-VIZ(1)
October 2018 BUNDLE-VIZ(1)
November 2018 BUNDLE-VIZ(1)

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

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BUNDLE" "1" "October 2018" "" ""
.TH "BUNDLE" "1" "November 2018" "" ""
.
.SH "NAME"
\fBbundle\fR \- Ruby Dependency Management

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

@ -110,4 +110,4 @@ BUNDLE(1) BUNDLE(1)
October 2018 BUNDLE(1)
November 2018 BUNDLE(1)

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

@ -1,7 +1,7 @@
.\" 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

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

@ -650,4 +650,4 @@ GEMFILE(5) GEMFILE(5)
October 2018 GEMFILE(5)
November 2018 GEMFILE(5)

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

@ -25,7 +25,23 @@ RSpec.describe Bundler::Dsl do
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"

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

@ -200,7 +200,7 @@ RSpec.describe "major deprecations", :bundler => "< 3" 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" }
@ -212,7 +212,7 @@ The :github git source is deprecated, and will be removed in Bundler 2.0. Change
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, 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("/")
@ -247,7 +247,7 @@ 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(3, msg)