diff options
author | Bundlerbot <bot@bundler.io> | 2020-01-05 16:46:34 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2020-01-05 16:46:34 +0000 |
commit | 32a4159325bc181b19e33c3806ea05430f4bbbc7 (patch) | |
tree | 9ad69bfa2f00f3eeb635d0eb348fca15a9c24b68 | |
parent | 14c5584664f66d4792fe6783f4b87fc2bb8d0e4a (diff) | |
parent | f73e11ebed85e9b65425a50687572b59f7185667 (diff) | |
download | bundler-2-1-stable.tar.gz |
Merge #7547v2.1.42-1-stable
7547: Release 2.1.4 r=deivid-rodriguez a=deivid-rodriguez
This PR gets out there two more bug fixes in the 2.1 line. Specifically #7529 and #7537.
Co-authored-by: Bundlerbot <bot@bundler.io>
Co-authored-by: David RodrÃguez <deivid.rodriguez@riseup.net>
-rw-r--r-- | CHANGELOG.md | 7 | ||||
-rw-r--r-- | lib/bundler/inline.rb | 2 | ||||
-rw-r--r-- | lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb | 22 | ||||
-rw-r--r-- | lib/bundler/version.rb | 2 | ||||
-rw-r--r-- | spec/commands/pristine_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/gemfile/gemspec_spec.rb | 2 | ||||
-rw-r--r-- | spec/plugins/source/example_spec.rb | 10 | ||||
-rw-r--r-- | spec/runtime/inline_spec.rb | 17 | ||||
-rw-r--r-- | spec/runtime/require_spec.rb | 2 | ||||
-rw-r--r-- | spec/runtime/setup_spec.rb | 29 | ||||
-rw-r--r-- | spec/support/builders.rb | 20 | ||||
-rw-r--r-- | spec/support/matchers.rb | 4 |
12 files changed, 74 insertions, 45 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d66fbc58a..48cd505560 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 2.1.4 (January 5, 2020) + +Bugfixes: + + - Fix `net-http-pipeline` no longer being allowed in Gemfiles if already installed in the system due to our vendored version of `net-http-persistent` optionally requiring it [#7529](https://github.com/bundler/bundler/pull/7529) + - Fix inline gems no longer being requirable if no Gemfile is present in the directory hierarchy [#7537](https://github.com/bundler/bundler/pull/7537) + ## 2.1.3 (January 2, 2020) Bugfixes: 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' ## @@ -774,23 +769,6 @@ class Bundler::Persistent::Net::HTTP::Persistent 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 def private_key= key diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb index 65914b5831..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.3".freeze + VERSION = "2.1.4".freeze def self.bundler_major_version @bundler_major_version ||= VERSION.split(".").first.to_i diff --git a/spec/commands/pristine_spec.rb b/spec/commands/pristine_spec.rb index aa5c2213d1..cc7f760d74 100644 --- a/spec/commands/pristine_spec.rb +++ b/spec/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/install/gemfile/gemspec_spec.rb b/spec/install/gemfile/gemspec_spec.rb index c50f8c9668..26a6235166 100644 --- a/spec/install/gemfile/gemspec_spec.rb +++ b/spec/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/plugins/source/example_spec.rb b/spec/plugins/source/example_spec.rb index 64002d8f46..f2151a5a73 100644 --- a/spec/plugins/source/example_spec.rb +++ b/spec/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/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb index 94d8b086a2..cd762fe636 100644 --- a/spec/runtime/inline_spec.rb +++ b/spec/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/runtime/require_spec.rb b/spec/runtime/require_spec.rb index 490b8c7631..a8d7826123 100644 --- a/spec/runtime/require_spec.rb +++ b/spec/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/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index 39240b7404..7f00a63078 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/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/support/builders.rb b/spec/support/builders.rb index c7f299487c..b3f5f9b876 100644 --- a/spec/support/builders.rb +++ b/spec/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/support/matchers.rb b/spec/support/matchers.rb index e1a08a30cc..df35854c2f 100644 --- a/spec/support/matchers.rb +++ b/spec/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 |