From da7e1f55c86fd65001cf36ea6af86bdd88417161 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Fri, 30 Aug 2019 11:52:46 -0700 Subject: [PATCH] Fix a couple of bundler issues with keyword argument separation There are more issues than this, but hopefully this is enough to get make test-bundler passing in CI. --- lib/bundler/vendor/thor/lib/thor.rb | 7 ++++++- spec/runtime/inline_spec.rb | 7 ++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/bundler/vendor/thor/lib/thor.rb b/lib/bundler/vendor/thor/lib/thor.rb index 6017ee9ad82..395fad28eb6 100644 --- a/lib/bundler/vendor/thor/lib/thor.rb +++ b/lib/bundler/vendor/thor/lib/thor.rb @@ -90,9 +90,14 @@ def long_desc(long_description, options = {}) # ==== Parameters # Hash[String|Array => Symbol]:: Maps the string or the strings in the array to the given command. # - def map(mappings = nil) + def map(mappings = nil, **kw) @map ||= from_superclass(:map, {}) + if mappings && !kw.empty? + mappings = kw.merge!(mappings) + else + mappings ||= kw + end if mappings mappings.each do |key, value| if key.respond_to?(:each) diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb index c3d632d75de..6c268a7c10a 100644 --- a/spec/runtime/inline_spec.rb +++ b/spec/runtime/inline_spec.rb @@ -88,9 +88,10 @@ def script(code, options = {}) RUBY expect(out).to include("Installing activesupport") - err.gsub! %r{.*lib/sinatra/base\.rb:\d+: warning: constant ::Fixnum is deprecated$}, "" - err.strip! - expect(err).to be_empty + err.gsub! %r{(.*lib/sinatra/base\.rb:\d+: warning: constant ::Fixnum is deprecated$)}, "" + err_lines = err.split("\n") + err_lines.reject!{|line| line =~ /\.rb:\d+: warning: The last/ } + expect(err_lines).to be_empty expect(exitstatus).to be_zero if exitstatus end