josedonizetti / ruby-duration

Immutable type that represents some amount of time with accuracy in seconds.
http://bit.ly/ruby-duration
MIT License
124 stars 23 forks source link

Make mongoid a soft dependency. #3

Closed kenn closed 12 years ago

kenn commented 12 years ago

I use mongoid in some projects, and I like it a lot, but when I don't, it's too huge as a runtime dependency.

Also you don't need require "#{File.dirname(__FILE__)}/duration" as explained here:

http://guides.rubygems.org/patterns/#loading-code

Gems should not have to use __FILE__ to bring in other Ruby files in your gem.
kenn commented 12 years ago

I just thought the point was to let users know from this point forward ruby-duration only supports mongoid 2.4 or later, as now it actually fails with mongoid 2.2, which is still widely used because mongoid 2.4 only supports MongoDB 2.0 or later and there are a lot of production MongoDB servers with the version 1.8 or earlier.

If we don't have the soft dependency informer, the definition will throw some error and it's up to users to find ruby-duration's supported version of mongoid has been raised.

mongoid is kind of a beast (break things on every minor releases), so if we want to catch up with it, it deserves a special care, IMO.

That said, I agree that removing mongoid from runtime dependency (and update README and say from this version mongoid 2.4 is required blah blah) is simpler and I'm fine with it, too.