advent 0.1.7 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -50
- data/lib/advent/templates/solution_test.rb.tt +5 -5
- data/lib/advent/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: fdcfa795a04fd42065602ed2e03f832c71cf23ddda7def8866ddd13d2e40e93c
|
4
|
+
data.tar.gz: 4ec1d2ae984ade4acfac011f6bed47aa5de43bf50f118fb8d9651fb71cc52c6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6eaac6614eee3b4d1c44058fe909e30e803a3c5e04f4dd29f23bf86eb45ccf651767bb4e79fd34c1bcc896f5fa14cba5be021eca5135ee1fc260f451f0536e88
|
7
|
+
data.tar.gz: 77709b3b0e46a7281cec2f93fc7c1e292adf0f84c421b933c6142b2a81401b55596570466aa8a8c2b9451097840d23d6c89b476e4f85201deb7d280f53c11344
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/advent.svg)](https://badge.fury.io/rb/advent)
|
4
4
|
|
5
|
-
Have fun with the [Advent of Code](https://
|
5
|
+
Have fun with the [Advent of Code](https://adventofcode.com) using Ruby.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -16,77 +16,57 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
16
16
|
|
17
17
|
## Usage
|
18
18
|
|
19
|
-
Initialise a new project somewhere:
|
20
|
-
|
21
|
-
```bash
|
22
|
-
mkdir advent_of_code && cd advent_of_code
|
23
|
-
|
24
|
-
# create a blank advent.yml config file
|
25
|
-
advent init
|
26
|
-
```
|
27
|
-
|
28
|
-
Configuration values and format are explained in the [Config](#config) section.
|
29
|
-
|
30
19
|
Advent expects you to have a working directory resembling something like:
|
31
20
|
|
32
21
|
$ tree
|
33
22
|
.
|
34
23
|
├── 2015
|
35
|
-
|
36
|
-
└── advent.yml
|
24
|
+
└── 2016
|
37
25
|
|
38
|
-
|
26
|
+
`advent` commands should be run from the root of this directory tree.
|
39
27
|
|
40
|
-
|
41
|
-
|
42
|
-
$ advent generate 2015 1 # generate files to work in
|
43
|
-
$ advent download 2015 1 # download the input file
|
28
|
+
If you want to use `advent` for downloading challenge inputs, first auth:
|
44
29
|
|
45
|
-
$
|
30
|
+
$ advent auth
|
46
31
|
|
47
|
-
|
48
|
-
|
32
|
+
It will prompt you for your session cookie from
|
33
|
+
[adventofcode.com](https://adventofcode.com). Log in to the website and look
|
34
|
+
at your cookies, grab the `session` value and paste it into the prompt (it's
|
35
|
+
hidden). This will be saved in `.advent_session` which should also have been
|
36
|
+
added to your `.gitignore` if you're in a git repo.
|
49
37
|
|
50
|
-
|
51
|
-
|
52
|
-
$ advent help
|
53
|
-
|
54
|
-
## Config
|
38
|
+
The typical flow for tackling a daily challenge would be:
|
55
39
|
|
56
|
-
|
57
|
-
|
40
|
+
$ advent new 2015 1 # generates working files
|
41
|
+
$ advent download 2015 1 # downloads the input file
|
58
42
|
|
59
|
-
|
60
|
-
download_when_generating: true
|
61
|
-
remember_session: true
|
62
|
-
```
|
43
|
+
$ vim 2015/day1.rb test/2015/day1_test.rb # do your work
|
63
44
|
|
64
|
-
|
45
|
+
$ ruby test/2015/day1_test.rb # run any tests you may have
|
46
|
+
$ advent solve 2015/day1.rb # get your answers to submit on adventofcode.com
|
65
47
|
|
66
|
-
|
67
|
-
<dt>download_when_generating</dt>
|
68
|
-
<dd>
|
69
|
-
When you run `advent generate` it will automatically download the input file to
|
70
|
-
go with it
|
71
|
-
</dd>
|
48
|
+
A list of commands and help is available using `advent`:
|
72
49
|
|
73
|
-
|
74
|
-
<dd>
|
75
|
-
Save your session cookie in `.advent_session` when prompted so you don't need to
|
76
|
-
find it again
|
77
|
-
</dd>
|
78
|
-
</dl>
|
50
|
+
$ advent help
|
79
51
|
|
80
52
|
## Development
|
81
53
|
|
82
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
54
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
55
|
+
`rake test` to run the tests. You can also run `bin/console` for an interactive
|
56
|
+
prompt that will allow you to experiment.
|
83
57
|
|
84
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To
|
58
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To
|
59
|
+
release a new version, update the version number in `version.rb`, and then run
|
60
|
+
`bundle exec rake release`, which will create a git tag for the version, push
|
61
|
+
git commits and the created tag, and push the `.gem` file to
|
62
|
+
[rubygems.org](https://rubygems.org).
|
85
63
|
|
86
64
|
## Contributing
|
87
65
|
|
88
|
-
Bug reports and pull requests are welcome on GitHub at
|
66
|
+
Bug reports and pull requests are welcome on GitHub at
|
67
|
+
[https://github.com/dnlgrv/advent-rb](https://github.com/dnlgrv/advent-rb).
|
89
68
|
|
90
69
|
## License
|
91
70
|
|
92
|
-
The gem is available as open source under the terms of the [MIT
|
71
|
+
The gem is available as open source under the terms of the [MIT
|
72
|
+
License](https://opensource.org/licenses/MIT).
|
@@ -1,18 +1,18 @@
|
|
1
1
|
require "advent"
|
2
2
|
require "minitest/autorun"
|
3
3
|
|
4
|
-
require_relative "
|
4
|
+
require_relative "../../<%= year %>/day<%= day %>"
|
5
5
|
|
6
6
|
class Day<%= day %>Test < Advent::TestCase
|
7
7
|
def setup
|
8
8
|
@solution = Day<%= day %>.new
|
9
9
|
end
|
10
10
|
|
11
|
-
# def
|
12
|
-
# assert_equal 123, @solution.
|
11
|
+
# def test_part_1
|
12
|
+
# assert_equal 123, @solution.part_1
|
13
13
|
# end
|
14
14
|
|
15
|
-
# def
|
16
|
-
# assert_equal 123, @solution.
|
15
|
+
# def test_part_2
|
16
|
+
# assert_equal 123, @solution.part_2
|
17
17
|
# end
|
18
18
|
end
|
data/lib/advent/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: advent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Grieve
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|