Skip to content

Commit

Permalink
Merge pull request #1581 from osamtimizer/fix/keyword-parameter-ruby-…
Browse files Browse the repository at this point in the history
…2.7.0

eliminate warnings of keyword parameter for ruby 2.7.0
  • Loading branch information
jkowens authored Dec 13, 2019
2 parents 04a02ac + 0bb4d0b commit d423f56
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/sinatra/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1346,19 +1346,19 @@ def mime_types(type)
# context as route handlers and may access/modify the request and
# response.
def before(path = /.*/, **options, &block)
add_filter(:before, path, options, &block)
add_filter(:before, path, **options, &block)
end

# Define an after filter; runs after all requests within the same
# context as route handlers and may access/modify the request and
# response.
def after(path = /.*/, **options, &block)
add_filter(:after, path, options, &block)
add_filter(:after, path, **options, &block)
end

# add a filter
def add_filter(type, path = /.*/, **options, &block)
filters[type] << compile!(type, path, block, options)
filters[type] << compile!(type, path, block, **options)
end

# Add a route condition. The route is considered non-matching when the
Expand Down Expand Up @@ -1602,7 +1602,7 @@ def provides(*types)

def route(verb, path, options = {}, &block)
enable :empty_path_info if path == "" and empty_path_info.nil?
signature = compile!(verb, path, block, options)
signature = compile!(verb, path, block, **options)
(@routes[verb] ||= []) << signature
invoke_hook(:route_added, verb, path, block)
signature
Expand Down Expand Up @@ -1639,7 +1639,7 @@ def compile!(verb, path, block, **options)
end

def compile(path, route_mustermann_opts = {})
Mustermann.new(path, mustermann_opts.merge(route_mustermann_opts))
Mustermann.new(path, **mustermann_opts.merge(route_mustermann_opts))
end

def setup_default_middleware(builder)
Expand Down

0 comments on commit d423f56

Please sign in to comment.