Cannot parse def self.use(...) in Ruby 2.6

This commit is contained in:
Ryuta Kamizono 2019-12-26 18:30:11 +09:00
parent 04f94394b3
commit 3eb1f1dd10

@ -218,16 +218,13 @@ def self.inherited(base) # :nodoc:
super super
end end
# Pushes the given Rack middleware and its arguments to the bottom of the class << self
# middleware stack. # Pushes the given Rack middleware and its arguments to the bottom of the
if RUBY_VERSION >= "2.7" # middleware stack.
def self.use(...) def use(*args, &block)
middleware_stack.use(...)
end
else
def self.use(*args, &block)
middleware_stack.use(*args, &block) middleware_stack.use(*args, &block)
end end
ruby2_keywords(:use) if respond_to?(:ruby2_keywords, true)
end end
# Alias for +middleware_stack+. # Alias for +middleware_stack+.