Skip to content

Commit

Permalink
Fix additional Ruby 2.7 keyword warnings (#1586)
Browse files Browse the repository at this point in the history
Fix additional Ruby 2.7 keyword warnings.
  • Loading branch information
stefansundin committed Mar 13, 2020
1 parent 2527f46 commit 1f29a6d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sinatra-contrib/lib/sinatra/namespace.rb
Expand Up @@ -332,7 +332,7 @@ def prefixed_path(a, b)
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
Expand Down
4 changes: 2 additions & 2 deletions sinatra-contrib/lib/sinatra/reloader.rb
Expand Up @@ -269,7 +269,7 @@ def run!(*args)
#
# 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
Expand Down Expand Up @@ -302,7 +302,7 @@ def use(middleware, *args, &block)
# 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
Expand Down
2 changes: 1 addition & 1 deletion sinatra-contrib/lib/sinatra/respond_with.rb
Expand Up @@ -221,7 +221,7 @@ def rendering_method(engine)

private

def compile!(verb, path, block, options = {})
def compile!(verb, path, block, **options)
options[:provides] ||= respond_to if respond_to
super
end
Expand Down

0 comments on commit 1f29a6d

Please sign in to comment.