aoc_rb 0.2.6 → 0.2.8

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: f512d480998f52892cd50b4ab4f2ede65c6a658f05d51d7a94cdc435737f7b3c
4
- data.tar.gz: 36fa102cf29463ec5e66c98683cc4be5b33a055799c94b18370a2158fc373f43
3
+ metadata.gz: 9296a14fa9788d9564dc6f23117b1a2f4d88bf2166bafe0abdfabdd76a2f3036
4
+ data.tar.gz: dfcb1459041a1aa38a1a21bb94b6daf6f6d19413d2316caa7650286aaacede54
5
5
  SHA512:
6
- metadata.gz: 3b51f8cee053e999a534a61076d4884bf4b1a0e02372af6901f51f5057fa16193d2cb269fffa1639ae7ecda36faf2dc0836a73d6c396314ee2a1a06df321c4d5
7
- data.tar.gz: df718b45fde0c6cf0d3510b995158d846ea9d03114b903be7cd18c765ee19715f5dd4699a13a9dbbf0c1db34f064263ff84c536d43cc54a6887060b261d9eaaf
6
+ metadata.gz: f87a5c30458a5047fab0a0a5e3af080f5dc4650185e284fc041cce4d1e31adbff85eb6caeb6b122b46b74f781a00b8e469f6640bffe97055c84d3d92132f391e
7
+ data.tar.gz: 74c8f875120ca7c142ada3c0c0366f674217f551609b3b1d9b4a35fc811bcd857352b8667eb25f770606c58803edd910641e98f1a3857a5433c64771c230fd79
data/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
  ## [Unreleased]
8
8
  - No unreleased changes!
9
9
 
10
+ ## [0.2.8]
11
+ ### Changed
12
+ - Updated the aoc command to self-heal the `bin/aoc` stub with the expected `AocRb::App.start` command ([#32](https://github.com/pacso/aoc_rb/pull/32) by [@pacso](https://github.com/pacso))
13
+
14
+ ## [0.2.7]
15
+ ### Added
16
+ - Version command, which outputs the installed version of the gem ([#30](https://github.com/pacso/aoc_rb/pull/30) by [@pacso](https://github.com/pacso))
17
+
10
18
  ## [0.2.6]
11
19
  ### Changed
12
20
  - Updated minimum gem versions for dependencies ([#26](https://github.com/pacso/aoc_rb/pull/26) by [@pacso](https://github.com/pacso))
@@ -62,7 +70,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
62
70
 
63
71
  Initial release.
64
72
 
65
- [Unreleased]: https://github.com/pacso/aoc_rb/compare/v0.2.5...HEAD
73
+ [Unreleased]: https://github.com/pacso/aoc_rb/compare/v0.2.8...HEAD
74
+ [0.2.8]: https://github.com/pacso/aoc_rb/compare/v0.2.7...v0.2.8
75
+ [0.2.7]: https://github.com/pacso/aoc_rb/compare/v0.2.6...v0.2.7
76
+ [0.2.6]: https://github.com/pacso/aoc_rb/compare/v0.2.5...v0.2.6
66
77
  [0.2.5]: https://github.com/pacso/aoc_rb/compare/v0.2.4...v0.2.5
67
78
  [0.2.4]: https://github.com/pacso/aoc_rb/compare/v0.2.3...v0.2.4
68
79
  [0.2.3]: https://github.com/pacso/aoc_rb/compare/v0.2.2...v0.2.3
data/README.md CHANGED
@@ -7,6 +7,8 @@ This gem provides a simple way to create a project for solving [Advent of Code](
7
7
 
8
8
  It also provides some handy tools to automate your interactions with the Advent of Code website.
9
9
 
10
+ If you want more help with your puzzles (use with care ... it'll take the fun out of doing it yourself) then take a look at [aoc_rb_helpers](https://github.com/pacso/aoc_rb_helpers).
11
+
10
12
  ## Getting Started
11
13
 
12
14
  First of all, install the gem:
@@ -27,7 +29,7 @@ Before running any commands, you must set up your `AOC_COOKIE` environment varia
27
29
  $ cp .env-template .env
28
30
 
29
31
  You'll need to log in to the [Advent of Code](https://adventofcode.com) website and then grab a copy of your session key from your cookies.
30
- In Chrome you can do this via [chrome settings](chrome://settings/cookies/detail?site=adventofcode.com) by entering `chrome://settings/cookies/detail?site=adventofcode.com` in your address bar. Just click on `session` and copy your key from the `Content` section.
32
+ In Chrome you can do this by opening the `Developer Tools` window (`⌥ ⌘ I` on Mac) when browsing the Advent of Code website. Within the `Application` tab, expand `Cookies` under `Storage` in the side menu and select `https://adventofcode.com`. This will then show you all of the cookies set by the website. You need to select the `session` cookie and copy the value.
31
33
 
32
34
  Now edit the new `.env` file, so that it looks like the following, replacing `ABCDE12345` with the session key you just copied:
33
35
 
@@ -35,9 +37,28 @@ Now edit the new `.env` file, so that it looks like the following, replacing `AB
35
37
 
36
38
  You're now able to run all the `aoc` commands provided by this gem.
37
39
 
38
- You'll see you have a few options when running the `aoc` command within your project.
40
+ You'll see you have a few options when running the `aoc` command within your project. Running `aoc help` will show you all of your options:
41
+
42
+ $ aoc help
43
+ Commands:
44
+ aoc exec # executes and optionally submits the puzzle for today, or the specified date
45
+ aoc help [COMMAND] # Describe available commands or one specific command
46
+ aoc output # outputs results from your solution for the given day
47
+ aoc prep # preps everything you need for a new puzzle
48
+ aoc spec # runs tests for today, or the specified date
49
+ aoc version # prints the current installed version of AocRb
50
+
51
+ If you want to see you options for a given command:
52
+
53
+ $ aoc help prep
54
+ Usage:
55
+ aoc prep
56
+
57
+ Options:
58
+ -y, [--year=N]
59
+ -d, [--day=N]
39
60
 
40
- `prep` will set everything up for a new daily puzzle. It defaults to the puzzle for today, but you can work with older puzzles by passing the year and day:
61
+ Running `aoc prep` will set everything up for a new daily puzzle. It defaults to the puzzle for today, but you can work with older puzzles by passing the year and day:
41
62
 
42
63
  $ aoc prep 2017 12
43
64
 
data/aoc_rb.gemspec CHANGED
@@ -13,7 +13,6 @@ Gem::Specification.new do |spec|
13
13
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
14
 
15
15
  spec.metadata["homepage_uri"] = spec.homepage
16
- spec.metadata["source_code_uri"] = "https://github.com/pacso/aoc_rb"
17
16
  spec.metadata["changelog_uri"] = "https://github.com/pacso/aoc_rb/blob/main/CHANGELOG"
18
17
 
19
18
  # Specify which files should be added to the gem when it is released.
data/exe/aoc CHANGED
@@ -2,3 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "aoc_rb/cli"
5
+
6
+ AocRb::Cli.start
data/lib/aoc_rb/app.rb CHANGED
@@ -27,6 +27,24 @@ Dir[src_files].each do |file|
27
27
  end
28
28
  end
29
29
 
30
+ def ensure_aoc_start_in_bin
31
+ bin_path = File.join(Dir.pwd, 'bin/aoc')
32
+
33
+ return unless File.exist?(bin_path)
34
+
35
+ unless File.read(bin_path).include?('AocRb::App.start')
36
+ puts "Adding missing `AocRb::App.start` line to `bin/aoc`..."
37
+
38
+ File.open(bin_path, 'a') do |file|
39
+ file.puts "\nAocRb::App.start\n"
40
+ end
41
+
42
+ puts "`AocRb::App.start` has been added to `bin/aoc`.\n\nPlease re-run your aoc command."
43
+ end
44
+ end
45
+
46
+ ensure_aoc_start_in_bin
47
+
30
48
  module AocRb
31
49
  class App < Thor
32
50
  def self.exit_on_failure?
@@ -142,7 +160,11 @@ module AocRb
142
160
  fetch(year, day)
143
161
  bootstrap(year, day)
144
162
  end
163
+
164
+ desc "version", "prints the current installed version of AocRb"
165
+
166
+ def version
167
+ puts "AocRb version #{AocRb::VERSION}"
168
+ end
145
169
  end
146
170
  end
147
-
148
- AocRb::App.start
data/lib/aoc_rb/cli.rb CHANGED
@@ -47,7 +47,11 @@ module AocRb
47
47
  gemfile_src = File.join(File.dirname(__FILE__), "../../templates/Gemfile")
48
48
  File.open(gemfile_dst, "w") { |f| f.write(File.read(gemfile_src))}
49
49
  end
50
+
51
+ desc "version", "prints the current installed version of AocRb"
52
+
53
+ def version
54
+ puts "AocRb version #{AocRb::VERSION}"
55
+ end
50
56
  end
51
57
  end
52
-
53
- AocRb::Cli.start
@@ -1,3 +1,3 @@
1
1
  module AocRb
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.8"
3
3
  end
data/lib/aoc_rb.rb CHANGED
@@ -1,5 +1,3 @@
1
- puts "lib/aoc_rb.rb"
2
-
3
1
  Dir[File.join(File.dirname(__FILE__), "aoc_rb", "**", "*.rb")].each { |file| require file }
4
2
 
5
3
  module AocRb
data/templates/bin/aoc CHANGED
@@ -33,3 +33,5 @@ require "bundler/setup"
33
33
  # load Gem.bin_path("aoc_rb", "aoc")
34
34
 
35
35
  require 'aoc_rb/app'
36
+
37
+ AocRb::App.start
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aoc_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Pascoe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-30 00:00:00.000000000 Z
11
+ date: 2024-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv
@@ -112,7 +112,6 @@ files:
112
112
  - CODE_OF_CONDUCT.md
113
113
  - Gemfile
114
114
  - LICENSE
115
- - LICENSE.txt
116
115
  - README.md
117
116
  - Rakefile
118
117
  - aoc_rb.gemspec
@@ -141,7 +140,6 @@ licenses:
141
140
  - MIT
142
141
  metadata:
143
142
  homepage_uri: https://github.com/pacso/aoc_rb
144
- source_code_uri: https://github.com/pacso/aoc_rb
145
143
  changelog_uri: https://github.com/pacso/aoc_rb/blob/main/CHANGELOG
146
144
  post_install_message:
147
145
  rdoc_options: []
@@ -158,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
156
  - !ruby/object:Gem::Version
159
157
  version: '0'
160
158
  requirements: []
161
- rubygems_version: 3.5.16
159
+ rubygems_version: 3.5.22
162
160
  signing_key:
163
161
  specification_version: 4
164
162
  summary: A Ruby toolkit for Advent of Code
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2020 TODO: Write your name
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.