Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentError parsing 1:00 #321

Closed
mdi opened this issue Sep 24, 2023 · 3 comments · Fixed by #323
Closed

ArgumentError parsing 1:00 #321

mdi opened this issue Sep 24, 2023 · 3 comments · Fixed by #323
Assignees

Comments

@mdi
Copy link

mdi commented Sep 24, 2023

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
Copy link
Author

mdi commented Oct 3, 2023

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

@olbrich
Copy link
Owner

olbrich commented Oct 3, 2023

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

@mdi
Copy link
Author

mdi commented Oct 3, 2023

@olbrich yes, it fixes the issue.

olbrich added a commit that referenced this issue Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants