advent_of_code_cli 0.1.5 → 0.1.7

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: 975ed7c8275bc2111366961b426b01ba4805835876aa47ada28cb45a8296a56d
4
- data.tar.gz: e3ecbe525361d68da73e13906adda1594354d9bfc1727a85a752f57114673685
3
+ metadata.gz: e99e30130801298c54dc4fe7e79088c257bd7a2591f82ffaf20b64f70c0135e2
4
+ data.tar.gz: eeba2b9eb878ba526f92c96d7a02c15b89239715ef864f2fd3b1d434c2ecbf04
5
5
  SHA512:
6
- metadata.gz: 2bcc6d477acc45cb34b0bbea2c7f2f0cb904b3e76b80847267de80db2d2f5dfcaf96ec0078c080e6de44a4cd45cbe008708199090d4cd0a59fda6147bf2d556e
7
- data.tar.gz: 7b912eaa46ee7e047aed2bc94ed7997e097317fef923ad4fdbd36d69885ff6be07002cf43ba0409d3b0e0ee916711301a85d1e7775f24c91c349f628dff9f48c
6
+ metadata.gz: 9bdff2486e12240e0f7fb939fac4250cd81c2664ab9059013f732c30198a6177aa98792844342dda53600716bec69650627994b27a1c5adff2f40e50af9e9223
7
+ data.tar.gz: f827594163b990ca24f5c0f535e196fc50a4663a5a5adb3b4ff0e4c144b720d5e7bbbfef921fc29f7cd1cdd6449fa1b2db1c2bd131a4f781b28ad05a36ce6c30
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- advent_of_code_cli (0.1.5)
4
+ advent_of_code_cli (0.1.7)
5
5
  thor (>= 1.2.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -20,7 +20,7 @@ Run `bundle install`.
20
20
 
21
21
  ### Scaffold
22
22
 
23
- This command will set up the files for any day of Advent of Code. It takes a nubmer between 1 and 25 as an argument.
23
+ This command will set up the files for any day of Advent of Code. It takes a number between 1 and 25 as an argument.
24
24
 
25
25
  ```bash
26
26
  bundle exec aoc_cli scaffold 1
@@ -65,6 +65,7 @@ In order for this to work, you must provide your Advent of Code session cookie t
65
65
  ```bash
66
66
  export AOC_COOKIE=your-cookie
67
67
  ```
68
+ To obtain the cookie, sign into Advent of Code through your browser, then use the developer tools to examine the headers for a page request. The `cookie:` header should contain a value like `session=a1b2c3...`. The part from `a1b2c3...` onwards is what your need for `AOC_COOKIE`.
68
69
 
69
70
  Once the environment variable is set, you can request your personal input for any day.
70
71
 
@@ -51,6 +51,8 @@ module AdventOfCode
51
51
  end
52
52
 
53
53
  say "Took #{end_time - start_time} seconds to solve"
54
+ rescue NotImplementedError
55
+ say "Part #{part} has not yet been implemented", :yellow
54
56
  end
55
57
 
56
58
  def expected_answers
@@ -4,16 +4,21 @@ module AdventOfCode
4
4
  module Commands
5
5
  class Scaffold < Command
6
6
  def execute
7
- say("Creating file: #{solution_file_name}...")
8
- create_file(solution_file_name, solution_file_contents)
7
+
8
+ unless File.exist?(solution_file_name)
9
+ say("Creating file: #{solution_file_name}...")
10
+ create_file(solution_file_name, solution_file_contents)
11
+ end
9
12
 
10
13
  unless Dir.exist?("inputs")
11
14
  say("Creating inputs directory...")
12
15
  Dir.mkdir("inputs")
13
16
  end
14
17
 
15
- say("Creating file: #{input_file_name}...")
16
- create_file(input_file_name)
18
+ unless File.exist?(input_file_name)
19
+ say("Creating file: #{input_file_name}...")
20
+ create_file(input_file_name)
21
+ end
17
22
 
18
23
  unless Dir.exist?("examples")
19
24
  say("Creating examples directory...")
@@ -33,6 +33,8 @@ module AdventOfCode
33
33
 
34
34
  say "Part #{part} result: #{result}"
35
35
  say "Took #{end_time - start_time} seconds to solve"
36
+ rescue NotImplementedError
37
+ say "Part #{part} has not yet been implemented", :yellow
36
38
  end
37
39
  end
38
40
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AdventOfCode
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.7"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: advent_of_code_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emily Samp
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-03 00:00:00.000000000 Z
11
+ date: 2022-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor