You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I realize this might be far-fetched since the gem has not been updated in a long time, but is there any possibility that support for Ruby 3.x will be implemented?
Ruby 3 introduces breaking changes related to keyword arguments and I suspect this causes errors with Sinja. Declaring a resource causes an ArgumentError in Ruby 3.0.1. For instance, this program:
.../.rvm/gems/ruby-3.0.1/gems/sinatra-2.1.0/lib/sinatra/base.rb:1650:in `route': wrong number of arguments (given 4, expected 2..3) (ArgumentError)
from .../.rvm/gems/ruby-3.0.1/gems/sinja-1.3.0/lib/sinja.rb:386:in `route'
from .../.rvm/gems/ruby-3.0.1/gems/sinatra-2.1.0/lib/sinatra/base.rb:1443:in `options'
from .../.rvm/gems/ruby-3.0.1/gems/sinatra-contrib-2.1.0/lib/sinatra/namespace.rb:341:in `prefixed'
from .../.rvm/gems/ruby-3.0.1/gems/sinatra-contrib-2.1.0/lib/sinatra/namespace.rb:234:in `block (2 levels) in prefixed'
from .../.rvm/gems/ruby-3.0.1/gems/sinja-1.3.0/lib/sinja/resource_routes.rb:12:in `registered'
from .../.rvm/gems/ruby-3.0.1/gems/sinatra-contrib-2.1.0/lib/sinatra/namespace.rb:249:in `block in register'
from .../.rvm/gems/ruby-3.0.1/gems/sinatra-contrib-2.1.0/lib/sinatra/namespace.rb:247:in `each'
from .../.rvm/gems/ruby-3.0.1/gems/sinatra-contrib-2.1.0/lib/sinatra/namespace.rb:247:in `register'
from .../.rvm/gems/ruby-3.0.1/gems/sinja-1.3.0/lib/sinja/resource.rb:28:in `registered'
from .../.rvm/gems/ruby-3.0.1/gems/sinatra-contrib-2.1.0/lib/sinatra/namespace.rb:249:in `block in register'
from .../.rvm/gems/ruby-3.0.1/gems/sinatra-contrib-2.1.0/lib/sinatra/namespace.rb:247:in `each'
from .../.rvm/gems/ruby-3.0.1/gems/sinatra-contrib-2.1.0/lib/sinatra/namespace.rb:247:in `register'
from .../.rvm/gems/ruby-3.0.1/gems/sinja-1.3.0/lib/sinja.rb:356:in `block in resource'
from .../.rvm/gems/ruby-3.0.1/gems/sinatra-contrib-2.1.0/lib/sinatra/namespace.rb:199:in `class_eval'
from .../.rvm/gems/ruby-3.0.1/gems/sinatra-contrib-2.1.0/lib/sinatra/namespace.rb:199:in `block in new'
from .../.rvm/gems/ruby-3.0.1/gems/sinatra-contrib-2.1.0/lib/sinatra/namespace.rb:189:in `initialize'
from .../.rvm/gems/ruby-3.0.1/gems/sinatra-contrib-2.1.0/lib/sinatra/namespace.rb:189:in `new'
from .../.rvm/gems/ruby-3.0.1/gems/sinatra-contrib-2.1.0/lib/sinatra/namespace.rb:189:in `new'
from .../.rvm/gems/ruby-3.0.1/gems/sinatra-contrib-2.1.0/lib/sinatra/namespace.rb:219:in `namespace'
from .../.rvm/gems/ruby-3.0.1/gems/sinja-1.3.0/lib/sinja.rb:333:in `resource'
from sinja_demo.rb:8:in `<class:App>'
from sinja_demo.rb:5:in `<main>'
whereas it works fine when using Ruby 2.7.x.
I think Sinja looks really nice and it would definitely suit my needs, so fingers crossed this will be considered :)
Thanks!
The text was updated successfully, but these errors were encountered:
I forgot to mention that the stack trace was produced using Sinatra's master branch instead of rubygems.org. It contains fixes also related to keyword arguments that have not been released yet. See sinatra/sinatra#1720
Hi!
I realize this might be far-fetched since the gem has not been updated in a long time, but is there any possibility that support for Ruby 3.x will be implemented?
Ruby 3 introduces breaking changes related to keyword arguments and I suspect this causes errors with Sinja. Declaring a
resource
causes anArgumentError
in Ruby 3.0.1. For instance, this program:yields:
whereas it works fine when using Ruby 2.7.x.
I think Sinja looks really nice and it would definitely suit my needs, so fingers crossed this will be considered :)
Thanks!
The text was updated successfully, but these errors were encountered: