aocli 1.3.0 → 1.4.1
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/CHANGELOG.md +7 -1
- data/Gemfile.lock +1 -1
- data/lib/aocli/cli.rb +1 -1
- data/lib/aocli/commands/start_day.rb +2 -2
- data/lib/aocli/content/main.txt +32 -0
- data/lib/aocli/version.rb +1 -1
- data/lib/aocli.rb +0 -1
- metadata +3 -3
- data/lib/aocli/content/main.rb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d47b34fa6f185004e01d0f6016b9a6c630e096273d1e510d3f3f1f2796febb9
|
4
|
+
data.tar.gz: 15d4e15e99e14f379f36ee1ee6eb1465bbeac13d0db318ed1b317448eee73e12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f713a4be8442d109a025d47b6c405981f87ede512cefe11615f9fb1dd76d09cf82e77915cd0effe2828baac82c51db094942c064d817126e5236dbd985a72ae1
|
7
|
+
data.tar.gz: ac9db5eae098a4b0b07e323c1a31c4c2feb6bf397df40b5b64c5348ab8f92adbf1391799e3b898ceb36529547e7d4bc637ec76665d1b9f3e2b867f8515bb82fb
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
-
## [
|
3
|
+
## [1.3.0] - 2022-11-27
|
4
4
|
|
5
5
|
- Initial release
|
6
|
+
|
7
|
+
## [1.4.0] - 2022-11-27
|
8
|
+
|
9
|
+
- Reverses the order of years when selecting year in the CLI to show newest
|
10
|
+
first
|
11
|
+
- Update the template solution class to have a method for two parts
|
data/Gemfile.lock
CHANGED
data/lib/aocli/cli.rb
CHANGED
@@ -51,7 +51,7 @@ module Aocli
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def set_start_day_options
|
54
|
-
year = prompt.select("Which Year?", Aocli::Values::START_DAY_YEARS)
|
54
|
+
year = prompt.select("Which Year?", Aocli::Values::START_DAY_YEARS.reverse)
|
55
55
|
day = prompt.select("Which Day?", Aocli::Values::START_DAY_DAYS)
|
56
56
|
options[:date] = Date.new(year, 12, day)
|
57
57
|
options[:output_destination] = "./"
|
@@ -33,14 +33,14 @@ module Aocli
|
|
33
33
|
|
34
34
|
content = Aocli::FileUtils.insert_lines(
|
35
35
|
Aocli::FileUtils.wrap_lines(problem_description).split("\n").map { _1 == "" ? "#" : "# #{_1}" },
|
36
|
-
into:
|
36
|
+
into: File.read(File.join(__dir__, "../content/main.txt")),
|
37
37
|
after: "##### Part One Description #####",
|
38
38
|
)
|
39
39
|
|
40
40
|
Aocli::FileUtils.replace_line(
|
41
41
|
content,
|
42
42
|
"# __load_input__",
|
43
|
-
'input = File.read(
|
43
|
+
'input = File.read(__FILE__.gsub("main.rb", "input.txt"))'
|
44
44
|
)
|
45
45
|
end
|
46
46
|
|
@@ -0,0 +1,32 @@
|
|
1
|
+
##### Part One Description #####
|
2
|
+
|
3
|
+
class Solution
|
4
|
+
attr_accessor :input
|
5
|
+
def initialize(input)
|
6
|
+
@input = input
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.run!(input)
|
10
|
+
solution = new(parse_input(input))
|
11
|
+
<<~MSG
|
12
|
+
Part One: #{solution.part_one!}
|
13
|
+
Part Two: #{solution.part_two!}
|
14
|
+
MSG
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.parse_input(input)
|
18
|
+
# Parse input
|
19
|
+
input
|
20
|
+
end
|
21
|
+
|
22
|
+
def part_one!
|
23
|
+
# Solve part one
|
24
|
+
end
|
25
|
+
|
26
|
+
def part_two!
|
27
|
+
# Solve part two
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# __load_input__
|
32
|
+
puts Solution.run!(input)
|
data/lib/aocli/version.rb
CHANGED
data/lib/aocli.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aocli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Astley
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -175,7 +175,7 @@ files:
|
|
175
175
|
- lib/aocli/cli.rb
|
176
176
|
- lib/aocli/commands/save_cookie.rb
|
177
177
|
- lib/aocli/commands/start_day.rb
|
178
|
-
- lib/aocli/content/main.
|
178
|
+
- lib/aocli/content/main.txt
|
179
179
|
- lib/aocli/cookie_retriever.rb
|
180
180
|
- lib/aocli/file_utils.rb
|
181
181
|
- lib/aocli/values.rb
|
data/lib/aocli/content/main.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
module Aocli
|
2
|
-
module Content
|
3
|
-
module Main
|
4
|
-
def self.content
|
5
|
-
<<~RUBY
|
6
|
-
##### Part One Description #####
|
7
|
-
|
8
|
-
class Solution
|
9
|
-
attr_accessor :input
|
10
|
-
def initialize(input)
|
11
|
-
@input = input
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.run!(input)
|
15
|
-
new(parse_input(input)).run!
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.parse_input(input)
|
19
|
-
# Parse input
|
20
|
-
input
|
21
|
-
end
|
22
|
-
|
23
|
-
def run!
|
24
|
-
# Solve input
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
# __load_input__
|
29
|
-
puts Solution.run!(input)
|
30
|
-
RUBY
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|