diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb index d823fb632f..ecd474971d 100644 --- a/lib/bundler/cli/install.rb +++ b/lib/bundler/cli/install.rb @@ -38,7 +38,8 @@ module Bundler if Bundler.feature_flag.deployment_means_frozen? Bundler.settings.set_command_option :deployment, true 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 @@ -169,7 +170,7 @@ module Bundler def normalize_settings Bundler.settings.set_command_option :path, nil if options[:system] 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 Bundler.settings.set_command_option_if_given :path, options[:path] Bundler.settings.temporary(:path_relative_to_cwd => false) do diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb index 7d4e382be8..204dd24052 100644 --- a/lib/bundler/gem_helper.rb +++ b/lib/bundler/gem_helper.rb @@ -73,7 +73,7 @@ module Bundler def build_gem 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) SharedHelpers.filesystem_access(File.join(base, "pkg")) {|p| FileUtils.mkdir_p(p) } FileUtils.mv(built_gem_path, "pkg") @@ -130,9 +130,8 @@ module Bundler def perform_git_push(options = "") cmd = "git push #{options}" - out, status = sh_with_status(cmd) + out, status = sh_with_status(cmd.shellsplit) 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" end diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb index 5b2ddb7db6..f1f77a7a9c 100644 --- a/lib/bundler/inline.rb +++ b/lib/bundler/inline.rb @@ -78,7 +78,7 @@ def gemfile(install = false, options = {}, &gemfile) if old_gemfile ENV["BUNDLE_GEMFILE"] = old_gemfile else - ENV.delete("BUNDLE_GEMFILE") + ENV["BUNDLE_GEMFILE"] = "" end end end diff --git a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb index e9c4c3e89e..f9d1401062 100644 --- a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +++ b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb @@ -3,11 +3,6 @@ require_relative '../../../../uri/lib/uri' require 'cgi' # for escaping require_relative '../../../../connection_pool/lib/connection_pool' -begin - require 'net/http/pipeline' -rescue LoadError -end - autoload :OpenSSL, 'openssl' ## @@ -773,23 +768,6 @@ class Bundler::Persistent::Net::HTTP::Persistent (uri =~ /^https?:/) ? uri : "http://#{uri}" 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 net-http-pipeline was required before - # net-http-persistent #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 diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb index b63e39b8d2..85704816e4 100644 --- a/lib/bundler/version.rb +++ b/lib/bundler/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: false module Bundler - VERSION = "2.1.2".freeze + VERSION = "2.1.4".freeze def self.bundler_major_version @bundler_major_version ||= VERSION.split(".").first.to_i diff --git a/man/bundle-add.1 b/man/bundle-add.1 index 24bfe50f4f..8b75859104 100644 --- a/man/bundle-add.1 +++ b/man/bundle-add.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install diff --git a/man/bundle-add.1.txt b/man/bundle-add.1.txt index aff9977fb1..dcd76df4ae 100644 --- a/man/bundle-add.1.txt +++ b/man/bundle-add.1.txt @@ -55,4 +55,4 @@ OPTIONS - December 2019 BUNDLE-ADD(1) + January 2020 BUNDLE-ADD(1) diff --git a/man/bundle-binstubs.1 b/man/bundle-binstubs.1 index 4e69bfb715..4f9e5c0e31 100644 --- a/man/bundle-binstubs.1 +++ b/man/bundle-binstubs.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems diff --git a/man/bundle-binstubs.1.txt b/man/bundle-binstubs.1.txt index 564989bd8a..cbd2b12da0 100644 --- a/man/bundle-binstubs.1.txt +++ b/man/bundle-binstubs.1.txt @@ -45,4 +45,4 @@ BUNDLE INSTALL --BINSTUBS - December 2019 BUNDLE-BINSTUBS(1) + January 2020 BUNDLE-BINSTUBS(1) diff --git a/man/bundle-cache.1 b/man/bundle-cache.1 index 23bc757d03..cb376777ff 100644 --- a/man/bundle-cache.1 +++ b/man/bundle-cache.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application diff --git a/man/bundle-cache.1.txt b/man/bundle-cache.1.txt index 4dcc7c9cc9..c0b8b5bf07 100644 --- a/man/bundle-cache.1.txt +++ b/man/bundle-cache.1.txt @@ -75,4 +75,4 @@ REMOTE FETCHING - December 2019 BUNDLE-CACHE(1) + January 2020 BUNDLE-CACHE(1) diff --git a/man/bundle-check.1 b/man/bundle-check.1 index ac80f697f5..aba5b66348 100644 --- a/man/bundle-check.1 +++ b/man/bundle-check.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems diff --git a/man/bundle-check.1.txt b/man/bundle-check.1.txt index 05d1c7dc5c..cca5fae9e1 100644 --- a/man/bundle-check.1.txt +++ b/man/bundle-check.1.txt @@ -30,4 +30,4 @@ OPTIONS - December 2019 BUNDLE-CHECK(1) + January 2020 BUNDLE-CHECK(1) diff --git a/man/bundle-clean.1 b/man/bundle-clean.1 index 61fcf9d396..cc5c8e86d7 100644 --- a/man/bundle-clean.1 +++ b/man/bundle-clean.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory diff --git a/man/bundle-clean.1.txt b/man/bundle-clean.1.txt index 9438f8adc9..300d0c0b51 100644 --- a/man/bundle-clean.1.txt +++ b/man/bundle-clean.1.txt @@ -23,4 +23,4 @@ OPTIONS - December 2019 BUNDLE-CLEAN(1) + January 2020 BUNDLE-CLEAN(1) diff --git a/man/bundle-config.1 b/man/bundle-config.1 index 56ef24791d..c3464fb2ec 100644 --- a/man/bundle-config.1 +++ b/man/bundle-config.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-config\fR \- Set bundler configuration options diff --git a/man/bundle-config.1.txt b/man/bundle-config.1.txt index bc3fe39069..f5fc0ce12a 100644 --- a/man/bundle-config.1.txt +++ b/man/bundle-config.1.txt @@ -525,4 +525,4 @@ CONFIGURE BUNDLER DIRECTORIES - December 2019 BUNDLE-CONFIG(1) + January 2020 BUNDLE-CONFIG(1) diff --git a/man/bundle-doctor.1 b/man/bundle-doctor.1 index d3e3e73bbe..344c40066b 100644 --- a/man/bundle-doctor.1 +++ b/man/bundle-doctor.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-doctor\fR \- Checks the bundle for common problems diff --git a/man/bundle-doctor.1.txt b/man/bundle-doctor.1.txt index 6b2fdcbdf4..595ba99633 100644 --- a/man/bundle-doctor.1.txt +++ b/man/bundle-doctor.1.txt @@ -41,4 +41,4 @@ OPTIONS - December 2019 BUNDLE-DOCTOR(1) + January 2020 BUNDLE-DOCTOR(1) diff --git a/man/bundle-exec.1 b/man/bundle-exec.1 index fa0728a5de..555819a5b4 100644 --- a/man/bundle-exec.1 +++ b/man/bundle-exec.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-exec\fR \- Execute a command in the context of the bundle diff --git a/man/bundle-exec.1.txt b/man/bundle-exec.1.txt index efcb130b48..ebdc2fda71 100644 --- a/man/bundle-exec.1.txt +++ b/man/bundle-exec.1.txt @@ -175,4 +175,4 @@ RUBYGEMS PLUGINS - December 2019 BUNDLE-EXEC(1) + January 2020 BUNDLE-EXEC(1) diff --git a/man/bundle-gem.1 b/man/bundle-gem.1 index 9971e3528c..baed185e70 100644 --- a/man/bundle-gem.1 +++ b/man/bundle-gem.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem diff --git a/man/bundle-gem.1.txt b/man/bundle-gem.1.txt index c95c409c65..554bb1a41b 100644 --- a/man/bundle-gem.1.txt +++ b/man/bundle-gem.1.txt @@ -88,4 +88,4 @@ SEE ALSO - December 2019 BUNDLE-GEM(1) + January 2020 BUNDLE-GEM(1) diff --git a/man/bundle-info.1 b/man/bundle-info.1 index 9dbef738fa..d7c73e9bb7 100644 --- a/man/bundle-info.1 +++ b/man/bundle-info.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-info\fR \- Show information for the given gem in your bundle diff --git a/man/bundle-info.1.txt b/man/bundle-info.1.txt index 102ec48f6e..67563aa191 100644 --- a/man/bundle-info.1.txt +++ b/man/bundle-info.1.txt @@ -18,4 +18,4 @@ OPTIONS - December 2019 BUNDLE-INFO(1) + January 2020 BUNDLE-INFO(1) diff --git a/man/bundle-init.1 b/man/bundle-init.1 index 8fe0d02406..803d4b9be8 100644 --- a/man/bundle-init.1 +++ b/man/bundle-init.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-init\fR \- Generates a Gemfile into the current working directory diff --git a/man/bundle-init.1.txt b/man/bundle-init.1.txt index 187ed4b3c0..2565edbece 100644 --- a/man/bundle-init.1.txt +++ b/man/bundle-init.1.txt @@ -31,4 +31,4 @@ SEE ALSO - December 2019 BUNDLE-INIT(1) + January 2020 BUNDLE-INIT(1) diff --git a/man/bundle-inject.1 b/man/bundle-inject.1 index afc328771e..3370a91573 100644 --- a/man/bundle-inject.1 +++ b/man/bundle-inject.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile diff --git a/man/bundle-inject.1.txt b/man/bundle-inject.1.txt index a73927cef0..4707b99e5f 100644 --- a/man/bundle-inject.1.txt +++ b/man/bundle-inject.1.txt @@ -29,4 +29,4 @@ DESCRIPTION - December 2019 BUNDLE-INJECT(1) + January 2020 BUNDLE-INJECT(1) diff --git a/man/bundle-install.1 b/man/bundle-install.1 index 200acfca24..4a289f5c2e 100644 --- a/man/bundle-install.1 +++ b/man/bundle-install.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile diff --git a/man/bundle-install.1.txt b/man/bundle-install.1.txt index 08a0869d6f..b1a9ad1eb3 100644 --- a/man/bundle-install.1.txt +++ b/man/bundle-install.1.txt @@ -398,4 +398,4 @@ SEE ALSO - December 2019 BUNDLE-INSTALL(1) + January 2020 BUNDLE-INSTALL(1) diff --git a/man/bundle-list.1 b/man/bundle-list.1 index 53427b4504..72bc391ac2 100644 --- a/man/bundle-list.1 +++ b/man/bundle-list.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-list\fR \- List all the gems in the bundle diff --git a/man/bundle-list.1.txt b/man/bundle-list.1.txt index f4eab62783..645e62e452 100644 --- a/man/bundle-list.1.txt +++ b/man/bundle-list.1.txt @@ -40,4 +40,4 @@ OPTIONS - December 2019 BUNDLE-LIST(1) + January 2020 BUNDLE-LIST(1) diff --git a/man/bundle-lock.1 b/man/bundle-lock.1 index b64a645eb8..89f6e35179 100644 --- a/man/bundle-lock.1 +++ b/man/bundle-lock.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing diff --git a/man/bundle-lock.1.txt b/man/bundle-lock.1.txt index a50ee25643..80dcada5b3 100644 --- a/man/bundle-lock.1.txt +++ b/man/bundle-lock.1.txt @@ -90,4 +90,4 @@ PATCH LEVEL OPTIONS - December 2019 BUNDLE-LOCK(1) + January 2020 BUNDLE-LOCK(1) diff --git a/man/bundle-open.1 b/man/bundle-open.1 index 6213aeca65..5a11eeeb64 100644 --- a/man/bundle-open.1 +++ b/man/bundle-open.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle diff --git a/man/bundle-open.1.txt b/man/bundle-open.1.txt index 9ecc89c10a..288bbce0e3 100644 --- a/man/bundle-open.1.txt +++ b/man/bundle-open.1.txt @@ -26,4 +26,4 @@ DESCRIPTION - December 2019 BUNDLE-OPEN(1) + January 2020 BUNDLE-OPEN(1) diff --git a/man/bundle-outdated.1 b/man/bundle-outdated.1 index 81543bb65b..408e568034 100644 --- a/man/bundle-outdated.1 +++ b/man/bundle-outdated.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-outdated\fR \- List installed gems with newer versions available diff --git a/man/bundle-outdated.1.txt b/man/bundle-outdated.1.txt index 905a1fd9fc..c938e0a4ab 100644 --- a/man/bundle-outdated.1.txt +++ b/man/bundle-outdated.1.txt @@ -128,4 +128,4 @@ FILTERING OUTPUT - December 2019 BUNDLE-OUTDATED(1) + January 2020 BUNDLE-OUTDATED(1) diff --git a/man/bundle-platform.1 b/man/bundle-platform.1 index f7f65045dc..c83aa3c5d4 100644 --- a/man/bundle-platform.1 +++ b/man/bundle-platform.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-platform\fR \- Displays platform compatibility information diff --git a/man/bundle-platform.1.txt b/man/bundle-platform.1.txt index d808bed64f..f9dc8ccc1f 100644 --- a/man/bundle-platform.1.txt +++ b/man/bundle-platform.1.txt @@ -54,4 +54,4 @@ OPTIONS - December 2019 BUNDLE-PLATFORM(1) + January 2020 BUNDLE-PLATFORM(1) diff --git a/man/bundle-pristine.1 b/man/bundle-pristine.1 index 5b3522dd1a..460e3d4e5a 100644 --- a/man/bundle-pristine.1 +++ b/man/bundle-pristine.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition diff --git a/man/bundle-pristine.1.txt b/man/bundle-pristine.1.txt index a22bd53927..8d474fe497 100644 --- a/man/bundle-pristine.1.txt +++ b/man/bundle-pristine.1.txt @@ -41,4 +41,4 @@ DESCRIPTION - December 2019 BUNDLE-PRISTINE(1) + January 2020 BUNDLE-PRISTINE(1) diff --git a/man/bundle-remove.1 b/man/bundle-remove.1 index 4a4ed7ac95..cb4ad8d384 100644 --- a/man/bundle-remove.1 +++ b/man/bundle-remove.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-remove\fR \- Removes gems from the Gemfile diff --git a/man/bundle-remove.1.txt b/man/bundle-remove.1.txt index 7c8945e2c0..7203422f39 100644 --- a/man/bundle-remove.1.txt +++ b/man/bundle-remove.1.txt @@ -31,4 +31,4 @@ OPTIONS - December 2019 BUNDLE-REMOVE(1) + January 2020 BUNDLE-REMOVE(1) diff --git a/man/bundle-show.1 b/man/bundle-show.1 index 575619370b..2922a33467 100644 --- a/man/bundle-show.1 +++ b/man/bundle-show.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem diff --git a/man/bundle-show.1.txt b/man/bundle-show.1.txt index fa80081427..58f1620168 100644 --- a/man/bundle-show.1.txt +++ b/man/bundle-show.1.txt @@ -24,4 +24,4 @@ OPTIONS - December 2019 BUNDLE-SHOW(1) + January 2020 BUNDLE-SHOW(1) diff --git a/man/bundle-update.1 b/man/bundle-update.1 index 6a3fd877e2..f315532bb9 100644 --- a/man/bundle-update.1 +++ b/man/bundle-update.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-update\fR \- Update your gems to the latest available versions diff --git a/man/bundle-update.1.txt b/man/bundle-update.1.txt index c54ade9713..b8208c75d3 100644 --- a/man/bundle-update.1.txt +++ b/man/bundle-update.1.txt @@ -387,4 +387,4 @@ RECOMMENDED WORKFLOW - December 2019 BUNDLE-UPDATE(1) + January 2020 BUNDLE-UPDATE(1) diff --git a/man/bundle-viz.1 b/man/bundle-viz.1 index f1852e4206..a2153da28d 100644 --- a/man/bundle-viz.1 +++ b/man/bundle-viz.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.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" \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile diff --git a/man/bundle-viz.1.txt b/man/bundle-viz.1.txt index 7956cf18ed..c934b4cf5b 100644 --- a/man/bundle-viz.1.txt +++ b/man/bundle-viz.1.txt @@ -36,4 +36,4 @@ OPTIONS - December 2019 BUNDLE-VIZ(1) + January 2020 BUNDLE-VIZ(1) diff --git a/man/bundle.1 b/man/bundle.1 index 93a43c0c70..4a9a9bec4d 100644 --- a/man/bundle.1 +++ b/man/bundle.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BUNDLE" "1" "December 2019" "" "" +.TH "BUNDLE" "1" "January 2020" "" "" . .SH "NAME" \fBbundle\fR \- Ruby Dependency Management diff --git a/man/bundle.1.txt b/man/bundle.1.txt index cd0fabadea..e7eb35aa14 100644 --- a/man/bundle.1.txt +++ b/man/bundle.1.txt @@ -113,4 +113,4 @@ OBSOLETE - December 2019 BUNDLE(1) + January 2020 BUNDLE(1) diff --git a/man/gemfile.5 b/man/gemfile.5 index 536af70a6e..a9d2cee7c7 100644 --- a/man/gemfile.5 +++ b/man/gemfile.5 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GEMFILE" "5" "December 2019" "" "" +.TH "GEMFILE" "5" "January 2020" "" "" . .SH "NAME" \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs diff --git a/man/gemfile.5.txt b/man/gemfile.5.txt index b3da595b17..71d2513271 100644 --- a/man/gemfile.5.txt +++ b/man/gemfile.5.txt @@ -646,4 +646,4 @@ SOURCE PRIORITY - December 2019 GEMFILE(5) + January 2020 GEMFILE(5) diff --git a/spec/bundler/commands/outdated_spec.rb b/spec/bundler/commands/outdated_spec.rb index 6e82d34b05..df911eaffd 100644 --- a/spec/bundler/commands/outdated_spec.rb +++ b/spec/bundler/commands/outdated_spec.rb @@ -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("Run `bundle outdated` elsewhere.") 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 diff --git a/spec/bundler/commands/pristine_spec.rb b/spec/bundler/commands/pristine_spec.rb index aa5c2213d1..cc7f760d74 100644 --- a/spec/bundler/commands/pristine_spec.rb +++ b/spec/bundler/commands/pristine_spec.rb @@ -99,7 +99,7 @@ RSpec.describe "bundle pristine", :ruby_repo do it "reinstall gemspec dependency" do 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" File.open(changed_file, "a") {|f| f.puts "#Pristine spec changes" } diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb index a0c7e33299..e4449312eb 100644 --- a/spec/bundler/commands/update_spec.rb +++ b/spec/bundler/commands/update_spec.rb @@ -286,7 +286,7 @@ RSpec.describe "bundle update" do 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(/freeze \nby running `bundle install --no-deployment`./m) + expect(err).to match(/freeze \nby running `bundle config unset deployment`./m) end it "should suggest different command when frozen is set globally", :bundler => "< 3" do diff --git a/spec/bundler/install/deploy_spec.rb b/spec/bundler/install/deploy_spec.rb index 89da3fc801..f92a531bf5 100644 --- a/spec/bundler/install/deploy_spec.rb +++ b/spec/bundler/install/deploy_spec.rb @@ -34,7 +34,7 @@ RSpec.describe "install with --deployment or --frozen" do expect(exitstatus).to eq(15) if exitstatus 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 expect(the_bundle).to include_gems "rack 1.0" @@ -42,7 +42,7 @@ RSpec.describe "install with --deployment or --frozen" do end it "still works if you are not in the app directory and specify --gemfile" do - bundle "install" + bundle! "install" Dir.chdir tmp do simulate_new_machine bundle! :install, @@ -60,12 +60,12 @@ RSpec.describe "install with --deployment or --frozen" do gem "foo", :git => "#{lib_path("foo-1.0")}" end G - bundle :install + bundle! :install bundle! :install, forgotten_command_line_options(:deployment => true, :without => "test") end it "works when you bundle exec bundle" do - bundle :install + bundle! :install bundle "install --deployment" bundle! "exec bundle check" end @@ -104,9 +104,90 @@ RSpec.describe "install with --deployment or --frozen" do expect(the_bundle).to include_gems "rack 1.0" 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 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 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") 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 gemfile <<-G 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") 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 bundle! :lock diff --git a/spec/bundler/install/gemfile/gemspec_spec.rb b/spec/bundler/install/gemfile/gemspec_spec.rb index c50f8c9668..26a6235166 100644 --- a/spec/bundler/install/gemfile/gemspec_spec.rb +++ b/spec/bundler/install/gemfile/gemspec_spec.rb @@ -210,7 +210,7 @@ RSpec.describe "bundle install from an existing gemspec" do build_lib("foo", :path => bundled_app) gemspec = bundled_app("foo.gemspec").read 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 install_gemfile! <<-G diff --git a/spec/bundler/plugins/source/example_spec.rb b/spec/bundler/plugins/source/example_spec.rb index 64002d8f46..f2151a5a73 100644 --- a/spec/bundler/plugins/source/example_spec.rb +++ b/spec/bundler/plugins/source/example_spec.rb @@ -125,14 +125,14 @@ RSpec.describe "real source plugins" do end it "installs the gem executables" do - build_lib "gem-with-bin" do |s| + build_lib "gem_with_bin" do |s| s.executables = ["foo"] end install_gemfile <<-G source "#{file_uri_for(gem_repo2)}" # plugin source - source "#{lib_path("gem-with-bin-1.0")}", :type => :mpath do - gem "gem-with-bin" + source "#{lib_path("gem_with_bin-1.0")}", :type => :mpath do + gem "gem_with_bin" end G @@ -451,7 +451,7 @@ RSpec.describe "real source plugins" do bundle "install" run <<-RUBY - require 'ma-gitp-gem' + require 'ma/gitp/gem' puts "WIN" unless defined?(MAGITPGEM_PREV_REF) RUBY expect(out).to eq("WIN") @@ -462,7 +462,7 @@ RSpec.describe "real source plugins" do bundle "update ma-gitp-gem" run <<-RUBY - require 'ma-gitp-gem' + require 'ma/gitp/gem' puts "WIN" if defined?(MAGITPGEM_PREV_REF) RUBY expect(out).to eq("WIN") diff --git a/spec/bundler/runtime/gem_tasks_spec.rb b/spec/bundler/runtime/gem_tasks_spec.rb index 4b92de76bb..74270a2316 100644 --- a/spec/bundler/runtime/gem_tasks_spec.rb +++ b/spec/bundler/runtime/gem_tasks_spec.rb @@ -57,6 +57,20 @@ RSpec.describe "require 'bundler/gem_tasks'" do expect(err).to be_empty 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 with_gem_path_as(Spec::Path.base_system_gems.to_s) do sys_exec! %(#{rake} -e 'load "Rakefile"; puts CLOBBER.inspect') diff --git a/spec/bundler/runtime/inline_spec.rb b/spec/bundler/runtime/inline_spec.rb index 94d8b086a2..cd762fe636 100644 --- a/spec/bundler/runtime/inline_spec.rb +++ b/spec/bundler/runtime/inline_spec.rb @@ -333,4 +333,21 @@ RSpec.describe "bundler/inline#gemfile" do expect(last_command).to be_success expect(out).to include("BUNDLE_GEMFILE is empty") 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 diff --git a/spec/bundler/runtime/require_spec.rb b/spec/bundler/runtime/require_spec.rb index 490b8c7631..a8d7826123 100644 --- a/spec/bundler/runtime/require_spec.rb +++ b/spec/bundler/runtime/require_spec.rb @@ -168,7 +168,6 @@ RSpec.describe "Bundler.require" do build_lib "jquery-rails", "1.0.0" do |s| s.write "lib/jquery/rails.rb", "puts 'jquery/rails'" end - lib_path("jquery-rails-1.0.0/lib/jquery-rails.rb").rmtree end 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| s.write "lib/load/fuuu.rb", "raise LoadError.new(\"cannot load such file -- load-bar\")" end - lib_path("load-fuuu-1.0.0/lib/load-fuuu.rb").rmtree gemfile <<-G path "#{lib_path}" do diff --git a/spec/bundler/runtime/setup_spec.rb b/spec/bundler/runtime/setup_spec.rb index 39240b7404..7f00a63078 100644 --- a/spec/bundler/runtime/setup_spec.rb +++ b/spec/bundler/runtime/setup_spec.rb @@ -899,17 +899,17 @@ end describe "with git gems that don't have gemspecs" do before :each do - build_git "no-gemspec", :gemspec => false + build_git "no_gemspec", :gemspec => false 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 end it "loads the library via a virtual spec" do run <<-R - require 'no-gemspec' - puts NOGEMSPEC + require 'no_gemspec' + puts NO_GEMSPEC R expect(out).to eq("1.0") @@ -1263,6 +1263,27 @@ end expect(out).to eq("{}") 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| it "activates newer versions of #{g}" do skip if exemptions.include?(g) diff --git a/spec/bundler/support/builders.rb b/spec/bundler/support/builders.rb index c7f299487c..b3f5f9b876 100644 --- a/spec/bundler/support/builders.rb +++ b/spec/bundler/support/builders.rb @@ -611,7 +611,7 @@ module Spec unless options[:no_default] gem_source = options[:source] || "path@#{path}" @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) end @@ -627,15 +627,20 @@ module Spec end def _default_files - @_default_files ||= begin - platform_string = " #{@spec.platform}" unless @spec.platform == Gem::Platform::RUBY - { "lib/#{name}.rb" => "#{Builders.constantize(name)} = '#{version}#{platform_string}'" } - end + @_default_files ||= { "lib/#{entrypoint}.rb" => "#{Builders.constantize(name)} = '#{version}#{platform_string}'" } + end + + def entrypoint + name.tr("-", "/") end def _default_path @context.tmp("libs", @spec.full_name) end + + def platform_string + " #{@spec.platform}" unless @spec.platform == Gem::Platform::RUBY + end end class GitBuilder < LibBuilder @@ -755,7 +760,10 @@ module Spec class PluginBuilder < GemBuilder def _default_files - @_default_files ||= super.merge("plugins.rb" => "") + @_default_files ||= { + "lib/#{name}.rb" => "#{Builders.constantize(name)} = '#{version}#{platform_string}'", + "plugins.rb" => "", + } end end diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb index 7d1bd65185..e9c9e766cf 100644 --- a/spec/bundler/support/helpers.rb +++ b/spec/bundler/support/helpers.rb @@ -210,8 +210,10 @@ module Spec yield stdin, stdout, wait_thr if block_given? stdin.close - command_execution.stdout = Thread.new { stdout.read }.value.strip - command_execution.stderr = Thread.new { stderr.read }.value.strip + stdout_read_thread = Thread.new { stdout.read } + 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 end diff --git a/spec/bundler/support/indexes.rb b/spec/bundler/support/indexes.rb index b76f493d01..dc6e0bd1e9 100644 --- a/spec/bundler/support/indexes.rb +++ b/spec/bundler/support/indexes.rb @@ -45,7 +45,7 @@ module Spec def should_conflict_on(names) 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 expect(Array(names).sort).to eq(e.conflicts.sort) end diff --git a/spec/bundler/support/matchers.rb b/spec/bundler/support/matchers.rb index e1a08a30cc..df35854c2f 100644 --- a/spec/bundler/support/matchers.rb +++ b/spec/bundler/support/matchers.rb @@ -128,7 +128,7 @@ module Spec groups << opts @errors = names.map do |name| 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) begin run! "require '#{require_path}.rb'; puts #{version_const}", *groups @@ -145,7 +145,7 @@ module Spec next unless source begin 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 next "#{name} does not have a source defined:\n#{indent(e)}" end