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

Add handler for values less than 1 #1

Merged
merged 3 commits into from
Sep 24, 2018
Merged

Add handler for values less than 1 #1

merged 3 commits into from
Sep 24, 2018

Conversation

ryderstorm
Copy link
Contributor

Before this change, the to_duration method returned an empty string ("") when it was called on a value less than 1. With this change, it will now return "Less than 1 second".

Before this change, the `to_duration` method returned an empty string ("") when it was called on a value less than 1. With this change, it will now return "Less than 1 second".
@coveralls
Copy link

coveralls commented Sep 19, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 3626866 on ryderstorm:feature/add-handler-for-value-less-than-one into 581527f on digaev:master.

@@ -42,6 +42,7 @@ def call
}.freeze

def to_units
return ['Less than 1 second'] if @value < 1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather use I18n instead of hard code this text.

@digaev digaev merged commit 6a747af into digaev:master Sep 24, 2018
@ryderstorm
Copy link
Contributor Author

@digaev - thanks for guidance on this! It's my first code contribution to OSS.

And thanks for making the awesome gem, I use it all the time 🥇

@ryderstorm ryderstorm deleted the feature/add-handler-for-value-less-than-one branch September 24, 2018 13:30
@digaev
Copy link
Owner

digaev commented Sep 24, 2018

@ryderstorm, thanks for contributing and pointing me to that issue, I wonder how could I miss it. Since you're using it so much notice that today I've released version 1.2, the main change is that an options (keys) of #to_duration method are now pluralized (year -> years etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants