aocli 1.3.0 → 1.4.1

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: 8c6091e0da2c8e5095487295b5ee075ffa44252864b43630205c28d6e393bc4c
4
- data.tar.gz: 8c1b2939b51eecda5d51e83f6c7389dc5d476622897a7f15423ee54b6187d0ac
3
+ metadata.gz: 2d47b34fa6f185004e01d0f6016b9a6c630e096273d1e510d3f3f1f2796febb9
4
+ data.tar.gz: 15d4e15e99e14f379f36ee1ee6eb1465bbeac13d0db318ed1b317448eee73e12
5
5
  SHA512:
6
- metadata.gz: c88d2c4325a7670d4b531c58d394e709727384380c195086efd1fd490e9386c78a09268f295f4ecf5eed91b236c052acb5d38fde08d6848c27d82ac3ad6fc6f5
7
- data.tar.gz: 711b283c3b9537fa4cb443120144f7697b45020645123e6f026568b1e72dad8c0092f4195f695058e4adfe0f0163672577748388b07862eb522d3c392cf5e323
6
+ metadata.gz: f713a4be8442d109a025d47b6c405981f87ede512cefe11615f9fb1dd76d09cf82e77915cd0effe2828baac82c51db094942c064d817126e5236dbd985a72ae1
7
+ data.tar.gz: ac9db5eae098a4b0b07e323c1a31c4c2feb6bf397df40b5b64c5348ab8f92adbf1391799e3b898ceb36529547e7d4bc637ec76665d1b9f3e2b867f8515bb82fb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2022-11-27
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aocli (1.3.0)
4
+ aocli (1.4.1)
5
5
  activesupport (~> 7.0)
6
6
  faraday (~> 2.7)
7
7
  nokogiri (~> 1.13)
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: Aocli::Content::Main.content,
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("#{__FILE__}".gsub("main.rb", "input.txt"))'
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Aocli
4
- VERSION = "1.3.0"
4
+ VERSION = "1.4.1"
5
5
  end
data/lib/aocli.rb CHANGED
@@ -5,7 +5,6 @@ require("aocli/cli")
5
5
  require("aocli/commands/save_cookie")
6
6
  require("aocli/commands/start_day")
7
7
  require("aocli/file_utils")
8
- require("aocli/content/main")
9
8
  require("aocli/version")
10
9
  require("aocli/cookie_retriever")
11
10
  require("aocli/values")
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.3.0
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-30 00:00:00.000000000 Z
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.rb
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
@@ -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