{"id":26889762,"url":"https://github.com/abarrak/expiry_calculator","last_synced_at":"2026-02-26T19:05:50.705Z","repository":{"id":283975773,"uuid":"949181888","full_name":"abarrak/expiry_calculator","owner":"abarrak","description":"A ruby library that determines how much time left till certain date and time.","archived":false,"fork":false,"pushed_at":"2025-04-14T11:18:01.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T12:27:28.502Z","etag":null,"topics":["datetime","gem","ruby"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/expiry_calculator","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abarrak.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-15T21:26:00.000Z","updated_at":"2025-04-14T11:18:04.000Z","dependencies_parsed_at":"2025-04-14T12:37:22.185Z","dependency_job_id":null,"html_url":"https://github.com/abarrak/expiry_calculator","commit_stats":null,"previous_names":["abarrak/expiry_calculator"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abarrak%2Fexpiry_calculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abarrak%2Fexpiry_calculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abarrak%2Fexpiry_calculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abarrak%2Fexpiry_calculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abarrak","download_url":"https://codeload.github.com/abarrak/expiry_calculator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253655878,"owners_count":21943069,"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":["datetime","gem","ruby"],"created_at":"2025-03-31T21:56:26.257Z","updated_at":"2026-02-26T19:05:45.681Z","avatar_url":"https://github.com/abarrak.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Expiry Calculator\n\n[![Gem Version](https://badge.fury.io/rb/expiry_calculator.svg)](https://rubygems.org/gems/expiry_calculator)\n[![Build](https://github.com/abarrak/expiry_calculator/actions/workflows/ci.yml/badge.svg)](https://github.com/abarrak/expiry_calculator/actions/workflows/ci.yml)\n[![Code Coverage](https://qlty.sh/badges/26185eb3-29df-401a-b266-ce7123b55fc3/test_coverage.svg)](https://qlty.sh/gh/abarrak/projects/expiry_calculator)\n[![Maintainability](https://qlty.sh/badges/26185eb3-29df-401a-b266-ce7123b55fc3/maintainability.svg)](https://qlty.sh/gh/abarrak/projects/expiry_calculator)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\nA ruby library that determines how much time left till certain date and time.\u003cbr\u003e\n\u003e Extracted from [license manager app](https://github.com/abarrak/license-manager/).\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n```bash\nbundle add expiry_calculator\n```\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n```bash\ngem install expiry_calculator\n```\n\n## Usage\n\nAdd the library if gem auto loading is not available.\n\n```ruby\nrequire \"expiry_calculator\"\n```\n\nYou can use the the extendable module method:\n\n```ruby\nExpiryCalculator.calculate(2025, 10, 10)\n# =\u003e 201\n```\n\nOr mix in to use the calcuate function directly:\n\n```ruby\ninclude ExpiryCalculator\n\ncalculate Date.new(2025, 10, 10)\n# =\u003e 201\n```\n\n```ruby\ncalculate \"2025-01-10\"\n# =\u003e 0\n```\n\nActive record models and be called with the date field needed to calculate:\n\n```ruby\nuser = User.first\ncalculate user, :birth_day\n# =\u003e 15\n```\n\n\nThe supported objects:\n\n- `Date`\n- `DateTime`\n- `string`: attempted to be parsed as datetime object.\n- `ActiveRecord`: given an attribute of of the model to read as date object.\n\n## API Docs\n\nThe gem specs can [be found at RubyDocs.](https://www.rubydoc.info/gems/expiry_calculator)\n\n## Contributing\n\nBug reports and pull requests are welcome [on GitHub](https://github.com/abarrak/expiry_calculator).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabarrak%2Fexpiry_calculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabarrak%2Fexpiry_calculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabarrak%2Fexpiry_calculator/lists"}