aoc_generator 0.1.8 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53517b89d8f104b0cd5924d2f09eeb6607f735131b80b7b0d6dd694da1b0a842
4
- data.tar.gz: cd46560f3dbd64457b37b5459bf13937474c41b97120b84ab0a2c57a36385579
3
+ metadata.gz: 87bb6bdad90acd0b30e35fc65693edf78b013b3296213f07afba6fd7bdd4e606
4
+ data.tar.gz: 6ee72895bee557c2c59152059bee3dfe7cabea0398a57a21d91f7f56d99ae587
5
5
  SHA512:
6
- metadata.gz: da3ec592eff238f75cd44853cdf7699f6ad4838a2b51796067f5e514743de03289a82201557d167ad7012958e8cb0715520d0e2fb090094ad0796a9662bb65bf
7
- data.tar.gz: cc84976227d250848e62b1025ff3b4bb00ea474047e64f105144bbe2311b2fe3cbfa1e52ffca75e7db0c58f8f269e01d02686a340c00d38c4c72c75d6fbda967
6
+ metadata.gz: 2c67f8eb67a10e215d6feb6ccce9e6b5867e4b27085caca60430364f0847c1fb39ef6ddc7a561bb95774a6c67e06196675827815a92dd2669a278c623ccf6600
7
+ data.tar.gz: 86881ffb81aee7dd4616f5f4340f62e49dbbd0dec2b08f869e1d6d5ae3d59345801c9e541b40f1bbddeeb9853c6d91fd512b6b9072f2763d32f650a6abc72bd2
data/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  # Changelog
2
2
 
3
- ## [0.1.8] - 2024-12-02
3
+ ## [0.1.11] - 2024-12-05
4
+
5
+ - Only parse the final code blocks as the test input
6
+
7
+ ## [0.1.10] - 2024-12-02
8
+
9
+ - Output to stdout which files were generated
10
+
11
+ ## [0.1.9]
12
+
13
+ - Fix a HTML-parsing bug for the test expectation
14
+
15
+ ## [0.1.8]
4
16
 
5
17
  - Use commented-out code in templates
6
18
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aoc_generator (0.1.8)
4
+ aoc_generator (0.1.11)
5
5
  fileutils (~> 1.7)
6
6
  nokogiri (~> 1.16)
7
7
  thor (~> 1.3)
@@ -43,10 +43,15 @@ module AdventOfCodeGenerator
43
43
  end
44
44
 
45
45
  def generate_file(file_data)
46
- return if file_data.require_session && @session.nil?
47
- return if File.exist?(file_data.path) && !file_data.allow_overwrite
46
+ return skip_file(file_data.path) if file_data.require_session && @session.nil?
47
+ return skip_file(file_data.path) if File.exist?(file_data.path) && !file_data.allow_overwrite
48
48
 
49
49
  File.write(file_data.path, file_data.content)
50
+ puts " \e[32mcreate\e[0m #{file_data.path}"
51
+ end
52
+
53
+ def skip_file(path)
54
+ puts " \e[33mskip\e[0m #{path}"
50
55
  end
51
56
 
52
57
  def puzzle_description
@@ -26,16 +26,14 @@ module AdventOfCodeGenerator
26
26
  end
27
27
 
28
28
  def test_input
29
- part_descriptions.map { |desc| desc.scan(/```sh\n(.*?)\n```/m) }.flatten
29
+ part_descriptions.map { |desc| desc.scan(/```sh\n(.*?)\n```/m).last }.flatten
30
30
  end
31
31
 
32
32
  def test_expectations
33
- part_descriptions
34
- .flat_map { |desc| desc.scan(/\*\*`(.*?)`\*\*/) }
35
- .map do |matches|
36
- match = matches.first
37
- match&.match?(/\A\d+\z/) ? match.to_i : match
38
- end.compact
33
+ part_descriptions.map do |desc|
34
+ match = desc.scan(/\*\*`(.*?)`\*\*/).flatten.last
35
+ match&.match?(/\A\d+\z/) ? match.to_i : match
36
+ end.compact
39
37
  end
40
38
 
41
39
  def articles
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AdventOfCodeGenerator
4
- VERSION = "0.1.8"
4
+ VERSION = "0.1.11"
5
5
 
6
6
  class Error < StandardError; end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aoc_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-01 00:00:00.000000000 Z
11
+ date: 2024-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fileutils