Fix additional Ruby 2.7 keyword warnings (#1586)

Fix additional Ruby 2.7 keyword warnings.
This commit is contained in:
Stefan Sundin 2020-03-13 06:34:36 -07:00 committed by GitHub
parent 2527f46bc4
commit 1f29a6d3e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -332,7 +332,7 @@ module Sinatra
def prefixed(method, pattern = nil, conditions = {}, &block)
default = %r{(?:/.*)?} if method == :before or method == :after
pattern, conditions = compile pattern, conditions, default
result = base.send(method, pattern, conditions, &block)
result = base.send(method, pattern, **conditions, &block)
invoke_hook :route_added, method.to_s.upcase, pattern, block
result
end

View File

@ -269,7 +269,7 @@ module Sinatra
#
# Note: We are using #compile! so we don't interfere with extensions
# changing #route.
def compile!(verb, path, block, options = {})
def compile!(verb, path, block, **options)
source_location = block.respond_to?(:source_location) ?
block.source_location.first : caller_files[1]
signature = super
@ -302,7 +302,7 @@ module Sinatra
# Does everything Sinatra::Base#add_filter does, but it also tells
# the +Watcher::List+ for the Sinatra application to watch the defined
# filter.
def add_filter(type, path = nil, options = {}, &block)
def add_filter(type, path = nil, **options, &block)
source_location = block.respond_to?(:source_location) ?
block.source_location.first : caller_files[1]
result = super

View File

@ -221,7 +221,7 @@ module Sinatra
private
def compile!(verb, path, block, options = {})
def compile!(verb, path, block, **options)
options[:provides] ||= respond_to if respond_to
super
end