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

active_support/core_ext breaks JSON output, is it really needed? #28

Closed glennpratt closed 8 years ago

glennpratt commented 8 years ago

If duration is required in any of our projects it changes our JSON time formats, breaking our API. This is because of ActiveSupport::CoreExtensions:

http://api.rubyonrails.org/files/activesupport/lib/active_support/core_ext/object/json_rb.html

This is pretty bad behavior in my opinion. Are active_support/core_ext's really needed? I don't think it's a good idea for libraries to use them.

glennpratt commented 8 years ago

I converted this to a PR which just pushes the issue over to mongodb/mongoid. Since I don't use mongodb, that solves the issue for me.

I'm not sure why Travis-CI is failing, I don't think it's any change I made. I tried limiting iso8601 to a version that works on 1.9 and jruby since that was causing some fails.

Ping @peleteiro.

peleteiro commented 8 years ago

@glennpratt it's been quite a while I don't use ruby. I'm trying to find another owner for this project. Are you interested?

Meanwhile I'll try to take a look on this over the next weekend. Thanks.

glennpratt commented 8 years ago

@peleteiro I'd be happy to help maintain, though I can't guaranty response times or anything. :smile:

https://rubygems.org/profiles/glennpratt

glennpratt commented 8 years ago

@peleteiro seems like the issue was the version of bundler on different Travis Rubies. I added a gem install bundler and tests pass.

glennpratt commented 8 years ago

Thanks @peleteiro