aoc_cli 1.0.1 → 1.1.0

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: ddf7e8e1d35efd516bae0a1a9b4d773a0ff59120f3ae287491668fa81740ffba
4
- data.tar.gz: 7fc18fbfcf0391b6d9b6ed43b6e6f35b372f368c9ffd8f5f23c2f3a305c470d2
3
+ metadata.gz: 57f414599f4b11e27042a5f0dee78a3b2ce1ce06db87c8d44395a5255985eca3
4
+ data.tar.gz: 611148ea923cb2f1d7f40960378105049356921b611526b0a207cd60aac7f795
5
5
  SHA512:
6
- metadata.gz: 41cb419b34d2d7a385e3c227e11b4f548f834d1f6d14566d11baff340367ff95ed7e87cdf512ae45aa3dc4339b65e9549ff2182960e33d0b26af06a6e36e1f24
7
- data.tar.gz: e32591f10e88ff7aa402ebe0523328af2bc61a8458028ff3c559477ec81aa3ee34944b8cf63156ae8625e9000e4a9716d910c02a59a4010679c524dcf387652b
6
+ metadata.gz: 1b039be74fb46e7af10111d484b1dec004aebf6048fb2aa55aab803f7d12e4e4712d20460353ccce8532959dc21504fce9975d36a1a14caa0fef848fdbdbfc28
7
+ data.tar.gz: 0bd7798cd92b798b6318427b8d51ef4bbc308a9b9c4f86c885a2a9af1e133b63ee3ee4bb33afc0a63a4ee81b6e635cda37e6bbde30e78c2a949439bec860edbd
data/Gemfile CHANGED
@@ -7,6 +7,7 @@ gem "rake", "~> 13.0"
7
7
  gem "rspec", "~> 3.0"
8
8
  gem "rubocop", "~> 1.21"
9
9
  gem "rubocop-rspec"
10
+ gem "simplecov"
10
11
  gem "steep"
11
12
  gem "vcr"
12
13
  gem "webmock"
data/Gemfile.lock CHANGED
@@ -23,8 +23,8 @@ GEM
23
23
  minitest (>= 5.1)
24
24
  mutex_m
25
25
  tzinfo (~> 2.0)
26
- addressable (2.8.5)
27
- public_suffix (>= 2.0.2, < 6.0)
26
+ addressable (2.8.8)
27
+ public_suffix (>= 2.0.2, < 8.0)
28
28
  ast (2.4.2)
29
29
  base64 (0.2.0)
30
30
  bigdecimal (3.1.5)
@@ -36,25 +36,27 @@ GEM
36
36
  rexml
37
37
  csv (3.2.8)
38
38
  diff-lcs (1.5.0)
39
- domain_name (0.6.20231109)
39
+ docile (1.4.0)
40
+ domain_name (0.6.20240107)
40
41
  drb (2.2.0)
41
42
  ruby2_keywords
42
43
  erb (4.0.3)
43
44
  cgi (>= 0.3.3)
44
45
  factory_bot (6.4.2)
45
46
  activesupport (>= 5.0.0)
46
- ffi (1.16.3)
47
- ffi-compiler (1.0.1)
48
- ffi (>= 1.0.0)
47
+ ffi (1.17.2-arm64-darwin)
48
+ ffi (1.17.2-x86_64-linux-gnu)
49
+ ffi-compiler (1.3.2)
50
+ ffi (>= 1.15.5)
49
51
  rake
50
52
  fileutils (1.7.2)
51
53
  hashdiff (1.0.1)
52
- http (5.1.1)
54
+ http (5.3.1)
53
55
  addressable (~> 2.8)
54
56
  http-cookie (~> 1.0)
55
57
  http-form_data (~> 2.2)
56
- llhttp-ffi (~> 0.4.0)
57
- http-cookie (1.0.5)
58
+ llhttp-ffi (~> 0.5.0)
59
+ http-cookie (1.1.0)
58
60
  domain_name (~> 0.5)
59
61
  http-form_data (2.3.0)
60
62
  i18n (1.14.1)
@@ -70,7 +72,7 @@ GEM
70
72
  listen (3.8.0)
71
73
  rb-fsevent (~> 0.10, >= 0.10.3)
72
74
  rb-inotify (~> 0.9, >= 0.9.10)
73
- llhttp-ffi (0.4.0)
75
+ llhttp-ffi (0.5.1)
74
76
  ffi-compiler (~> 1.0)
75
77
  rake (~> 13.0)
76
78
  logger (1.6.0)
@@ -84,10 +86,10 @@ GEM
84
86
  parser (3.2.2.4)
85
87
  ast (~> 2.4.1)
86
88
  racc
87
- public_suffix (5.0.4)
89
+ public_suffix (7.0.0)
88
90
  racc (1.7.3)
89
91
  rainbow (3.1.1)
90
- rake (13.1.0)
92
+ rake (13.3.1)
91
93
  rb-fsevent (0.11.2)
92
94
  rb-inotify (0.10.1)
93
95
  ffi (~> 1.0)
@@ -138,6 +140,12 @@ GEM
138
140
  bigdecimal
139
141
  sequel_polymorphic (0.5.0)
140
142
  sequel (>= 4.0.0, < 6)
143
+ simplecov (0.22.0)
144
+ docile (~> 1.1)
145
+ simplecov-html (~> 0.11)
146
+ simplecov_json_formatter (~> 0.1)
147
+ simplecov-html (0.12.3)
148
+ simplecov_json_formatter (0.1.4)
141
149
  sqlite3 (1.6.9-arm64-darwin)
142
150
  sqlite3 (1.6.9-x86_64-linux)
143
151
  steep (1.6.0)
@@ -170,6 +178,8 @@ GEM
170
178
 
171
179
  PLATFORMS
172
180
  arm64-darwin-21
181
+ arm64-darwin-23
182
+ arm64-darwin-24
173
183
  x86_64-linux
174
184
 
175
185
  DEPENDENCIES
@@ -179,6 +189,7 @@ DEPENDENCIES
179
189
  rspec (~> 3.0)
180
190
  rubocop (~> 1.21)
181
191
  rubocop-rspec
192
+ simplecov
182
193
  steep
183
194
  vcr
184
195
  webmock
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # `aoc-cli`
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/aoc_cli.svg)](https://badge.fury.io/rb/aoc_cli) ![aoc-ci](https://github.com/apexatoll/aoc-cli/actions/workflows/main.yml/badge.svg) [![codecov](https://codecov.io/gh/apexatoll/aoc-cli/graph/badge.svg?token=7R3GFUAXI5)](https://codecov.io/gh/apexatoll/aoc-cli)
4
+
3
5
  A command-line interface for Advent of Code, built in Ruby.
4
6
 
5
7
  > [!IMPORTANT]
@@ -1,14 +1,11 @@
1
1
  module AocCli
2
2
  module Core
3
3
  class Request
4
- extend Forwardable
5
-
6
- attr_reader :client
7
-
8
- def_delegators :client, :get, :post
4
+ attr_reader :client, :ssl_context
9
5
 
10
6
  def initialize(token:)
11
7
  @client = setup_client!(token)
8
+ @ssl_context = setup_ssl_context!
12
9
  end
13
10
 
14
11
  def self.build
@@ -19,6 +16,14 @@ module AocCli
19
16
  new(token:)
20
17
  end
21
18
 
19
+ def get(url)
20
+ client.get(url, **default_options)
21
+ end
22
+
23
+ def post(url, **options)
24
+ client.post(url, **default_options.merge(options))
25
+ end
26
+
22
27
  class << self
23
28
  extend Forwardable
24
29
 
@@ -32,6 +37,17 @@ module AocCli
32
37
 
33
38
  HTTP.headers(Cookie: cookie)
34
39
  end
40
+
41
+ def setup_ssl_context!
42
+ OpenSSL::SSL::SSLContext.new do |context|
43
+ context.cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths)
44
+ context.cert_store.flags = 0
45
+ end
46
+ end
47
+
48
+ def default_options
49
+ { ssl_context: }
50
+ end
35
51
  end
36
52
  end
37
53
  end
@@ -1,3 +1,3 @@
1
1
  module AocCli
2
- VERSION = "1.0.1".freeze
2
+ VERSION = "1.1.0".freeze
3
3
  end
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: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Welham
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-22 00:00:00.000000000 Z
11
+ date: 2025-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http