mangadex 5.7.5 → 5.7.5.1
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/.github/workflows/publish-gem.yml +20 -0
- data/Gemfile.lock +5 -5
- data/lib/mangadex/auth.rb +1 -6
- data/lib/mangadex/internal/definition.rb +9 -3
- data/lib/mangadex/manga.rb +1 -1
- data/lib/mangadex/sorbet.rb +8 -6
- data/lib/mangadex/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 52dec750d8fbff40af52a2be9375a2b9729d8b7a3422b8f6dac5504d79be8eff
|
|
4
|
+
data.tar.gz: 277f46e56d6f84b10e3b16878d4a9196eb70323e99133bbd6294f608e3dc6137
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 81f339164b6a02619c57f9c9d25daf5c1f652b6e547f3923a7957f7a8afed622c14cc11f4368009d9a37d8c414a60e5210cc83785b4409895e045e3bf6b024a0
|
|
7
|
+
data.tar.gz: ccd3bc3cad6e3f140df1bc79a9b402508178baabb2730364aecf1270a99a20fd932d4e5e9af301e93b879b808c72db2044e4cd197c9edd562cb159f03ce901bd
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: Publish Gem
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- v*
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v1
|
|
13
|
+
|
|
14
|
+
- name: Release Gem
|
|
15
|
+
if: contains(github.ref, 'refs/tags/v')
|
|
16
|
+
uses: cadwallion/publish-rubygems-action@master
|
|
17
|
+
env:
|
|
18
|
+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
19
|
+
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
|
|
20
|
+
RELEASE_COMMAND: rake release
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
mangadex (5.
|
|
4
|
+
mangadex (5.7.5.1)
|
|
5
5
|
psych (~> 4.0.1)
|
|
6
6
|
rest-client (~> 2.1)
|
|
7
7
|
sorbet-runtime
|
|
@@ -45,10 +45,10 @@ GEM
|
|
|
45
45
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
46
46
|
rspec-support (~> 3.12.0)
|
|
47
47
|
rspec-support (3.12.0)
|
|
48
|
-
sorbet (0.5.
|
|
49
|
-
sorbet-static (= 0.5.
|
|
50
|
-
sorbet-runtime (0.5.
|
|
51
|
-
sorbet-static (0.5.
|
|
48
|
+
sorbet (0.5.10535)
|
|
49
|
+
sorbet-static (= 0.5.10535)
|
|
50
|
+
sorbet-runtime (0.5.10539)
|
|
51
|
+
sorbet-static (0.5.10535-x86_64-linux)
|
|
52
52
|
stringio (3.0.2)
|
|
53
53
|
unf (0.1.4)
|
|
54
54
|
unf_ext
|
data/lib/mangadex/auth.rb
CHANGED
|
@@ -58,12 +58,7 @@ module Mangadex
|
|
|
58
58
|
|
|
59
59
|
sig { returns(Hash) }
|
|
60
60
|
def self.check_token
|
|
61
|
-
|
|
62
|
-
Mangadex::Internal::Request.get(
|
|
63
|
-
'/auth/check',
|
|
64
|
-
raw: true,
|
|
65
|
-
)
|
|
66
|
-
)
|
|
61
|
+
Mangadex::Internal::Request.get('/auth/check')
|
|
67
62
|
end
|
|
68
63
|
|
|
69
64
|
sig { returns(T.any(T::Boolean, Mangadex::Api::Response)) }
|
|
@@ -14,7 +14,7 @@ module Mangadex
|
|
|
14
14
|
def initialize(key, value, converts: nil, accepts: nil, required: false)
|
|
15
15
|
@converts = converts
|
|
16
16
|
@key = key
|
|
17
|
-
@value = convert_value(value)
|
|
17
|
+
@value = convert_value(value.presence)
|
|
18
18
|
@raw_value = value
|
|
19
19
|
@accepts = accepts
|
|
20
20
|
@required = required ? true : false
|
|
@@ -45,6 +45,10 @@ module Mangadex
|
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
def convert_value(value)
|
|
48
|
+
if converts.is_a?(Symbol)
|
|
49
|
+
converts_proc = self.class.converts(converts)
|
|
50
|
+
return converts_proc.call(value) if converts_proc
|
|
51
|
+
end
|
|
48
52
|
if converts.is_a?(Proc)
|
|
49
53
|
converts.call(value)
|
|
50
54
|
elsif converts.is_a?(String) || converts.is_a?(Symbol)
|
|
@@ -176,7 +180,7 @@ module Mangadex
|
|
|
176
180
|
|
|
177
181
|
if validation_error
|
|
178
182
|
errors << { message: validation_error }
|
|
179
|
-
elsif !validator.empty?
|
|
183
|
+
elsif !validator.empty? && validator.value
|
|
180
184
|
args[key] = validator.value
|
|
181
185
|
end
|
|
182
186
|
end
|
|
@@ -194,7 +198,9 @@ module Mangadex
|
|
|
194
198
|
raise ArgumentError, "Validation error: #{error_message}"
|
|
195
199
|
end
|
|
196
200
|
|
|
197
|
-
args.symbolize_keys
|
|
201
|
+
args.symbolize_keys.select do |_, value|
|
|
202
|
+
value.presence
|
|
203
|
+
end
|
|
198
204
|
end
|
|
199
205
|
end
|
|
200
206
|
end
|
data/lib/mangadex/manga.rb
CHANGED
|
@@ -32,7 +32,7 @@ module Mangadex
|
|
|
32
32
|
Mangadex::Internal::Request.get(
|
|
33
33
|
'/manga',
|
|
34
34
|
Mangadex::Internal::Definition.validate(args, {
|
|
35
|
-
limit: { accepts: Integer },
|
|
35
|
+
limit: { accepts: Integer, converts: :to_i },
|
|
36
36
|
offset: { accepts: Integer },
|
|
37
37
|
title: { accepts: String },
|
|
38
38
|
author_or_artist: { accepts: String },
|
data/lib/mangadex/sorbet.rb
CHANGED
|
@@ -7,12 +7,14 @@ module T
|
|
|
7
7
|
Text = T.type_alias { T.any(String, Symbol) }
|
|
8
8
|
|
|
9
9
|
Arguments = T.type_alias do
|
|
10
|
-
T.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
T.nilable(
|
|
11
|
+
T.any(
|
|
12
|
+
Text,
|
|
13
|
+
T::Array[Text],
|
|
14
|
+
Integer,
|
|
15
|
+
T::Hash[Text, Text],
|
|
16
|
+
Mangadex::ContentRating,
|
|
17
|
+
)
|
|
16
18
|
)
|
|
17
19
|
end
|
|
18
20
|
MangaResponse = T.type_alias do
|
data/lib/mangadex/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mangadex
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.7.5
|
|
4
|
+
version: 5.7.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Akinyele Cafe-Febrissy
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-11-
|
|
11
|
+
date: 2022-11-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: psych
|
|
@@ -131,6 +131,7 @@ extra_rdoc_files: []
|
|
|
131
131
|
files:
|
|
132
132
|
- ".github/dependabot.yml"
|
|
133
133
|
- ".github/workflows/docker-image.yml"
|
|
134
|
+
- ".github/workflows/publish-gem.yml"
|
|
134
135
|
- ".github/workflows/ruby.yml"
|
|
135
136
|
- ".gitignore"
|
|
136
137
|
- ".rspec"
|
|
@@ -245,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
245
246
|
- !ruby/object:Gem::Version
|
|
246
247
|
version: '0'
|
|
247
248
|
requirements: []
|
|
248
|
-
rubygems_version: 3.
|
|
249
|
+
rubygems_version: 3.3.7
|
|
249
250
|
signing_key:
|
|
250
251
|
specification_version: 4
|
|
251
252
|
summary: Your next favourite Ruby gem for interacting with Mangadex.org
|