aocli 1.3.0 → 1.4.2

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: 8c6091e0da2c8e5095487295b5ee075ffa44252864b43630205c28d6e393bc4c
4
- data.tar.gz: 8c1b2939b51eecda5d51e83f6c7389dc5d476622897a7f15423ee54b6187d0ac
3
+ metadata.gz: 60662ef88232a0369f7e872135703c7be791e79a3153b30b3ee2330066e1cd38
4
+ data.tar.gz: 4bb872f0f27158da4246c5a5e738f9e3aeb0c6b42a36618d730c693f48be10f1
5
5
  SHA512:
6
- metadata.gz: c88d2c4325a7670d4b531c58d394e709727384380c195086efd1fd490e9386c78a09268f295f4ecf5eed91b236c052acb5d38fde08d6848c27d82ac3ad6fc6f5
7
- data.tar.gz: 711b283c3b9537fa4cb443120144f7697b45020645123e6f026568b1e72dad8c0092f4195f695058e4adfe0f0163672577748388b07862eb522d3c392cf5e323
6
+ metadata.gz: 4de2d92da6373ace00ff3f169dbc937102582c7ad78b52b08bfbf0f720d217654ea695079dde2665e9dcac53899f5395359f2a51c74c614b9cfa77a082b37a69
7
+ data.tar.gz: 84d280681c4334897089cb32cb95e2f597706d024ff7385b561903649860becbe68ec9e26cd042e952dc0649b875c252d79d927c33b5565b5a4c8143a012c8cb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
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
12
+
13
+ ## [1.4.3] - 2022-12-11
14
+
15
+ - Simplify the generated template
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.2)
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,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
@@ -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.2"
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.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-30 00:00:00.000000000 Z
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.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