{"id":26364616,"url":"https://github.com/davegregg/hour","last_synced_at":"2026-05-10T17:10:07.206Z","repository":{"id":56876680,"uuid":"88360055","full_name":"davegregg/hour","owner":"davegregg","description":"A simple Ruby class for handling hours and minutes, without the baggage of the Time or DateTime classes.","archived":false,"fork":false,"pushed_at":"2017-04-20T14:09:57.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-27T07:16:37.643Z","etag":null,"topics":["duration","gem","hours","interval","rails","ruby","time"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davegregg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-15T16:36:51.000Z","updated_at":"2017-04-15T19:53:58.000Z","dependencies_parsed_at":"2022-08-20T22:30:50.063Z","dependency_job_id":null,"html_url":"https://github.com/davegregg/hour","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/davegregg/hour","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davegregg%2Fhour","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davegregg%2Fhour/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davegregg%2Fhour/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davegregg%2Fhour/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davegregg","download_url":"https://codeload.github.com/davegregg/hour/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davegregg%2Fhour/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278846316,"owners_count":26056090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["duration","gem","hours","interval","rails","ruby","time"],"created_at":"2025-03-16T19:22:04.717Z","updated_at":"2025-10-08T17:25:19.615Z","avatar_url":"https://github.com/davegregg.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hour\n\nA simple class for handling hours and minutes, without the baggage of the Time or DateTime classes.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'hour'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install hour\n\n## Usage\n\nThe Hour class accepts an hour-and-minute, like so: `Hour::Hour.new('17:30')` or `Hour::Hour.new('48:00')`; alternatively: `Hour::Hour.new(17,30)` or `Hour::Hour.new(48)`.\n\nYou can also convert a Ruby Time object to a Hour object, like so: `Hour::Hour.from_time(Time.now)`.\n\nValid methods include:\n\n```ruby\ninterval = Hour.new(28, 30)\ninterval.hours\n  # =\u003e 28\ninterval.minutes\n  # =\u003e 30\ninterval.to_a\n  # =\u003e [28, 30]\ninterval.to_s\n  # =\u003e \"28:30\"\ninterval.to_seconds\n  # =\u003e 102600\ninterval.to_days\n  # =\u003e 1\ninterval.to_hours_less_days\n  # =\u003e 4\ninterval.to_formatted_s\n  # =\u003e \"1 day, 4 hours, 30 minutes\"\ninterval.to_time\n  # =\u003e 0000-01-02 04:30:00 +0000\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/davegregg/hour. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavegregg%2Fhour","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavegregg%2Fhour","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavegregg%2Fhour/lists"}