aocli 1.3.0 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -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 +18 -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: 60662ef88232a0369f7e872135703c7be791e79a3153b30b3ee2330066e1cd38
|
4
|
+
data.tar.gz: 4bb872f0f27158da4246c5a5e738f9e3aeb0c6b42a36618d730c693f48be10f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4de2d92da6373ace00ff3f169dbc937102582c7ad78b52b08bfbf0f720d217654ea695079dde2665e9dcac53899f5395359f2a51c74c614b9cfa77a082b37a69
|
7
|
+
data.tar.gz: 84d280681c4334897089cb32cb95e2f597706d024ff7385b561903649860becbe68ec9e26cd042e952dc0649b875c252d79d927c33b5565b5a4c8143a012c8cb
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
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
|
12
|
+
|
13
|
+
## [1.4.3] - 2022-12-11
|
14
|
+
|
15
|
+
- Simplify the generated template
|
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,18 @@
|
|
1
|
+
##### Part One Description #####
|
2
|
+
|
3
|
+
def self.parse_input(input)
|
4
|
+
# Parse input
|
5
|
+
input
|
6
|
+
end
|
7
|
+
|
8
|
+
def part_one
|
9
|
+
# Solve part one
|
10
|
+
end
|
11
|
+
|
12
|
+
def part_two
|
13
|
+
# Solve part two
|
14
|
+
end
|
15
|
+
|
16
|
+
# __load_input__
|
17
|
+
puts "Part One: #{part_one(parse_input(input))}"
|
18
|
+
puts "Part Two: #{part_two(parse_input(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.2
|
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
|
11
|
+
date: 2022-12-11 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
|