aoc_rb 0.0.0 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +41 -18
- data/lib/aoc_rb/app_loader.rb +2 -0
- data/lib/aoc_rb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d763b1d508f20a6ac9a31196dcca33a6ab06fef1f8f4dcf86f97644bedc5209
|
4
|
+
data.tar.gz: e91707d5c8f0c8249d11ba8882b18dbf89373ba6e72a0bb3a96800d2122db768
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1c324fc8c23867c6fea7586e7296fc89dba3f6473e9c5328aad328b3171197203215339e43058befaf0da2d4e705c445881d5a90e383c566433718f8ebf3c43
|
7
|
+
data.tar.gz: f4c7d9c2c8e0df6ee897c2acb68de5e252054f664c780bf0c245dcb8dbb573bbca09edaeb99a89dcf9f479114193f978dd37ae277cef01128c2c3a706f173f16
|
data/README.md
CHANGED
@@ -1,39 +1,62 @@
|
|
1
1
|
# AocRb
|
2
2
|
|
3
|
-
|
3
|
+
This gem provides a simple way to create a project for solving [Advent of Code](https://adventofcode.com) puzzles.
|
4
4
|
|
5
|
-
|
5
|
+
It also provides some handy tools to automate your interactions with the Advent of Code website.
|
6
6
|
|
7
|
-
##
|
7
|
+
## Getting Started
|
8
8
|
|
9
|
-
|
9
|
+
First of all, install the gem:
|
10
10
|
|
11
|
-
|
12
|
-
gem 'aoc_rb'
|
13
|
-
```
|
11
|
+
$ gem install aoc_rb
|
14
12
|
|
15
|
-
|
13
|
+
Next, generate your Advent of Code project:
|
16
14
|
|
17
|
-
$
|
15
|
+
$ aoc new my-project-name
|
16
|
+
|
17
|
+
This will generate a new project with the given name. After this you should be ready to go!
|
18
18
|
|
19
|
-
|
19
|
+
$ cd my-project-name
|
20
|
+
$ aoc
|
21
|
+
|
22
|
+
Before running any commands, you must set up your `AOC_COOKIE` environment variable:
|
20
23
|
|
21
|
-
$
|
24
|
+
$ cp .env-template .env
|
22
25
|
|
23
|
-
|
26
|
+
You'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.
|
27
|
+
In Chrome you can do this via [chrome settings](chrome://settings/cookies/detail?site=adventofcode.com) by entering `chrome://settings/cookies/detail?site=adventofcode.com` in your address bar. Just click on `session` and copy your key from the `Content` section.
|
24
28
|
|
25
|
-
|
29
|
+
Now edit the new `.env` file, so that it looks like the following, replacing `ABCDE12345` with the session key you just copied:
|
26
30
|
|
27
|
-
|
31
|
+
AOC_COOKIE=ABCDE12345
|
28
32
|
|
29
|
-
|
33
|
+
You're now able to run all the `aoc` commands provided by this gem.
|
34
|
+
|
35
|
+
You'll see you have a few options when running the `aoc` command within your project.
|
30
36
|
|
31
|
-
|
37
|
+
`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:
|
32
38
|
|
33
|
-
|
39
|
+
$ aoc prep 2017 12
|
40
|
+
|
41
|
+
This 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.
|
42
|
+
|
43
|
+
In `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!
|
44
|
+
|
45
|
+
When you've got a working solution you can see what it generates by running:
|
34
46
|
|
35
|
-
|
47
|
+
$ aoc exec
|
48
|
+
|
49
|
+
Which runs todays solution. For previous days, just like with `prep`, you can provide a date:
|
50
|
+
|
51
|
+
$ aoc exec 2017 12
|
52
|
+
|
53
|
+
If 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.
|
54
|
+
|
55
|
+
Rinse & repeat!
|
56
|
+
|
57
|
+
## Contributing
|
36
58
|
|
59
|
+
Bug 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).
|
37
60
|
|
38
61
|
## License
|
39
62
|
|
data/lib/aoc_rb/app_loader.rb
CHANGED
data/lib/aoc_rb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aoc_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Pascoe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|