olbrich / ruby-units

A unit handling library for ruby
MIT License
527 stars 109 forks source link

ArgumentError parsing 1:00 #321

Closed mdi closed 1 year ago

mdi commented 1 year ago

According to the docs, Unit.new("1:00") should return 1 h, but instead it actually returns:

irb(main):001> Unit.new("1:00")
/usr/local/bundle/gems/ruby-units-3.0.0/lib/ruby_units/unit.rb:1652:in `parse': '1:00' Unit not recognized (ArgumentError)

      raise(ArgumentError, "'#{passed_unit_string}' Unit not recognized") unless used.empty?
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
mdi commented 1 year ago

Hi @olbrich, is there a plan to merge #323 and release this soon? By the way, thanks for the quick fix!

olbrich commented 1 year ago

@mdi Can you verify that this works for you? If so, I'll make a point of releasing it this week.

mdi commented 1 year ago

@olbrich yes, it fixes the issue.