summaryrefslogtreecommitdiff
path: root/lib/bundler/vendor
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-09-01 10:33:59 +0000
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-09-15 09:42:45 +0200
commitcd37c71a8165f9e45b4a48f83bcb3cf0b998ec08 (patch)
tree63b1c97b7efde189e65ca7c6e920b467f8df9871 /lib/bundler/vendor
parente573835fa4b4b1396129112690ac2682c828ce5c (diff)
downloadbundler-cd37c71a8165f9e45b4a48f83bcb3cf0b998ec08.tar.gz
Merge #7337
7337: Fix a couple of bundler issues with keyword argument separation r=hsbt a=jeremyevans ### What was the end-user problem that led to this PR? `make test-bundler` in Ruby repository failed with recent changes to separate keyword arguments from positional arguments (see https://bugs.ruby-lang.org/issues/14183). ### What was your diagnosis of the problem? Bundler's specs check for lack of warnings, and the new changes cause warnings that cause Bundler's specs to fail. ### What is your fix for the problem, implemented in this PR? In one case, I fix the code to work with keyword arguments and positional arguments in positional arguments. In the other case, I fix the spec to ignore the keyword argument separation warnings. I fixed this upstream in Ruby already (https://github.com/ruby/ruby/commit/b5b3afadfab4072f55320075ccac6afe333a140c). So this is a request to make bundler use the same patch. You can certainly fix it differently, and there are more related issues to fix I think (they just don't cause test failures yet). The issues definitely need to be fixed if you want bundler's specs to run correctly in Ruby 2.7. ### Why did you choose this fix out of the possible options? Because it was the least amount of effort. Co-authored-by: Jeremy Evans <code@jeremyevans.net> (cherry picked from commit 8b61b4b380b734a5cedc31985902c45971255e3b)
Diffstat (limited to 'lib/bundler/vendor')
-rw-r--r--lib/bundler/vendor/thor/lib/thor.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bundler/vendor/thor/lib/thor.rb b/lib/bundler/vendor/thor/lib/thor.rb
index 6017ee9ad8..395fad28eb 100644
--- a/lib/bundler/vendor/thor/lib/thor.rb
+++ b/lib/bundler/vendor/thor/lib/thor.rb
@@ -90,9 +90,14 @@ class Bundler::Thor
# ==== 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)