Merge bundler-2.1.4

This commit is contained in:
Hiroshi SHIBATA 2020-01-08 16:11:52 +09:00 committed by SHIBATA Hiroshi
parent f518b608d6
commit 13f4f07f21
Notes: git 2020-01-08 18:00:56 +09:00
69 changed files with 242 additions and 184 deletions

View File

@ -38,7 +38,8 @@ module Bundler
if Bundler.feature_flag.deployment_means_frozen? if Bundler.feature_flag.deployment_means_frozen?
Bundler.settings.set_command_option :deployment, true Bundler.settings.set_command_option :deployment, true
else else
Bundler.settings.set_command_option :frozen, true Bundler.settings.set_command_option :deployment, true if options[:deployment]
Bundler.settings.set_command_option :frozen, true if options[:frozen]
end end
end end
@ -169,7 +170,7 @@ module Bundler
def normalize_settings def normalize_settings
Bundler.settings.set_command_option :path, nil if options[:system] Bundler.settings.set_command_option :path, nil if options[:system]
Bundler.settings.temporary(:path_relative_to_cwd => false) do Bundler.settings.temporary(:path_relative_to_cwd => false) do
Bundler.settings.set_command_option :path, "vendor/bundle" if options[:deployment] Bundler.settings.set_command_option :path, "vendor/bundle" if Bundler.settings[:deployment] && Bundler.settings[:path].nil?
end end
Bundler.settings.set_command_option_if_given :path, options[:path] Bundler.settings.set_command_option_if_given :path, options[:path]
Bundler.settings.temporary(:path_relative_to_cwd => false) do Bundler.settings.temporary(:path_relative_to_cwd => false) do

View File

@ -73,7 +73,7 @@ module Bundler
def build_gem def build_gem
file_name = nil file_name = nil
sh("#{gem_command} build -V #{spec_path}".shellsplit) do sh("#{gem_command} build -V #{spec_path.shellescape}".shellsplit) do
file_name = File.basename(built_gem_path) file_name = File.basename(built_gem_path)
SharedHelpers.filesystem_access(File.join(base, "pkg")) {|p| FileUtils.mkdir_p(p) } SharedHelpers.filesystem_access(File.join(base, "pkg")) {|p| FileUtils.mkdir_p(p) }
FileUtils.mv(built_gem_path, "pkg") FileUtils.mv(built_gem_path, "pkg")
@ -130,9 +130,8 @@ module Bundler
def perform_git_push(options = "") def perform_git_push(options = "")
cmd = "git push #{options}" cmd = "git push #{options}"
out, status = sh_with_status(cmd) out, status = sh_with_status(cmd.shellsplit)
return if status.success? return if status.success?
cmd = cmd.shelljoin if cmd.respond_to?(:shelljoin)
raise "Couldn't git push. `#{cmd}' failed with the following output:\n\n#{out}\n" raise "Couldn't git push. `#{cmd}' failed with the following output:\n\n#{out}\n"
end end

View File

@ -78,7 +78,7 @@ def gemfile(install = false, options = {}, &gemfile)
if old_gemfile if old_gemfile
ENV["BUNDLE_GEMFILE"] = old_gemfile ENV["BUNDLE_GEMFILE"] = old_gemfile
else else
ENV.delete("BUNDLE_GEMFILE") ENV["BUNDLE_GEMFILE"] = ""
end end
end end
end end

View File

@ -3,11 +3,6 @@ require_relative '../../../../uri/lib/uri'
require 'cgi' # for escaping require 'cgi' # for escaping
require_relative '../../../../connection_pool/lib/connection_pool' require_relative '../../../../connection_pool/lib/connection_pool'
begin
require 'net/http/pipeline'
rescue LoadError
end
autoload :OpenSSL, 'openssl' autoload :OpenSSL, 'openssl'
## ##
@ -773,23 +768,6 @@ class Bundler::Persistent::Net::HTTP::Persistent
(uri =~ /^https?:/) ? uri : "http://#{uri}" (uri =~ /^https?:/) ? uri : "http://#{uri}"
end end
##
# Pipelines +requests+ to the HTTP server at +uri+ yielding responses if a
# block is given. Returns all responses received.
#
# See
# Net::HTTP::Pipeline[http://docs.seattlerb.org/net-http-pipeline/Net/HTTP/Pipeline.html]
# for further details.
#
# Only if <tt>net-http-pipeline</tt> was required before
# <tt>net-http-persistent</tt> #pipeline will be present.
def pipeline uri, requests, &block # :yields: responses
connection_for uri do |connection|
connection.http.pipeline requests, &block
end
end
## ##
# Sets this client's SSL private key # Sets this client's SSL private key

View File

@ -1,7 +1,7 @@
# frozen_string_literal: false # frozen_string_literal: false
module Bundler module Bundler
VERSION = "2.1.2".freeze VERSION = "2.1.4".freeze
def self.bundler_major_version def self.bundler_major_version
@bundler_major_version ||= VERSION.split(".").first.to_i @bundler_major_version ||= VERSION.split(".").first.to_i

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-ADD" "1" "December 2019" "" "" .TH "BUNDLE\-ADD" "1" "January 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install

View File

@ -55,4 +55,4 @@ OPTIONS
December 2019 BUNDLE-ADD(1) January 2020 BUNDLE-ADD(1)

View File

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

View File

@ -45,4 +45,4 @@ BUNDLE INSTALL --BINSTUBS
December 2019 BUNDLE-BINSTUBS(1) January 2020 BUNDLE-BINSTUBS(1)

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-CACHE" "1" "December 2019" "" "" .TH "BUNDLE\-CACHE" "1" "January 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application

View File

@ -75,4 +75,4 @@ REMOTE FETCHING
December 2019 BUNDLE-CACHE(1) January 2020 BUNDLE-CACHE(1)

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-CHECK" "1" "December 2019" "" "" .TH "BUNDLE\-CHECK" "1" "January 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems

View File

@ -30,4 +30,4 @@ OPTIONS
December 2019 BUNDLE-CHECK(1) January 2020 BUNDLE-CHECK(1)

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-CLEAN" "1" "December 2019" "" "" .TH "BUNDLE\-CLEAN" "1" "January 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory

View File

@ -23,4 +23,4 @@ OPTIONS
December 2019 BUNDLE-CLEAN(1) January 2020 BUNDLE-CLEAN(1)

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-CONFIG" "1" "December 2019" "" "" .TH "BUNDLE\-CONFIG" "1" "January 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-config\fR \- Set bundler configuration options \fBbundle\-config\fR \- Set bundler configuration options

View File

@ -525,4 +525,4 @@ CONFIGURE BUNDLER DIRECTORIES
December 2019 BUNDLE-CONFIG(1) January 2020 BUNDLE-CONFIG(1)

View File

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

View File

@ -41,4 +41,4 @@ OPTIONS
December 2019 BUNDLE-DOCTOR(1) January 2020 BUNDLE-DOCTOR(1)

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-EXEC" "1" "December 2019" "" "" .TH "BUNDLE\-EXEC" "1" "January 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-exec\fR \- Execute a command in the context of the bundle \fBbundle\-exec\fR \- Execute a command in the context of the bundle

View File

@ -175,4 +175,4 @@ RUBYGEMS PLUGINS
December 2019 BUNDLE-EXEC(1) January 2020 BUNDLE-EXEC(1)

View File

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

View File

@ -88,4 +88,4 @@ SEE ALSO
December 2019 BUNDLE-GEM(1) January 2020 BUNDLE-GEM(1)

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-INFO" "1" "December 2019" "" "" .TH "BUNDLE\-INFO" "1" "January 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-info\fR \- Show information for the given gem in your bundle \fBbundle\-info\fR \- Show information for the given gem in your bundle

View File

@ -18,4 +18,4 @@ OPTIONS
December 2019 BUNDLE-INFO(1) January 2020 BUNDLE-INFO(1)

View File

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

View File

@ -31,4 +31,4 @@ SEE ALSO
December 2019 BUNDLE-INIT(1) January 2020 BUNDLE-INIT(1)

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-INJECT" "1" "December 2019" "" "" .TH "BUNDLE\-INJECT" "1" "January 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile

View File

@ -29,4 +29,4 @@ DESCRIPTION
December 2019 BUNDLE-INJECT(1) January 2020 BUNDLE-INJECT(1)

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-INSTALL" "1" "December 2019" "" "" .TH "BUNDLE\-INSTALL" "1" "January 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-install\fR \- Install the dependencies specified in your Gemfile \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile

View File

@ -398,4 +398,4 @@ SEE ALSO
December 2019 BUNDLE-INSTALL(1) January 2020 BUNDLE-INSTALL(1)

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-LIST" "1" "December 2019" "" "" .TH "BUNDLE\-LIST" "1" "January 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-list\fR \- List all the gems in the bundle \fBbundle\-list\fR \- List all the gems in the bundle

View File

@ -40,4 +40,4 @@ OPTIONS
December 2019 BUNDLE-LIST(1) January 2020 BUNDLE-LIST(1)

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-LOCK" "1" "December 2019" "" "" .TH "BUNDLE\-LOCK" "1" "January 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-lock\fR \- Creates / Updates a lockfile without installing \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing

View File

@ -90,4 +90,4 @@ PATCH LEVEL OPTIONS
December 2019 BUNDLE-LOCK(1) January 2020 BUNDLE-LOCK(1)

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-OPEN" "1" "December 2019" "" "" .TH "BUNDLE\-OPEN" "1" "January 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-open\fR \- Opens the source directory for a gem in your bundle \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle

View File

@ -26,4 +26,4 @@ DESCRIPTION
December 2019 BUNDLE-OPEN(1) January 2020 BUNDLE-OPEN(1)

View File

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

View File

@ -128,4 +128,4 @@ FILTERING OUTPUT
December 2019 BUNDLE-OUTDATED(1) January 2020 BUNDLE-OUTDATED(1)

View File

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

View File

@ -54,4 +54,4 @@ OPTIONS
December 2019 BUNDLE-PLATFORM(1) January 2020 BUNDLE-PLATFORM(1)

View File

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

View File

@ -41,4 +41,4 @@ DESCRIPTION
December 2019 BUNDLE-PRISTINE(1) January 2020 BUNDLE-PRISTINE(1)

View File

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

View File

@ -31,4 +31,4 @@ OPTIONS
December 2019 BUNDLE-REMOVE(1) January 2020 BUNDLE-REMOVE(1)

View File

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

View File

@ -24,4 +24,4 @@ OPTIONS
December 2019 BUNDLE-SHOW(1) January 2020 BUNDLE-SHOW(1)

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BUNDLE\-UPDATE" "1" "December 2019" "" "" .TH "BUNDLE\-UPDATE" "1" "January 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBbundle\-update\fR \- Update your gems to the latest available versions \fBbundle\-update\fR \- Update your gems to the latest available versions

View File

@ -387,4 +387,4 @@ RECOMMENDED WORKFLOW
December 2019 BUNDLE-UPDATE(1) January 2020 BUNDLE-UPDATE(1)

View File

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

View File

@ -36,4 +36,4 @@ OPTIONS
December 2019 BUNDLE-VIZ(1) January 2020 BUNDLE-VIZ(1)

View File

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

View File

@ -113,4 +113,4 @@ OBSOLETE
December 2019 BUNDLE(1) January 2020 BUNDLE(1)

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "GEMFILE" "5" "December 2019" "" "" .TH "GEMFILE" "5" "January 2020" "" ""
. .
.SH "NAME" .SH "NAME"
\fBGemfile\fR \- A format for describing gem dependencies for Ruby programs \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs

View File

@ -646,4 +646,4 @@ SOURCE PRIORITY
December 2019 GEMFILE(5) January 2020 GEMFILE(5)

View File

@ -423,7 +423,7 @@ RSpec.describe "bundle outdated" do
expect(err).to include("You are trying to check outdated gems in deployment mode.") expect(err).to include("You are trying to check outdated gems in deployment mode.")
expect(err).to include("Run `bundle outdated` elsewhere.") expect(err).to include("Run `bundle outdated` elsewhere.")
expect(err).to include("If this is a development machine, remove the ") expect(err).to include("If this is a development machine, remove the ")
expect(err).to include("Gemfile freeze\nby running `bundle install --no-deployment`.") expect(err).to include("Gemfile freeze\nby running `bundle config unset deployment`.")
end end
end end

View File

@ -99,7 +99,7 @@ RSpec.describe "bundle pristine", :ruby_repo do
it "reinstall gemspec dependency" do it "reinstall gemspec dependency" do
spec = Bundler.definition.specs["baz-dev"].first spec = Bundler.definition.specs["baz-dev"].first
changed_file = Pathname.new(spec.full_gem_path).join("lib/baz-dev.rb") changed_file = Pathname.new(spec.full_gem_path).join("lib/baz/dev.rb")
diff = "#Pristine spec changes" diff = "#Pristine spec changes"
File.open(changed_file, "a") {|f| f.puts "#Pristine spec changes" } File.open(changed_file, "a") {|f| f.puts "#Pristine spec changes" }

View File

@ -286,7 +286,7 @@ RSpec.describe "bundle update" do
expect(last_command).to be_failure expect(last_command).to be_failure
expect(err).to match(/You are trying to install in deployment mode after changing.your Gemfile/m) expect(err).to match(/You are trying to install in deployment mode after changing.your Gemfile/m)
expect(err).to match(/freeze \nby running `bundle install --no-deployment`./m) expect(err).to match(/freeze \nby running `bundle config unset deployment`./m)
end end
it "should suggest different command when frozen is set globally", :bundler => "< 3" do it "should suggest different command when frozen is set globally", :bundler => "< 3" do

View File

@ -34,7 +34,7 @@ RSpec.describe "install with --deployment or --frozen" do
expect(exitstatus).to eq(15) if exitstatus expect(exitstatus).to eq(15) if exitstatus
end end
it "works after you try to deploy without a lock" do it "doesn't mess up a subsequent `bundle install` after you try to deploy without a lock" do
bundle "install --deployment" bundle "install --deployment"
bundle! :install bundle! :install
expect(the_bundle).to include_gems "rack 1.0" expect(the_bundle).to include_gems "rack 1.0"
@ -42,7 +42,7 @@ RSpec.describe "install with --deployment or --frozen" do
end end
it "still works if you are not in the app directory and specify --gemfile" do it "still works if you are not in the app directory and specify --gemfile" do
bundle "install" bundle! "install"
Dir.chdir tmp do Dir.chdir tmp do
simulate_new_machine simulate_new_machine
bundle! :install, bundle! :install,
@ -60,12 +60,12 @@ RSpec.describe "install with --deployment or --frozen" do
gem "foo", :git => "#{lib_path("foo-1.0")}" gem "foo", :git => "#{lib_path("foo-1.0")}"
end end
G G
bundle :install bundle! :install
bundle! :install, forgotten_command_line_options(:deployment => true, :without => "test") bundle! :install, forgotten_command_line_options(:deployment => true, :without => "test")
end end
it "works when you bundle exec bundle" do it "works when you bundle exec bundle" do
bundle :install bundle! :install
bundle "install --deployment" bundle "install --deployment"
bundle! "exec bundle check" bundle! "exec bundle check"
end end
@ -104,9 +104,90 @@ RSpec.describe "install with --deployment or --frozen" do
expect(the_bundle).to include_gems "rack 1.0" expect(the_bundle).to include_gems "rack 1.0"
end end
context "when replacing a host with the same host with credentials" do
before do
bundle! "install", forgotten_command_line_options(:path => "vendor/bundle")
gemfile <<-G
source "http://user_name:password@localgemserver.test/"
gem "rack"
G
lockfile <<-G
GEM
remote: http://localgemserver.test/
specs:
rack (1.0.0)
PLATFORMS
#{local}
DEPENDENCIES
rack
G
bundle! "config set --local deployment true"
end
it "prevents the replace by default" do
bundle :install
expect(err).to match(/The list of sources changed/)
end
context "when allow_deployment_source_credential_changes is true" do
before { bundle! "config set allow_deployment_source_credential_changes true" }
it "allows the replace" do
bundle! :install
expect(out).to match(/Bundle complete!/)
end
end
context "when allow_deployment_source_credential_changes is false" do
before { bundle! "config set allow_deployment_source_credential_changes false" }
it "prevents the replace" do
bundle :install
expect(err).to match(/The list of sources changed/)
end
end
context "when BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES env var is true" do
before { ENV["BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES"] = "true" }
it "allows the replace" do
bundle :install
expect(out).to match(/Bundle complete!/)
end
end
context "when BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES env var is false" do
before { ENV["BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES"] = "false" }
it "prevents the replace" do
bundle :install
expect(err).to match(/The list of sources changed/)
end
end
end
describe "with an existing lockfile" do describe "with an existing lockfile" do
before do before do
bundle "install" bundle! "install"
end
it "installs gems by default to vendor/bundle", :bundler => "< 3" do
bundle! "install --deployment"
expect(out).to include("vendor/bundle")
end
it "installs gems to custom path if specified", :bundler => "< 3" do
bundle! "install --path vendor/bundle2 --deployment"
expect(out).to include("vendor/bundle2")
end end
it "works with the --deployment flag if you didn't change anything", :bundler => "< 3" do it "works with the --deployment flag if you didn't change anything", :bundler => "< 3" do
@ -197,6 +278,19 @@ RSpec.describe "install with --deployment or --frozen" do
expect(err).not_to include("You have changed in the Gemfile") expect(err).not_to include("You have changed in the Gemfile")
end end
it "installs gems by default to vendor/bundle when `--deployment` is set via an environment variable", :bundler => "< 3" do
ENV["BUNDLE_DEPLOYMENT"] = "true"
bundle "install"
expect(out).to include("vendor/bundle")
end
it "installs gems to custom path when deployment mode is set via an environment variable ", :bundler => "< 3" do
ENV["BUNDLE_DEPLOYMENT"] = "true"
ENV["BUNDLE_PATH"] = "vendor/bundle2"
bundle "install"
expect(out).to include("vendor/bundle2")
end
it "can have --frozen set to false via an environment variable" do it "can have --frozen set to false via an environment variable" do
gemfile <<-G gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
@ -280,80 +374,6 @@ RSpec.describe "install with --deployment or --frozen" do
expect(err).not_to include("You have deleted from the Gemfile") expect(err).not_to include("You have deleted from the Gemfile")
end end
context "when replacing a host with the same host with credentials" do
let(:success_message) do
"Bundle complete!"
end
before do
install_gemfile <<-G
source "http://user_name:password@localgemserver.test/"
gem "rack"
G
lockfile <<-G
GEM
remote: http://localgemserver.test/
specs:
rack (1.0.0)
PLATFORMS
#{local}
DEPENDENCIES
rack
G
bundle! "config set --local deployment true"
end
it "prevents the replace by default" do
bundle :install
expect(err).to match(/The list of sources changed/)
end
context "when allow_deployment_source_credential_changes is true" do
before { bundle! "config set allow_deployment_source_credential_changes true" }
it "allows the replace" do
bundle :install
expect(out).to match(/#{success_message}/)
end
end
context "when allow_deployment_source_credential_changes is false" do
before { bundle! "config set allow_deployment_source_credential_changes false" }
it "prevents the replace" do
bundle :install
expect(err).to match(/The list of sources changed/)
end
end
context "when BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES env var is true" do
before { ENV["BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES"] = "true" }
it "allows the replace" do
bundle :install
expect(out).to match(/#{success_message}/)
end
end
context "when BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES env var is false" do
before { ENV["BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES"] = "false" }
it "prevents the replace" do
bundle :install
expect(err).to match(/The list of sources changed/)
end
end
end
it "remembers that the bundle is frozen at runtime" do it "remembers that the bundle is frozen at runtime" do
bundle! :lock bundle! :lock

View File

@ -210,7 +210,7 @@ RSpec.describe "bundle install from an existing gemspec" do
build_lib("foo", :path => bundled_app) build_lib("foo", :path => bundled_app)
gemspec = bundled_app("foo.gemspec").read gemspec = bundled_app("foo.gemspec").read
bundled_app("foo.gemspec").open("w") do |f| bundled_app("foo.gemspec").open("w") do |f|
f.write "#{gemspec.strip}.tap { gem 'rack-obama'; require 'rack-obama' }" f.write "#{gemspec.strip}.tap { gem 'rack-obama'; require 'rack/obama' }"
end end
install_gemfile! <<-G install_gemfile! <<-G

View File

@ -125,14 +125,14 @@ RSpec.describe "real source plugins" do
end end
it "installs the gem executables" do it "installs the gem executables" do
build_lib "gem-with-bin" do |s| build_lib "gem_with_bin" do |s|
s.executables = ["foo"] s.executables = ["foo"]
end end
install_gemfile <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" # plugin source source "#{file_uri_for(gem_repo2)}" # plugin source
source "#{lib_path("gem-with-bin-1.0")}", :type => :mpath do source "#{lib_path("gem_with_bin-1.0")}", :type => :mpath do
gem "gem-with-bin" gem "gem_with_bin"
end end
G G
@ -451,7 +451,7 @@ RSpec.describe "real source plugins" do
bundle "install" bundle "install"
run <<-RUBY run <<-RUBY
require 'ma-gitp-gem' require 'ma/gitp/gem'
puts "WIN" unless defined?(MAGITPGEM_PREV_REF) puts "WIN" unless defined?(MAGITPGEM_PREV_REF)
RUBY RUBY
expect(out).to eq("WIN") expect(out).to eq("WIN")
@ -462,7 +462,7 @@ RSpec.describe "real source plugins" do
bundle "update ma-gitp-gem" bundle "update ma-gitp-gem"
run <<-RUBY run <<-RUBY
require 'ma-gitp-gem' require 'ma/gitp/gem'
puts "WIN" if defined?(MAGITPGEM_PREV_REF) puts "WIN" if defined?(MAGITPGEM_PREV_REF)
RUBY RUBY
expect(out).to eq("WIN") expect(out).to eq("WIN")

View File

@ -57,6 +57,20 @@ RSpec.describe "require 'bundler/gem_tasks'" do
expect(err).to be_empty expect(err).to be_empty
end end
context "rake build when path has spaces" do
before do
spaced_bundled_app = tmp.join("bundled app")
FileUtils.mv bundled_app, spaced_bundled_app
Dir.chdir(spaced_bundled_app)
end
it "still runs successfully" do
bundle! "exec rake build"
expect(err).to be_empty
end
end
it "adds 'pkg' to rake/clean's CLOBBER" do it "adds 'pkg' to rake/clean's CLOBBER" do
with_gem_path_as(Spec::Path.base_system_gems.to_s) do with_gem_path_as(Spec::Path.base_system_gems.to_s) do
sys_exec! %(#{rake} -e 'load "Rakefile"; puts CLOBBER.inspect') sys_exec! %(#{rake} -e 'load "Rakefile"; puts CLOBBER.inspect')

View File

@ -333,4 +333,21 @@ RSpec.describe "bundler/inline#gemfile" do
expect(last_command).to be_success expect(last_command).to be_success
expect(out).to include("BUNDLE_GEMFILE is empty") expect(out).to include("BUNDLE_GEMFILE is empty")
end end
it "resets BUNDLE_GEMFILE to the empty string if it wasn't set previously" do
ENV["BUNDLE_GEMFILE"] = nil
script <<-RUBY
gemfile do
source "#{file_uri_for(gem_repo1)}"
gem "rack"
end
puts "BUNDLE_GEMFILE is empty" if ENV["BUNDLE_GEMFILE"].empty?
system("#{Gem.ruby} -w -e '42'") # this should see original value of BUNDLE_GEMFILE
exit $?.exitstatus
RUBY
expect(last_command).to be_success
expect(out).to include("BUNDLE_GEMFILE is empty")
end
end end

View File

@ -168,7 +168,6 @@ RSpec.describe "Bundler.require" do
build_lib "jquery-rails", "1.0.0" do |s| build_lib "jquery-rails", "1.0.0" do |s|
s.write "lib/jquery/rails.rb", "puts 'jquery/rails'" s.write "lib/jquery/rails.rb", "puts 'jquery/rails'"
end end
lib_path("jquery-rails-1.0.0/lib/jquery-rails.rb").rmtree
end end
it "requires gem names that are namespaced" do it "requires gem names that are namespaced" do
@ -241,7 +240,6 @@ RSpec.describe "Bundler.require" do
build_lib "load-fuuu", "1.0.0" do |s| build_lib "load-fuuu", "1.0.0" do |s|
s.write "lib/load/fuuu.rb", "raise LoadError.new(\"cannot load such file -- load-bar\")" s.write "lib/load/fuuu.rb", "raise LoadError.new(\"cannot load such file -- load-bar\")"
end end
lib_path("load-fuuu-1.0.0/lib/load-fuuu.rb").rmtree
gemfile <<-G gemfile <<-G
path "#{lib_path}" do path "#{lib_path}" do

View File

@ -899,17 +899,17 @@ end
describe "with git gems that don't have gemspecs" do describe "with git gems that don't have gemspecs" do
before :each do before :each do
build_git "no-gemspec", :gemspec => false build_git "no_gemspec", :gemspec => false
install_gemfile <<-G install_gemfile <<-G
gem "no-gemspec", "1.0", :git => "#{lib_path("no-gemspec-1.0")}" gem "no_gemspec", "1.0", :git => "#{lib_path("no_gemspec-1.0")}"
G G
end end
it "loads the library via a virtual spec" do it "loads the library via a virtual spec" do
run <<-R run <<-R
require 'no-gemspec' require 'no_gemspec'
puts NOGEMSPEC puts NO_GEMSPEC
R R
expect(out).to eq("1.0") expect(out).to eq("1.0")
@ -1263,6 +1263,27 @@ end
expect(out).to eq("{}") expect(out).to eq("{}")
end end
it "does not load net-http-pipeline too early" do
build_repo4 do
build_gem "net-http-pipeline", "1.0.1"
end
system_gems "net-http-pipeline-1.0.1", :gem_repo => gem_repo4 do
gemfile <<-G
source "#{file_uri_for(gem_repo4)}"
gem "net-http-pipeline", "1.0.1"
G
bundle "config set --local path vendor/bundle"
bundle! :install
bundle! :check
expect(out).to eq("The Gemfile's dependencies are satisfied")
end
end
Gem::Specification.select(&:default_gem?).map(&:name).each do |g| Gem::Specification.select(&:default_gem?).map(&:name).each do |g|
it "activates newer versions of #{g}" do it "activates newer versions of #{g}" do
skip if exemptions.include?(g) skip if exemptions.include?(g)

View File

@ -611,7 +611,7 @@ module Spec
unless options[:no_default] unless options[:no_default]
gem_source = options[:source] || "path@#{path}" gem_source = options[:source] || "path@#{path}"
@files = _default_files. @files = _default_files.
merge("lib/#{name}/source.rb" => "#{Builders.constantize(name)}_SOURCE = #{gem_source.to_s.dump}"). merge("lib/#{entrypoint}/source.rb" => "#{Builders.constantize(name)}_SOURCE = #{gem_source.to_s.dump}").
merge(@files) merge(@files)
end end
@ -627,15 +627,20 @@ module Spec
end end
def _default_files def _default_files
@_default_files ||= begin @_default_files ||= { "lib/#{entrypoint}.rb" => "#{Builders.constantize(name)} = '#{version}#{platform_string}'" }
platform_string = " #{@spec.platform}" unless @spec.platform == Gem::Platform::RUBY
{ "lib/#{name}.rb" => "#{Builders.constantize(name)} = '#{version}#{platform_string}'" }
end end
def entrypoint
name.tr("-", "/")
end end
def _default_path def _default_path
@context.tmp("libs", @spec.full_name) @context.tmp("libs", @spec.full_name)
end end
def platform_string
" #{@spec.platform}" unless @spec.platform == Gem::Platform::RUBY
end
end end
class GitBuilder < LibBuilder class GitBuilder < LibBuilder
@ -755,7 +760,10 @@ module Spec
class PluginBuilder < GemBuilder class PluginBuilder < GemBuilder
def _default_files def _default_files
@_default_files ||= super.merge("plugins.rb" => "") @_default_files ||= {
"lib/#{name}.rb" => "#{Builders.constantize(name)} = '#{version}#{platform_string}'",
"plugins.rb" => "",
}
end end
end end

View File

@ -210,8 +210,10 @@ module Spec
yield stdin, stdout, wait_thr if block_given? yield stdin, stdout, wait_thr if block_given?
stdin.close stdin.close
command_execution.stdout = Thread.new { stdout.read }.value.strip stdout_read_thread = Thread.new { stdout.read }
command_execution.stderr = Thread.new { stderr.read }.value.strip stderr_read_thread = Thread.new { stderr.read }
command_execution.stdout = stdout_read_thread.value.strip
command_execution.stderr = stderr_read_thread.value.strip
command_execution.exitstatus = wait_thr && wait_thr.value.exitstatus command_execution.exitstatus = wait_thr && wait_thr.value.exitstatus
end end

View File

@ -45,7 +45,7 @@ module Spec
def should_conflict_on(names) def should_conflict_on(names)
got = resolve got = resolve
flunk "The resolve succeeded with: #{got.map(&:full_name).sort.inspect}" raise "The resolve succeeded with: #{got.map(&:full_name).sort.inspect}"
rescue Bundler::VersionConflict => e rescue Bundler::VersionConflict => e
expect(Array(names).sort).to eq(e.conflicts.sort) expect(Array(names).sort).to eq(e.conflicts.sort)
end end

View File

@ -128,7 +128,7 @@ module Spec
groups << opts groups << opts
@errors = names.map do |name| @errors = names.map do |name|
name, version, platform = name.split(/\s+/) name, version, platform = name.split(/\s+/)
require_path = name == "bundler" ? "#{lib_dir}/bundler" : name require_path = name == "bundler" ? "#{lib_dir}/bundler" : name.tr("-", "/")
version_const = name == "bundler" ? "Bundler::VERSION" : Spec::Builders.constantize(name) version_const = name == "bundler" ? "Bundler::VERSION" : Spec::Builders.constantize(name)
begin begin
run! "require '#{require_path}.rb'; puts #{version_const}", *groups run! "require '#{require_path}.rb'; puts #{version_const}", *groups
@ -145,7 +145,7 @@ module Spec
next unless source next unless source
begin begin
source_const = "#{Spec::Builders.constantize(name)}_SOURCE" source_const = "#{Spec::Builders.constantize(name)}_SOURCE"
run! "require '#{name}/source'; puts #{source_const}", *groups run! "require '#{require_path}/source'; puts #{source_const}", *groups
rescue StandardError rescue StandardError
next "#{name} does not have a source defined:\n#{indent(e)}" next "#{name} does not have a source defined:\n#{indent(e)}"
end end