aoc 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -8
- data/README.md +10 -18
- data/aoc.gemspec +1 -1
- data/bin/aoc +14 -1
- data/lib/aoc/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faa8a3235f95d551355cea01ee9bde5c77aee16ec62007425b1c8317850e9719
|
4
|
+
data.tar.gz: 963d67b1e96bfd7e425dbf24ea3f575be483aed51c2f80bc8e4543fca7e924c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35066eb71322b66e3da4bb98240639dd3746096bd4d004bff522fd2b80c32140aa1e4afa116b5bf480e6b02d5cf994d3fd08ff105455a3ce02a505752af58e23
|
7
|
+
data.tar.gz: ff9b3f9061aecbba7484566e00c93e3e8fe6fcaed1fb96b20e1825f834a3c9b88717051ff8113aa79fac583784adea9e6b937f60db300718cbd71774ea5a3486
|
data/Gemfile.lock
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
aoc (0.1
|
4
|
+
aoc (0.0.1)
|
5
5
|
nokogiri (~> 1.6, >= 1.6.8)
|
6
6
|
thor (~> 0.19.1)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
mini_portile2 (2.
|
12
|
-
minitest (5.
|
13
|
-
nokogiri (1.
|
14
|
-
mini_portile2 (~> 2.
|
15
|
-
rake (10.
|
11
|
+
mini_portile2 (2.4.0)
|
12
|
+
minitest (5.13.0)
|
13
|
+
nokogiri (1.10.5)
|
14
|
+
mini_portile2 (~> 2.4.0)
|
15
|
+
rake (10.5.0)
|
16
16
|
thor (0.19.4)
|
17
17
|
|
18
18
|
PLATFORMS
|
@@ -20,9 +20,9 @@ PLATFORMS
|
|
20
20
|
|
21
21
|
DEPENDENCIES
|
22
22
|
aoc!
|
23
|
-
bundler (~>
|
23
|
+
bundler (~> 2.0.2)
|
24
24
|
minitest (~> 5.0)
|
25
25
|
rake (~> 10.0)
|
26
26
|
|
27
27
|
BUNDLED WITH
|
28
|
-
|
28
|
+
2.0.2
|
data/README.md
CHANGED
@@ -1,23 +1,10 @@
|
|
1
1
|
# Aoc
|
2
|
+
Advent of Code toolkit to fetch inputs and submit answers efficiently.
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
4
|
+
Work is still in progress
|
6
5
|
|
7
6
|
## Installation
|
8
7
|
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'aoc'
|
13
|
-
```
|
14
|
-
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
8
|
$ gem install aoc
|
22
9
|
|
23
10
|
## Usage
|
@@ -28,8 +15,13 @@ You can bootstrap an advent of code challenge by using:
|
|
28
15
|
$ aoc bootstrap
|
29
16
|
```
|
30
17
|
|
31
|
-
This will create
|
32
|
-
|
18
|
+
This will create the following directory structure containing today's challenge instructions, input file and a solution.rb file where you can start coding your solution.
|
19
|
+
```
|
20
|
+
day8/
|
21
|
+
├── README
|
22
|
+
├── input.txt
|
23
|
+
├── solution.rb
|
24
|
+
```
|
33
25
|
|
34
26
|
You can also bootstrap a challenge of an other day:
|
35
27
|
```
|
@@ -65,7 +57,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
65
57
|
|
66
58
|
## Contributing
|
67
59
|
|
68
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
60
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/zergov/aoc.
|
69
61
|
|
70
62
|
## License
|
71
63
|
|
data/aoc.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = ["aoc"]
|
24
24
|
spec.require_paths = ["lib"]
|
25
25
|
|
26
|
-
spec.add_development_dependency "bundler", "~>
|
26
|
+
spec.add_development_dependency "bundler", "~> 2.0.2"
|
27
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
28
28
|
spec.add_development_dependency "minitest", "~> 5.0"
|
29
29
|
|
data/bin/aoc
CHANGED
@@ -5,6 +5,12 @@ require 'thor'
|
|
5
5
|
require 'date'
|
6
6
|
|
7
7
|
class CLI < Thor
|
8
|
+
map %w[--version -v] => :__print_version
|
9
|
+
desc "--version, -v", "print the version"
|
10
|
+
def __print_version
|
11
|
+
puts Aoc::VERSION
|
12
|
+
end
|
13
|
+
|
8
14
|
desc "fetch [day] [year]", "fetch and display a challenge description. If no day and year, use today's date."
|
9
15
|
method_option :input, :aliases => "-i", :type => :boolean, :default => false, :desc => "only show the input of the challenge."
|
10
16
|
def fetch(day = Date.today.day, year = Date.today.year)
|
@@ -19,7 +25,8 @@ class CLI < Thor
|
|
19
25
|
begin
|
20
26
|
puts "Fetching: day #{day}, #{year}"
|
21
27
|
puts challenge.part1
|
22
|
-
puts
|
28
|
+
puts ""
|
29
|
+
puts challenge.part2 if challenge.part2?
|
23
30
|
rescue OpenURI::HTTPError
|
24
31
|
puts "Cannot find this challenge, make sure it exists."
|
25
32
|
end
|
@@ -30,6 +37,12 @@ class CLI < Thor
|
|
30
37
|
challenge = Aoc::Challenge.new(day, year)
|
31
38
|
puts "Bootstrapping: day #{day}, #{year}"
|
32
39
|
|
40
|
+
begin
|
41
|
+
challenge.input
|
42
|
+
rescue OpenURI::HTTPError
|
43
|
+
return puts "Cannot find the input for your challenge. Make sure your session key is valid."
|
44
|
+
end
|
45
|
+
|
33
46
|
begin
|
34
47
|
dir = "day#{day}"
|
35
48
|
readme = File.join(dir, "README")
|
data/lib/aoc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Lalande
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.2
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.0.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
version: '0'
|
130
130
|
requirements: []
|
131
131
|
rubyforge_project:
|
132
|
-
rubygems_version: 2.7.
|
132
|
+
rubygems_version: 2.7.6
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Advent of Code toolkit
|