vinistock / sail

Sail is a lightweight Rails engine that brings an admin panel for managing configuration settings on a live Rails app
Other
507 stars 32 forks source link

Deprecated syntax for implementing auth lambda fails in Ruby 3.x #330

Closed denny closed 3 years ago

denny commented 3 years ago

The to_prepare in engine.rb method uses an implicit block to set the auth lambda, which isn't allowed in Ruby 3.x (and is flagged by rubocop in 2.7.2, I think).

To Reproduce

Set config.dashboard_auth_lambda in a Ruby 3.x application and try to run it; it exits with the following error:

/home/denny/code/sail/lib/sail/engine.rb:54:in `new': tried to create Proc object without a block (ArgumentError)
  from /home/denny/code/sail/lib/sail/engine.rb:54:in `to_prepare'
  from /home/denny/code/sail/lib/sail/engine.rb:33:in `block in <class:Engine>'
  [...]
vinistock commented 3 years ago

Fixed by #331