By requiring "active_support/duration" you’re already forcing core extensions 
on your users. Take a look at 
https://github.com/rails/rails/blob/master/activesupport/lib/active_support/duration.rb#L1-L2





(And if you look at those files, they in turn require even more things from 
core_ext).




You might not be adding Integer#hours et al, but a bunch of other things are 
being added on Hash, Array, String…




Cheers,

-foca

On Sat, Mar 21, 2015 at 5:48 PM, Steve Jorgensen <ste...@stevej.name>
wrote:

> I'm not sure if this is the right place to ask about this, so my apologies 
> if it is not.
> I am interested in writing a Gem that takes advantage of ActiveSupport 
> durations, but I don't want to require using core extensions in order to 
> use my gem. I notice that there is a ActiveSupport::Duration class that I 
> can use, but its constructor is not documented. That makes me feel that if 
> to rely on it is to rely on an unpublished interface.
> Would it make sense for me to submit a PR to add documentation for 
> ActiveSupport::Duration constructor to make it more of an officially 
> supported thing?
> -- 
> 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 rubyonrails-core+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> Visit this group at http://groups.google.com/group/rubyonrails-core.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to