advent_of_code_cli 0.1.0 → 0.1.2

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: 40a3d28987a670e64da5dccfaf7f85188048177fcfc71f66da9549a2ada459c1
4
- data.tar.gz: 4c971d73e6938e037554be47b30d08c332bdc3660260bcd75bdb98d63923f238
3
+ metadata.gz: 35f78ceadc5e206cc38c1384188d68b60fd1e7c747836493f65ff140f771946f
4
+ data.tar.gz: 811234a1a95f4e87fb93f5b842ab057c1c5a9f5e0b3a8eb19a05aeaa350e72e6
5
5
  SHA512:
6
- metadata.gz: bfd5752831e6b2e1e4966f8ad238171ff0295f74265d09a9be531a81d0546cd78f2953c46fcf81ee38c444a97e3e7c9099767f41c7d9064782cb9cc5bb300bfb
7
- data.tar.gz: 176c43dd61b0a5eaeccec0b784ffe6a3e52d7d2c91eebbce108a60412dd4f90cfba4de11ac6d001cb1811018c19dfa7b59748d974b6529ddbc534ee6a0c66b96
6
+ metadata.gz: d95a59af2fcc9fda9ecc953e8156edb826329637ba6c5093af53ddd118e4becff8b65c92a41868a9612e79512cb54e15411a6c6a664c65b75b84e59e1ddd7411
7
+ data.tar.gz: c469d86e56cbf45d67b3f28966a724f7c6036ed642d30ca218f3d1908429e62929491fed86da69ae1eb6eecb80168720ec8d3c992c94aa7e7e013f48a4d1c3b3
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- advent_of_code_cli (0.1.0)
4
+ advent_of_code_cli (0.1.2)
5
+ thor (>= 1.2.0)
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
@@ -31,11 +31,11 @@ module AdventOfCode
31
31
  private
32
32
 
33
33
  def cookie
34
- @cookie ||= File.read("cookie.txt").strip
34
+ @cookie ||= ENV["AOC_COOKIE"]
35
35
  end
36
36
 
37
37
  def cookie_present?
38
- File.exist?("cookie.txt")
38
+ ENV.key?("AOC_COOKIE")
39
39
  end
40
40
 
41
41
  def fetch_input
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "commands/command"
4
- require_relative "commands/cookie"
5
4
  require_relative "commands/download"
6
5
  require_relative "commands/scaffold"
7
6
  require_relative "commands/solve"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AdventOfCode
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
@@ -20,11 +20,6 @@ module AdventOfCode
20
20
  rescue_invalid_day_error
21
21
  end
22
22
 
23
- desc "cookie VALUE", "store your Advent of Code cookie with value VALUE in the cookie.txt file"
24
- def cookie(value)
25
- AdventOfCode::Commands::Cookie.new(value: value).execute
26
- end
27
-
28
23
  desc "download DAY", "download your input for day DAY"
29
24
  option :year, default: Time.now.year.to_s
30
25
  def download(day)
@@ -32,7 +27,7 @@ module AdventOfCode
32
27
  rescue AdventOfCode::InvalidDayError
33
28
  rescue_invalid_day_error
34
29
  rescue AdventOfCode::MissingCookieError
35
- say "Error: Cannot find cookie in cookie.txt file.", :red
30
+ say "Error: Cannot find cookie in the AOC_COOKIE environment variable.", :red
36
31
  end
37
32
 
38
33
  desc "solve DAY", "run your solutions for day DAY"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: advent_of_code_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emily Samp
@@ -9,7 +9,21 @@ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
11
  date: 2022-12-01 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 1.2.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.2.0
13
27
  description:
14
28
  email:
15
29
  - emily.samp@icloud.com
@@ -30,7 +44,6 @@ files:
30
44
  - lib/advent_of_code_cli.rb
31
45
  - lib/advent_of_code_cli/commands.rb
32
46
  - lib/advent_of_code_cli/commands/command.rb
33
- - lib/advent_of_code_cli/commands/cookie.rb
34
47
  - lib/advent_of_code_cli/commands/download.rb
35
48
  - lib/advent_of_code_cli/commands/scaffold.rb
36
49
  - lib/advent_of_code_cli/commands/solve.rb
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module AdventOfCode
4
- module Commands
5
- class Cookie
6
- def initialize(value:)
7
- @value = value
8
- end
9
-
10
- def execute
11
- say "Creating cookie.txt file..."
12
- File.open("cookie.txt", "w") do |file|
13
- file.puts @value
14
- end
15
-
16
- say "Done!", :green
17
- end
18
- end
19
- end
20
- end