Refinements have been in Ruby for quite a while now, and are no longer
experimental. It seems that it is time for ActiveSupport, the classic
example of a use for refinements, to actually begin using them. The
disadvantages I can see:
- using ActiveSupport::CoreExt
at the top of each file – not a big deal IMO
- confusing bugs as a result of forgetting to do so – could be
resolved with an Object#method_missing monkey-patch ("did you forget to
include the ActiveSupport refinement")
- No support for dynamic method calling
(some_object.[send|respond_to?|method]
:method_added_by_a_refinement never sees the method) – might be a
problem. Use caces for dynamic calling of AS extensions?
- This will be changed in the future.
The big advantage here is the ability to use ActiveSupport in gems
without fear of conflicts, but it will also prevent things like monkey
patches in gems conflicting with ActiveSupport.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.