{"id":13778843,"url":"https://github.com/pacso/aoc_rb","last_synced_at":"2025-09-25T01:30:24.164Z","repository":{"id":39006083,"uuid":"315462308","full_name":"pacso/aoc_rb","owner":"pacso","description":"Ruby toolkit for Advent of Code","archived":false,"fork":false,"pushed_at":"2022-12-03T17:14:32.000Z","size":53,"stargazers_count":19,"open_issues_count":0,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-04-25T02:25:21.819Z","etag":null,"topics":["advent-of-code","ruby"],"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/pacso.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-23T23:05:38.000Z","updated_at":"2023-11-30T08:42:41.000Z","dependencies_parsed_at":"2023-01-22T21:00:53.545Z","dependency_job_id":null,"html_url":"https://github.com/pacso/aoc_rb","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacso%2Faoc_rb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacso%2Faoc_rb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacso%2Faoc_rb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacso%2Faoc_rb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pacso","download_url":"https://codeload.github.com/pacso/aoc_rb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234141470,"owners_count":18785856,"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":["advent-of-code","ruby"],"created_at":"2024-08-03T18:00:58.116Z","updated_at":"2025-09-25T01:30:23.606Z","avatar_url":"https://github.com/pacso.png","language":"Ruby","readme":"# AocRb\n\n[![Gem Version](https://badge.fury.io/rb/aoc_rb.svg)](https://badge.fury.io/rb/aoc_rb)\n[![Tests](https://github.com/pacso/aoc_rb/actions/workflows/tests.yml/badge.svg)](https://github.com/pacso/aoc_rb/actions/workflows/tests.yml)\n\nThis gem provides a simple way to create a project for solving [Advent of Code](https://adventofcode.com) puzzles.\n\nIt also provides some handy tools to automate your interactions with the Advent of Code website.\n\nIf you want more help with your puzzles (use with care ... it'll take the fun out of doing it yourself) then take a look at [aoc_rb_helpers](https://github.com/pacso/aoc_rb_helpers).\n\n## Getting Started\n\nFirst of all, install the gem:\n\n    $ gem install aoc_rb\n\nNext, generate your Advent of Code project:\n\n    $ aoc new my-project-name\n    \nThis will generate a new project with the given name. After this you should be ready to go!\n\n    $ cd my-project-name\n    $ aoc\n    \nBefore running any commands, you must set up your `AOC_COOKIE` environment variable:\n\n    $ cp .env-template .env\n\nYou'll need to log in to the [Advent of Code](https://adventofcode.com) website and then grab a copy of your session key from your cookies.\nIn Chrome you can do this by opening the `Developer Tools` window (`⌥ ⌘ I` on Mac) when browsing the Advent of Code website. Within the `Application` tab, expand `Cookies` under `Storage` in the side menu and select `https://adventofcode.com`. This will then show you all of the cookies set by the website. You need to select the `session` cookie and copy the value. \n\nNow edit the new `.env` file, so that it looks like the following, replacing `ABCDE12345` with the session key you just copied:\n\n    AOC_COOKIE=ABCDE12345\n\nYou're now able to run all the `aoc` commands provided by this gem.\n    \nYou'll see you have a few options when running the `aoc` command within your project. Running `aoc help` will show you all of your options:\n\n    $ aoc help\n    Commands:\n      aoc exec            # executes and optionally submits the puzzle for today, or the specified date\n      aoc help [COMMAND]  # Describe available commands or one specific command\n      aoc output          # outputs results from your solution for the given day\n      aoc prep            # preps everything you need for a new puzzle\n      aoc spec            # runs tests for today, or the specified date\n      aoc version         # prints the current installed version of AocRb\n\nIf you want to see you options for a given command:\n\n    $ aoc help prep\n    Usage:\n      aoc prep\n    \n    Options:\n      -y, [--year=N]  \n      -d, [--day=N]   \n\nRunning `aoc prep` will set everything up for a new daily puzzle. It defaults to the puzzle for today, but you can work with older puzzles by passing the year and day: \n\n    $ aoc prep 2017 12\n\nThis will generate a `challenges/2017/12` folder with an `input.txt` file (your puzzle input), a `part_1.md` file with the instructions for part 1, and a `solution.rb` file for you to use when implementing your solution.\n\nIn `spec/2017/12` there will be a `solution_spec.rb` which you can use to write tests for your solution. It's a good idea to use the examples provided in the `part_1.md` to test your solution!\n\nWhen you've got a working solution you can see what it generates by running:\n\n    $ aoc exec\n\nWhich runs todays solution. For previous days, just like with `prep`, you can provide a date:\n\n    $ aoc exec 2017 12\n    \nIf you're happy with the output, you can respond to the prompt and `aoc` will submit your answer for you. If you're successful with part 1, it will automatically download the instructions for part 2 for you.\n\nRinse \u0026 repeat!\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/pacso/aoc_rb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/pacso/aoc_rb/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the AocRb project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/aoc_rb/blob/master/CODE_OF_CONDUCT.md).\n","funding_links":[],"categories":["Project Templates","Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpacso%2Faoc_rb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpacso%2Faoc_rb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpacso%2Faoc_rb/lists"}