diff --git a/sinatra-contrib/lib/sinatra/namespace.rb b/sinatra-contrib/lib/sinatra/namespace.rb index 07b53f7f89..2998651966 100644 --- a/sinatra-contrib/lib/sinatra/namespace.rb +++ b/sinatra-contrib/lib/sinatra/namespace.rb @@ -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 diff --git a/sinatra-contrib/lib/sinatra/reloader.rb b/sinatra-contrib/lib/sinatra/reloader.rb index 9b12c6c91b..0949681332 100644 --- a/sinatra-contrib/lib/sinatra/reloader.rb +++ b/sinatra-contrib/lib/sinatra/reloader.rb @@ -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 @@ -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 diff --git a/sinatra-contrib/lib/sinatra/respond_with.rb b/sinatra-contrib/lib/sinatra/respond_with.rb index 05459298ee..605c26795b 100644 --- a/sinatra-contrib/lib/sinatra/respond_with.rb +++ b/sinatra-contrib/lib/sinatra/respond_with.rb @@ -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