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

sinatra/reloader: Warnings with Ruby 2.7 #1587

Closed
DannyBen opened this issue Jan 2, 2020 · 1 comment
Closed

sinatra/reloader: Warnings with Ruby 2.7 #1587

DannyBen opened this issue Jan 2, 2020 · 1 comment

Comments

@DannyBen
Copy link

DannyBen commented Jan 2, 2020

Testing with Ruby 2.7.0-rc2 (which is the currently latest available with RVM), I am getting some warnings when sinatra/reloader is required.

Code to reproduce

# test.rb
require 'sinatra'
require "sinatra/reloader"

set :bind, "0.0.0.0"
set :port, 3000

get '/' do
  'Hello world!'
end

Output

$ ruby test.rb
/store/gems/ruby-2.7.0-rc2/gems/sinatra-contrib-2.0.8.1/lib/sinatra/reloader.rb:
308: warning: The last argument is used as keyword parameters; maybe ** should b
e added to the call
/store/gems/ruby-2.7.0-rc2/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1360: warnin
g: The called method `add_filter' is defined here
/store/gems/ruby-2.7.0-rc2/gems/sinatra-contrib-2.0.8.1/lib/sinatra/reloader.rb:275: warning: The last argument is used as keyword parameters; maybe ** should be added to the call
/store/gems/ruby-2.7.0-rc2/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1622: warning: The called method `compile!' is defined here
== Sinatra (v2.0.8.1) has taken the stage on 3000 for development with backup from Puma
Puma starting in single mode...
...

Versions

$ gem list sinatra
sinatra (2.0.8.1)
sinatra-contrib (2.0.8.1)

$ ruby -v
ruby 2.7.0rc2 (2019-12-22 master 75acbd5f00) [x86_64-linux]

Offending code

def compile!(verb, path, block, options = {})

and

def add_filter(type, path = nil, options = {}, &block)

I can confirm that changing both options = {} to **options removes the warnings.
I wanted to submit a PR, but running tests (even before the change) triggers tons of warnings and errors.

DannyBen added a commit to DannyBen/madman that referenced this issue Jan 10, 2020
@jkowens
Copy link
Member

jkowens commented Mar 13, 2020

Fixed by #1586

@jkowens jkowens closed this as completed Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants