Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix additional Ruby 2.7 keyword warnings #1586

Merged
merged 2 commits into from Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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