aoc_cli 0.1.1 → 0.1.3
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +7 -4
- data/aoc_cli.gemspec +1 -1
- data/lib/aoc_cli/tools.rb +10 -5
- data/lib/aoc_cli/version.rb +1 -1
- data/pkg/aoc_cli-0.1.2.gem +0 -0
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 24c94cfdcb4cde6a75876adf800bd44f835807df5bfab2ea0039e122fe6cc385
|
|
4
|
+
data.tar.gz: b0b7e88af483fb95d1f497a984befeaf753e498ff7a2be4dc382859d7a67648f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bd6c31e93df159af99140002bd6d49ef15cd56eb194f3df9b79355180310586e831420203960988ea4376bb9779dbf5f2599f77e9ce1cc82ecc309d514fcf160
|
|
7
|
+
data.tar.gz: 93ccea0cfb58bce12f45676defa5294a85b1abea90cd24a41afa9ad1a8b20491d11d4765b0328c2bfed534ac7ef052c503e6d51b7837e8a2061d39cd5644a9fa
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
|
@@ -17,10 +17,13 @@ A command-line interface to interact with Advent of Code puzzles, built in Ruby.
|
|
|
17
17
|
|
|
18
18
|
## Installation
|
|
19
19
|
|
|
20
|
+
- aoc-cli uses Pandoc, make sure it is [installed](https://pandoc.org/installing.html)
|
|
21
|
+
- Homebrew users can run `brew install pandoc`
|
|
22
|
+
|
|
20
23
|
Install gem
|
|
21
24
|
|
|
22
25
|
```bash
|
|
23
|
-
$ gem install aoc_cli
|
|
26
|
+
$ gem install aoc_cli
|
|
24
27
|
```
|
|
25
28
|
|
|
26
29
|
Manual install
|
|
@@ -54,7 +57,7 @@ This is unique to your account, and allows aoc-cli to interact with the AoC serv
|
|
|
54
57
|
- Run the following command
|
|
55
58
|
|
|
56
59
|
```bash
|
|
57
|
-
aoc -k
|
|
60
|
+
aoc -k $your_key
|
|
58
61
|
|
|
59
62
|
```
|
|
60
63
|
|
|
@@ -135,7 +138,7 @@ aoc -y 2020 -u $alias
|
|
|
135
138
|
|
|
136
139
|
This command will create necessary metafiles, download the year calendar and fill it with your current progress (if any). This is stored in a markdown file in the year directory.
|
|
137
140
|
|
|
138
|
-
By default, your stats in the leaderboard are also added to this file.
|
|
141
|
+
By default, your stats in the leaderboard are also added to this file.
|
|
139
142
|
|
|
140
143
|
|
|
141
144
|
## Initialising a Day
|
|
@@ -225,7 +228,7 @@ To view the stats for the year as a whole run the same command from the year dir
|
|
|
225
228
|
|
|
226
229
|
You can run the command `aoc -R` from the day subdirectory, or by manual flags to open the solution megathread for the specified day in Reddit
|
|
227
230
|
|
|
228
|
-
If one is installed, aoc-cli will default to opening the thread within a reddit-
|
|
231
|
+
If one is installed, aoc-cli will default to opening the thread within a reddit-cli such as RTV or TTRV. If one isn't found however, the thread will be opened within your default browser.
|
|
229
232
|
|
|
230
233
|
To always open megathread in your browser run
|
|
231
234
|
|
data/aoc_cli.gemspec
CHANGED
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
|
12
12
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
|
13
13
|
spec.metadata["homepage_uri"] = spec.homepage
|
|
14
14
|
spec.metadata["source_code_uri"] = "https://github.com/apexatoll/aoc-cli"
|
|
15
|
-
spec.metadata["changelog_uri"] = "https://github.com/apexatoll/aoc-cli/
|
|
15
|
+
spec.metadata["changelog_uri"] = "https://github.com/apexatoll/aoc-cli/CHANGELOG.md"
|
|
16
16
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
17
17
|
`git ls-files -z`
|
|
18
18
|
.split("\x0")
|
data/lib/aoc_cli/tools.rb
CHANGED
|
@@ -2,7 +2,7 @@ module AocCli
|
|
|
2
2
|
module Tools
|
|
3
3
|
class Request
|
|
4
4
|
require 'curb'
|
|
5
|
-
attr_reader :user, :year, :day, :base, :page
|
|
5
|
+
attr_reader :user, :year, :day, :base, :page, :ua
|
|
6
6
|
def initialize(u:Metafile.get(:user),
|
|
7
7
|
y:Metafile.get(:year),
|
|
8
8
|
d:Metafile.get(:day), p:)
|
|
@@ -11,15 +11,20 @@ module AocCli
|
|
|
11
11
|
@day = d
|
|
12
12
|
@page = p
|
|
13
13
|
@base = "https://adventofcode.com/#{year}"
|
|
14
|
+
@ua = "github.com/apexatoll/aoc-cli"
|
|
14
15
|
end
|
|
15
16
|
protected
|
|
16
17
|
def get
|
|
17
|
-
Curl.get(url)
|
|
18
|
-
.
|
|
18
|
+
Curl.get(url) do |h|
|
|
19
|
+
h.headers['Cookie'] = cookie
|
|
20
|
+
h.headers['User-Agent'] = ua
|
|
21
|
+
end.body
|
|
19
22
|
end
|
|
20
23
|
def post(data:)
|
|
21
|
-
Curl.post(url, data)
|
|
22
|
-
|
|
24
|
+
Curl.post(url, data) do |h|
|
|
25
|
+
h.headers['Cookie'] = cookie
|
|
26
|
+
h.headers['User-Agent'] = ua
|
|
27
|
+
end.body
|
|
23
28
|
end
|
|
24
29
|
private
|
|
25
30
|
def cookie
|
data/lib/aoc_cli/version.rb
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aoc_cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christian Welham
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-02-
|
|
11
|
+
date: 2021-02-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: colorize
|
|
@@ -105,6 +105,7 @@ extensions: []
|
|
|
105
105
|
extra_rdoc_files: []
|
|
106
106
|
files:
|
|
107
107
|
- ".gitignore"
|
|
108
|
+
- CHANGELOG.md
|
|
108
109
|
- Gemfile
|
|
109
110
|
- LICENSE.txt
|
|
110
111
|
- README.md
|
|
@@ -128,13 +129,14 @@ files:
|
|
|
128
129
|
- lib/aoc_cli/tools.rb
|
|
129
130
|
- lib/aoc_cli/version.rb
|
|
130
131
|
- lib/aoc_cli/year.rb
|
|
132
|
+
- pkg/aoc_cli-0.1.2.gem
|
|
131
133
|
homepage: https://github.com/apexatoll/aoc-cli
|
|
132
134
|
licenses:
|
|
133
135
|
- MIT
|
|
134
136
|
metadata:
|
|
135
137
|
homepage_uri: https://github.com/apexatoll/aoc-cli
|
|
136
138
|
source_code_uri: https://github.com/apexatoll/aoc-cli
|
|
137
|
-
changelog_uri: https://github.com/apexatoll/aoc-cli/
|
|
139
|
+
changelog_uri: https://github.com/apexatoll/aoc-cli/CHANGELOG.md
|
|
138
140
|
post_install_message:
|
|
139
141
|
rdoc_options: []
|
|
140
142
|
require_paths:
|