[Rails-core] Use refinements for ActiveSupport in Rails 6?

2015-12-31 Thread Gaelan
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

[Rails-core] Use refinements for ActiveSupport in Rails 6?

2016-01-01 Thread Mohamed Wael Khobalatte
Perhaps it's worth it to take a look at this project [1] which attempted more or less the same, make it work with ruby 2.2, then run the Rails tests with it instead of the original AS core extensions and see what you get. [1] https://github.com/amatsuda/activesupport-refinements On Thu, Dec 31, 2

Re: [Rails-core] Use refinements for ActiveSupport in Rails 6?

2016-01-01 Thread Xavier Noria
I am a bit skeptical. The theory is that reopeining classes is anarchy, who knows what's tossed where! But I look back at +10 years of Ruby and my observation is that it is not a problem. I personally have had zero conflicts, and as a consultant I can tell you I've see quite a few projects. There

Re: [Rails-core] Use refinements for ActiveSupport in Rails 6?

2016-01-01 Thread Ken Collins
Thanks Xavier, that pretty much sums up my thinking as well. - Ken > On Jan 1, 2016, at 7:06 AM, Xavier Noria wrote: > > I am a bit skeptical. > > The theory is that reopeining classes is anarchy, who knows what's tossed > where! But I look back at +10 years of Ruby and my observation is tha

Re: [Rails-core] Use refinements for ActiveSupport in Rails 6?

2016-01-01 Thread Xavier Noria
Let me give you some context and some initial thoughts. *Context* In general, Rails makes extensive use of class reopening. For some time loading AS was all or nothing, but some years ago there was an effort to separate monkey patches in units to be able to cherry-pick them. This had a few impl

Re: [Rails-core] Use refinements for ActiveSupport in Rails 6?

2016-01-05 Thread Matt Jones
> On Jan 1, 2016, at 10:31 AM, Xavier Noria wrote: > > Let me give you some context and some initial thoughts. > > > Context > > In general, Rails makes extensive use of class reopening. > > For some time loading AS was all or nothing, but some years ago there was an > effort to separate mo

Re: [Rails-core] Use refinements for ActiveSupport in Rails 6?

2016-01-05 Thread Xavier Noria
On Tue, Jan 5, 2016 at 10:10 PM, Matt Jones wrote: Based on > https://github.com/ruby/ruby/blob/v2_1_0/doc/syntax/refinements.rdoc , > there does not appear to be a way for a `require`d file to trigger `using` > in the parent file: > Right now, each file in Rails core is responsible for loading