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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6b9b02f670f239d02ce4b04aebc3520e82dfda9654ec8e031b929c9b2fcd379
4
- data.tar.gz: 260fcdaaa65f8652e075dae3f6d67f867692d1f50468ea058110de0ca9666397
3
+ metadata.gz: 9221e43617852ea0a93f97cc13df1dc604b7e597030dffced06b24ee3e3810a6
4
+ data.tar.gz: 943e273cf7026634f134ae3cc4914187a9ec7f28af2cbdc203d401915a9e66b3
5
5
  SHA512:
6
- metadata.gz: 50e0b3d7d0debb618b240109d6da5d684e4327d6a66231c716a1d0f18e5e17287082449a08f25bf685c7cd8a2bd186f55f88d0b4c7f9b813454cfdc181637d1b
7
- data.tar.gz: 30d87e13feb0c05846b86df8563ccdc407ea6136cbbd39e1865104a6a00e2d15c9b0727533e70d806ba79e2ff3d7155cac8ff1b4bfa96e0b22783a259a4ef02e
6
+ metadata.gz: 76b52a53c7a2cf3e81b0ab3d84c55ab6c12733ebe2586921999d9a728cdc172deea72389d29439cdb6b9bc752938a81a2152d3d4f15d6a536231b7c0f8ca0068
7
+ data.tar.gz: db4138ca832aaee0996101a3b2efa5e2facd617c4253e7ef1853912f9062f985da7091caca3af6f29498f5aaa53f908512967d105decfaca19a5cef6185d07c0
data/.gitignore CHANGED
@@ -12,3 +12,10 @@
12
12
  .rspec_status
13
13
  /.idea/
14
14
 
15
+ # environment files
16
+ .ruby-gemset
17
+ .ruby-version
18
+
19
+ # gem build files
20
+ *.gem
21
+
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.3...HEAD
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(input) }
118
+ AocRb::PuzzleSource.run_part('part 1') { puzzle.part_1 }
115
119
  puts
116
- AocRb::PuzzleSource.run_part('part 2') { puzzle.part_2(input) }
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
@@ -8,6 +8,10 @@ require "thor"
8
8
 
9
9
  module AocRb
10
10
  class Cli < Thor
11
+ def self.exit_on_failure?
12
+ false
13
+ end
14
+
11
15
  desc "new NAME", "Creates a new AoC project with the given name"
12
16
 
13
17
  def new(name)
@@ -1,3 +1,3 @@
1
1
  module AocRb
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.5"
3
3
  end
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.3
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-06-01 00:00:00.000000000 Z
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.0.9
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