aoc_generator 0.1.7 → 0.1.9

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: 4bba636ebf82c12a3532f3b89e1ef4190b6f6c3bd7a44e87ca7c1cc4458c203c
4
- data.tar.gz: dc0db27bf0088b133e1417bb043bf4df8739ed77b9bad86b84ccb5769dec5b94
3
+ metadata.gz: 209a280e6279d13cc27d005359020122010c13663798c8cde7b6ae381ce682e2
4
+ data.tar.gz: 20bdcc796e05cc57fbc083636b37fd28b79e5424c6d8afac0471f36936fdb952
5
5
  SHA512:
6
- metadata.gz: 8b377602a3fb8fb57bc3a63652d88ac280e1f879443e19cce3cb5eeb95e69719b8badc3169aedee722f58113d5c3ba1d7180a0b5d578cff941b1d4539c0cc1a3
7
- data.tar.gz: a6b06f2cb5dce4de4c9e34355fe65e21c16329269e52ba83e1389d5dd4318e2f6a41f68fe02f17aa39467da55dc6c0ead2358b20c95ea33e61054d82ea096089
6
+ metadata.gz: dfe0ed279f24ea63b3cc9d03328a1036c391ad6c20db56649b8b1fc4e384a11c7052d3d91c197f33a3eddebc850a0d85fdaf149acdd6c8d8bd44b2a0132d161b
7
+ data.tar.gz: 0b37f8320f04605a1e6ef7c5bc1d2bc0c541a1c7c33c45d1eac19965bb99a299bc0f4baa1e6a4bb047375945fc43676c013f7c65eb140dcb3c742c496f982249
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.9] - 2024-12-02
4
+
5
+ - Output to stdout which files were generated
6
+
7
+ ## [0.1.8] - 2024-12-02
8
+
9
+ - Use commented-out code in templates
10
+
3
11
  ## [0.1.7] - 2024-12-01
4
12
 
5
13
  - Change README.md to PUZZLE_DESCRIPTION.md
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aoc_generator (0.1.7)
4
+ aoc_generator (0.1.9)
5
5
  fileutils (~> 1.7)
6
6
  nokogiri (~> 1.16)
7
7
  thor (~> 1.3)
data/README.md CHANGED
@@ -75,11 +75,11 @@ The generator creates the following files with basic templates:
75
75
  ```ruby
76
76
  class DayXX
77
77
  def part_one(input)
78
- # Your solution for part 1
78
+ # Your solution for Part One
79
79
  end
80
80
 
81
81
  def part_two(input)
82
- # Your solution for part 2
82
+ # Your solution for Part Two
83
83
  end
84
84
  end
85
85
  ```
@@ -87,8 +87,31 @@ end
87
87
  ### `day_XX_spec.rb`
88
88
 
89
89
  ```ruby
90
- RSpec.describe DayXX do
91
- # Example test cases from the puzzle
90
+ RSpec.describe Cheddachedda::YearXXXX::DayXX do
91
+ it "solves Part One" do
92
+ input = <<~INPUT
93
+ 1abc2
94
+ pqr3stu8vwx
95
+ a1b2c3d4e5f
96
+ treb7uchet
97
+ INPUT
98
+
99
+ expect(described_class.part_one(input)).to eq(142)
100
+ end
101
+
102
+ # it "solves Part Two" do
103
+ # input = <<~INPUT
104
+ # two1nine
105
+ # eightwothree
106
+ # abcone2threexyz
107
+ # xtwone3four
108
+ # 4nineeightseven2
109
+ # zoneight234
110
+ # 7pqrstsixteen
111
+ # INPUT
112
+
113
+ # expect(described_class.part_two(input)).to eq(281)
114
+ # end
92
115
  end
93
116
  ```
94
117
 
@@ -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
@@ -72,11 +77,11 @@ module AdventOfCodeGenerator
72
77
  module Year#{@year}
73
78
  class Day#{@day}
74
79
  def self.part_one(input)
75
- raise NotImplementedError
80
+ # Your solution for Part One
76
81
  end
77
82
 
78
83
  def self.part_two(input)
79
- raise NotImplementedError
84
+ # Your solution for Part Two
80
85
  end
81
86
  end
82
87
  end
@@ -104,13 +109,13 @@ module AdventOfCodeGenerator
104
109
  expect(described_class.part_one(input)).to eq(#{expectations[0]})
105
110
  end
106
111
 
107
- it "solves Part Two", skip: "not implemented yet" do
108
- input = <<~INPUT
109
- #{input[1]&.gsub("\n", "\n ")}
110
- INPUT
112
+ # it "solves Part Two" do
113
+ # input = <<~INPUT
114
+ # #{input[1]&.gsub("\n", "\n # ")}
115
+ # INPUT
111
116
 
112
- expect(described_class.part_two(input)).to eq(#{expectations[1]})
113
- end
117
+ # expect(described_class.part_two(input)).to eq(#{expectations[1]})
118
+ # end
114
119
  end
115
120
  RUBY
116
121
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AdventOfCodeGenerator
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.9"
5
5
 
6
6
  class Error < StandardError; end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aoc_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Nguyen