glebm / rails_email_preview

Preview and edit app mailer templates in Rails.

Home Page:http://glebm.github.io/rails_email_preview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"warning: respond_to? is defined here"

denny opened this issue · comments

I'm seeing enthusiastic quantities of this warning on Ruby 3.0; it reads like there's another half to it that should come first, but I'm only getting screens full of this bit for some reason:

/home/denny/.rvm/gems/ruby-3.0.0/gems/rails_email_preview-2.2.2/lib/rails_email_preview/main_app_route_delegator.rb:11: warning: respond_to? is defined here

I think the fix is changing respond_to? to respond_to_missing? (you call the former, but implement the latter, if I'm remembering it right). I'll check and PR it at some point if it seems safe - backwards compatible etc.

(It's in Object, that must be a super-stable API, right?!)

I think the 'this looks like the second half of a two part message' tangent is probably the same general thing as mentioned here: https://bugs.ruby-lang.org/issues/17575

The respond_to? and respond_to_missing? methods seem to have been stable back at least as far as Ruby 2.0.0, so I think my change is safe 🙂 I'll push a PR in a minute.

By the way, the route delegator is a great idea, it made it so much easier to integrate REP into my own app - thank you for such a considerate feature!

I have stolen the concept (with credit!) for ShinyCMS now that it's heading towards being all modular, I hope you don't mind. 😃