aoc_rb 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +7 -0
- data/CHANGELOG.md +21 -1
- data/lib/aoc_rb/app.rb +21 -3
- data/lib/aoc_rb/cli.rb +4 -0
- data/lib/aoc_rb/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9221e43617852ea0a93f97cc13df1dc604b7e597030dffced06b24ee3e3810a6
|
4
|
+
data.tar.gz: 943e273cf7026634f134ae3cc4914187a9ec7f28af2cbdc203d401915a9e66b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76b52a53c7a2cf3e81b0ab3d84c55ab6c12733ebe2586921999d9a728cdc172deea72389d29439cdb6b9bc752938a81a2152d3d4f15d6a536231b7c0f8ca0068
|
7
|
+
data.tar.gz: db4138ca832aaee0996101a3b2efa5e2facd617c4253e7ef1853912f9062f985da7091caca3af6f29498f5aaa53f908512967d105decfaca19a5cef6185d07c0
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
|
+
- No unreleased changes!
|
9
|
+
|
10
|
+
## [0.2.5]
|
11
|
+
### Added
|
12
|
+
- New spec --all task to run all tests (by [@kauredo](https://github.com/kauredo))
|
13
|
+
- Tests for output task (by [@kauredo](https://github.com/kauredo))
|
14
|
+
|
15
|
+
### Changed
|
16
|
+
- Updated gitignore to exclude ruby environment and gem build files
|
17
|
+
- Updated all specs to use the generated test app folder, rather than the gem root dir ([#21](https://github.com/pacso/aoc_rb/pull/21) by [@pacso](https://github.com/pacso))
|
18
|
+
|
19
|
+
### Fixed
|
20
|
+
- Thor exit_on_failure deprecation warning (by [@kauredo](https://github.com/kauredo))
|
21
|
+
|
22
|
+
## [0.2.4]
|
23
|
+
### Fixed
|
24
|
+
- Output task fixed (by [@kauredo](https://github.com/kauredo))
|
25
|
+
- Spec task added to run tests from a given day (by [@kauredo](https://github.com/kauredo))
|
8
26
|
|
9
27
|
## [0.2.3]
|
10
28
|
### Changed
|
@@ -40,7 +58,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
40
58
|
|
41
59
|
Initial release.
|
42
60
|
|
43
|
-
[Unreleased]: https://github.com/pacso/aoc_rb/compare/v0.2.
|
61
|
+
[Unreleased]: https://github.com/pacso/aoc_rb/compare/v0.2.5...HEAD
|
62
|
+
[0.2.5]: https://github.com/pacso/aoc_rb/compare/v0.2.4...v0.2.5
|
63
|
+
[0.2.4]: https://github.com/pacso/aoc_rb/compare/v0.2.3...v0.2.4
|
44
64
|
[0.2.3]: https://github.com/pacso/aoc_rb/compare/v0.2.2...v0.2.3
|
45
65
|
[0.2.2]: https://github.com/pacso/aoc_rb/compare/v0.2.1...v0.2.2
|
46
66
|
[0.2.1]: https://github.com/pacso/aoc_rb/compare/v0.2.0...v0.2.1
|
data/lib/aoc_rb/app.rb
CHANGED
@@ -29,6 +29,10 @@ end
|
|
29
29
|
|
30
30
|
module AocRb
|
31
31
|
class App < Thor
|
32
|
+
def self.exit_on_failure?
|
33
|
+
false
|
34
|
+
end
|
35
|
+
|
32
36
|
desc "fetch", "Downloads the input file and problem statement for today, or an optionally specified year / day", hide: true
|
33
37
|
method_option :year, aliases: "-y", type: :numeric, default: Time.now.year
|
34
38
|
method_option :day, aliases: "-d", type: :numeric, default: Time.now.day
|
@@ -108,12 +112,26 @@ module AocRb
|
|
108
112
|
method_option :day, aliases: "-d", type: :numeric, default: Time.now.day
|
109
113
|
|
110
114
|
def output(year = options[:year], day = options[:day])
|
111
|
-
puzzle = AocRb::PuzzleSource.create_puzzle(year, day)
|
112
115
|
input = AocRb::PuzzleInput.load(year, day)
|
116
|
+
puzzle = AocRb::PuzzleSource.create_puzzle(year, day, input)
|
113
117
|
|
114
|
-
AocRb::PuzzleSource.run_part('part 1') { puzzle.part_1
|
118
|
+
AocRb::PuzzleSource.run_part('part 1') { puzzle.part_1 }
|
115
119
|
puts
|
116
|
-
AocRb::PuzzleSource.run_part('part 2') { puzzle.part_2
|
120
|
+
AocRb::PuzzleSource.run_part('part 2') { puzzle.part_2 }
|
121
|
+
end
|
122
|
+
|
123
|
+
desc "spec", "runs tests for today, or the specified date"
|
124
|
+
method_option :year, aliases: "-y", type: :numeric, default: Time.now.year
|
125
|
+
method_option :day, aliases: "-d", type: :numeric, default: Time.now.day
|
126
|
+
method_option :all, :type => :boolean, :aliases => "--all"
|
127
|
+
|
128
|
+
def spec(year = options[:year], day = options[:day])
|
129
|
+
if options[:all]
|
130
|
+
Kernel.exec( "bundle exec rspec" )
|
131
|
+
else
|
132
|
+
spec_dir = File.join("spec", year.to_s, AocRb::Puzzle.padded(day))
|
133
|
+
Kernel.exec( "bundle exec rspec #{spec_dir}" )
|
134
|
+
end
|
117
135
|
end
|
118
136
|
|
119
137
|
desc "prep", "preps everything you need for a new puzzle"
|
data/lib/aoc_rb/cli.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.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Pascoe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: '0'
|
159
159
|
requirements: []
|
160
|
-
rubygems_version: 3.
|
160
|
+
rubygems_version: 3.3.7
|
161
161
|
signing_key:
|
162
162
|
specification_version: 4
|
163
163
|
summary: A Ruby toolkit for Advent of Code
|