drapergem / draper

Decorators/View-Models for Rails Applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Draper is incompatible with Ruby 3

brian-kephart opened this issue · comments

Similar to #869. My test suite spat this out:

gem_path/draper-4.0.1/lib/draper/helper_proxy.rb:32: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
gem_path/actionview-6.0.3/lib/action_view/helpers/translation_helper.rb:118: warning: The called method `l' is defined here

The referenced method in ActionView does indeed take keyword arguments. However, the Draper method that causes the warning doesn't appear to be using keyword arguments:

view_context.send(name, *args, &block)

This appears to be a delegation issue as described here. I'm not well-up on delegation techniques or Draper usage, so I won't be submitting a PR for this myself. Hopefully someone else can shed some light on the issue.

Seeing the same warning coming from draper-4.0.1/lib/draper/automatic_delegation.rb:12.

I am getting same warning with following Tech Stack
Ruby: 2.7.1
Rails 6.0.3.3
Draper: 4.0.1


/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/actionview-6.0.3.3/lib/action_view/helpers/translation_helper.rb:60: warning: The called method t is defined here```

Updated the issue title. The deprecations in Ruby 2.7 weren't fixed, so Draper doesn't work with 3.0.

Addressed this in #894.

Fixed in #885