{"id":15512995,"url":"https://github.com/aldesantis/artic","last_synced_at":"2025-06-17T21:36:03.789Z","repository":{"id":52414940,"uuid":"69575157","full_name":"aldesantis/artic","owner":"aldesantis","description":"The scheduling toolkit for Ruby.","archived":false,"fork":false,"pushed_at":"2021-04-29T21:00:27.000Z","size":72,"stargazers_count":5,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-01T11:34:48.399Z","etag":null,"topics":["availability","calendar","ruby","time"],"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/aldesantis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-29T14:24:40.000Z","updated_at":"2024-09-25T15:40:07.000Z","dependencies_parsed_at":"2022-08-26T15:22:20.836Z","dependency_job_id":null,"html_url":"https://github.com/aldesantis/artic","commit_stats":null,"previous_names":["alessandro1997/artic"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/aldesantis/artic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldesantis%2Fartic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldesantis%2Fartic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldesantis%2Fartic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldesantis%2Fartic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aldesantis","download_url":"https://codeload.github.com/aldesantis/artic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldesantis%2Fartic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260443329,"owners_count":23010003,"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":["availability","calendar","ruby","time"],"created_at":"2024-10-02T09:54:00.472Z","updated_at":"2025-06-17T21:35:58.774Z","avatar_url":"https://github.com/aldesantis.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A.R.TI.C.\n\n[![Build Status](https://travis-ci.org/aldesantis/artic.svg?branch=master)](https://travis-ci.org/aldesantis/artic)\n[![Maintainability](https://api.codeclimate.com/v1/badges/bfcbbf050bd58ab46798/maintainability)](https://codeclimate.com/github/aldesantis/artic/maintainability)\n[![Coverage Status](https://coveralls.io/repos/github/aldesantis/artic/badge.svg?branch=master)](https://coveralls.io/github/aldesantis/artic?branch=master)\n\n**A** **R**uby gem for **TI**me **C**omputations.\n\nA.R.TI.C. can take questions like:\n\n\u003e If I'm available 9am-5pm on Mondays and I have a meeting from 10am to 1pm and another from 3pm\n\u003e to 4pm next Monday, when am I _free_ next Monday?\n\nAnd give you an answer like:\n\n\u003e You are free in these time slots:\n\u003e\n\u003e - 9am-10am;\n\u003e - 1pm-3pm;\n\u003e - 4pm-5pm.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'artic'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install artic\n\n## Usage\n\nFirst of all, you will need to create a new calendar:\n\n```ruby\ncalendar = Artic::Calendar.new\n```\n\n### Setting available times\n\nNow you can start defining the free slots in your calendar:\n\n```ruby\ncalendar.availabilities \u003c\u003c Artic::Availability.new(:monday, '09:00'..'11:00')\ncalendar.availabilities \u003c\u003c Artic::Availability.new(:monday, '11:00'..'13:00')\ncalendar.availabilities \u003c\u003c Artic::Availability.new(:monday, '15:00'..'19:00')\n```\n\nIf you want, you can also use specific dates in place of days of the week:\n\n```ruby\ncalendar.availabilities \u003c\u003c Artic::Availability.new(Date.parse('2016-10-03'), '15:00'..'19:00')\n```\n\nOr you can mix the two! In this case, we won't consider the availability slots for that day of the\nweek when calculating availabilities:\n\n```ruby\ncalendar.availabilities \u003c\u003c Artic::Availability.new(:monday, '09:00'..'17:00')\n\n# Only available 15-19 on Monday, October 3rd 2016.\ncalendar.availabilities \u003c\u003c Artic::Availability.new(Date.parse('2016-10-03'), '15:00'..'19:00')\n```\n\n### Defining occupations\n\nYou can also define some specific slots when you will be busy with something:\n\n```ruby\ncalendar.occupations \u003c\u003c Artic::Occupation.new(Date.parse('2016-09-26'), '10:00'..'12:00'))\n```\n\nThe times do not have to respect your availability slots:\n\n```ruby\ncalendar.occupations \u003c\u003c Artic::Occupation.new(Date.parse('2016-09-26'), '18:00'..'20:00'))\n```\n\n### Computing available slots\n\nThis is where the fun part begins. Suppose you want to get your work hours on Mondays:\n\n```ruby\ncalendar.available_slots_on(:monday)\n# =\u003e Artic::Collection::AvailabilityCollection[\n#   Artic::Availability\u003c:monday, 09:00..13:00\u003e,\n#   Artic::Availability\u003c:monday, 15:00..19:00\u003e\n# ]\n\n# We overrode this, remember?\ncalendar.available_slots_on(Date.parse('2016-10-03'))\n# =\u003e Artic::Collection::AvailabilityCollection[\n#   Artic::Availability\u003c2016-10-03 15:00..10:00\u003e\n# ]\n```\n\n### Computing free slots\n\nOr maybe you want to see when you have time for a meeting a particular Monday?\n\nIn that case, use `#free_slots_on` and we'll take care of removing any occupied times from your\navailable slots:\n\n```ruby\ncalendar.free_slots_on(Date.parse('2016-09-26'))\n# =\u003e Artic::Collection::AvailabilityCollection[\n#   Artic::Availability\u003c2016-09-26 09:00..13:00\u003e,\n#   Artic::Availability\u003c2016-09-26 15:00..18:00\u003e\n# ]\n```\n\n## Caveats\n\n- All times should be in the same timezone (ideally, UTC).\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run\nthe tests. You can also run `bin/console` for an interactive prompt that will allow you to\nexperiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new\nversion, update the version number in `version.rb`, and then run `bundle exec rake release`, which\nwill create a git tag for the version, push git commits and tags, and push the `.gem` file to\n[rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/aldesantis/artic.\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%2Faldesantis%2Fartic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faldesantis%2Fartic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldesantis%2Fartic/lists"}