{"id":13483824,"url":"https://github.com/krainboltgreene/time-lord","last_synced_at":"2025-04-05T18:10:57.066Z","repository":{"id":62558985,"uuid":"1420634","full_name":"krainboltgreene/time-lord","owner":"krainboltgreene","description":"time-lord is a ruby gem that adds extra functionality to the time class.","archived":false,"fork":false,"pushed_at":"2017-03-27T08:19:08.000Z","size":463,"stargazers_count":155,"open_issues_count":7,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T17:12:05.684Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/krainboltgreene.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-02-28T07:54:29.000Z","updated_at":"2024-12-18T02:36:59.000Z","dependencies_parsed_at":"2022-11-03T11:15:30.529Z","dependency_job_id":null,"html_url":"https://github.com/krainboltgreene/time-lord","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krainboltgreene%2Ftime-lord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krainboltgreene%2Ftime-lord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krainboltgreene%2Ftime-lord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krainboltgreene%2Ftime-lord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krainboltgreene","download_url":"https://codeload.github.com/krainboltgreene/time-lord/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378149,"owners_count":20929297,"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","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":[],"created_at":"2024-07-31T17:01:15.652Z","updated_at":"2025-04-05T18:10:57.048Z","avatar_url":"https://github.com/krainboltgreene.png","language":"Ruby","funding_links":[],"categories":["Date and Time Processing"],"sub_categories":[],"readme":"**NOTICE**: This project is dead, feel free to take the name on rubygems.\n\ntime-lord\n=========\n\n  - [![Gem Version](https://badge.fury.io/rb/time-lord.png)](https://rubygems.org/gems/time-lord)\n  - [![Code Climate](https://codeclimate.com/github/krainboltgreene/time-lord.png)](https://codeclimate.com/github/krainboltgreene/time-lord)\n  - [![Build Status](https://travis-ci.org/krainboltgreene/time-lord.png)](https://travis-ci.org/krainboltgreene/time-lord)\n  - [![Dependency Status](https://gemnasium.com/krainboltgreene/time-lord.png)](https://gemnasium.com/krainboltgreene/time-lord)\n  - [![Coverage Status](https://coveralls.io/repos/krainboltgreene/time-lord/badge.png?branch=master)](https://coveralls.io/r/krainboltgreene/time-lord)\n\n`time-lord` is a gem that gives you more human like expressions for time and space math.\nUnderneath the covers `time-lord` gives you single purpose objects for handling the more complex parts of Time \u0026 Space.\nSpecifically conversion, periods between two points, and scaling.\n\n\nExamples\n--------\n\nIn `time-lord` you have Period objects:\n\n``` ruby\n1.hour.ago.class #=\u003e \u003cTimeLord::Period @beginning=2013-03-03 23:44:59 -0800, @ending=2013-03-04 00:44:59 -0800\u003e\n```\n\nPeriods, if forced into strings or integers, represent the number of seconds between the two points\n\n``` ruby\n1.hour.ago.to_i #=\u003e -3600\n```\n\nYou can also specify periods from other periods:\n\n``` ruby\n1.hour.from(1.day.ago) #=\u003e\n1.hour.till(100.years.from_now) #=\u003e\n```\n\nObviously Periods act a lot like a Range and can be coerced into one:\n\n``` ruby\n1.hour.ago.to_range #=\u003e 1362383339..1362386939\n```\n\nYou may have noticed the negative integer from `Period#to_i`.\nThis represents the period beginning before the ending.\nThe reverse comes from using `Period#from_now`:\n\n``` ruby\n1.hour.from_now.to_i #=\u003e 3600\n```\n\nPeriods also have a special `Period#to_words` method:\n\n``` ruby\n1.hour.ago.to_words #=\u003e \"1 hour ago\"\n200.minutes.ago.to_words #=\u003e \"3 hours ago\"\n```\n\nOf course you can also do fun Time math:\n\n``` ruby\nTime.now #=\u003e 2013-03-04 00:55:49 -0800\nTime.now - 2.hours #=\u003e 2013-03-03 22:55:50 -0800\n```\n\nTime is fun.\n\n\nInstalling\n----------\n\n**Requirements**\n\n1. A blue telephone box (optional)\n\nLike any other gem you can install it via the `gem` command:\n\n``` terminal\n$ gem install time-lord\n```\n\nAlthough I suggest using `bundler`:\n\n``` ruby\ngem 'time-lord', '~\u003e 1.0'\n```\n\n\n**Testing**\n\nTo make sure you did everything right, just do the following:\n\n```\n$ ruby -e \"1.hour.ago.to_words\"\n\u003e 1 hour ago\n```\n\n\nIssues \u0026 Documentation\n----------------------\n\n  * [Documentation](http://rubydoc.info/gems/time-lord)\n  * [Issues](https://github.com/krainboltgreene/time-lord/issues)\n\nAbsolutely feel free to contribute, please!\n\n\nChangelog\n---------\n\n**1.1.0**\n\n  * Adding `Integer#from()` and `Integer#till()` to calculate both points in a period easily.\n  * The Coverall guys fixed up my setup.\n  * Cleaned up the readme\n  * Added and fixed a bug that dealt with month exactness\n  * Documented a whole hell of a lot\n\n**1.0.0**\n\n  * Initial release\n\n\nContributing\n------------\n\n  1. Fork it\n  2. Create your feature branch (`git checkout -b my-new-feature`)\n  3. Commit your changes (`git commit -am 'Add some feature'`)\n  4. Push to the branch (`git push origin my-new-feature`)\n  5. Create new Pull Request\n\n\nCredits\n-------\n\n  * [Simon Hørup Eskildsen](https://github.com/Sirupsen) for the original work on time-ago-in-words gem\n  * [Henrik Enggaard](https://github.com/henrikh) for very useful commits pre-1.0\n  * [James Larkby-Lahet](https://github.com/wolfwood) for very useful commits pre-1.0\n  * [Nick Merwin](https://github.com/nickmerwin) for unfucking the coveralls setup\n  * [Christian Tietze](https://github.com/DivineDominion) for pointing out a mistake in the readme\n  * [Blaž Hrastnik](https://github.com/archSeer) for noticing and contributing tests for a bug in the timing logic past a month\n\n\nLicense\n-------\n\nCopyright (c) 2013 Kurtis Rainbolt-Greene\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrainboltgreene%2Ftime-lord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrainboltgreene%2Ftime-lord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrainboltgreene%2Ftime-lord/lists"}