mangadex 5.7.5.1 → 5.7.5.3

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: 52dec750d8fbff40af52a2be9375a2b9729d8b7a3422b8f6dac5504d79be8eff
4
- data.tar.gz: 277f46e56d6f84b10e3b16878d4a9196eb70323e99133bbd6294f608e3dc6137
3
+ metadata.gz: 2f7a656b6ffe031b39b55d7667f95dd4ebd3ce7ab2553c67cb3eae0f8ff650a9
4
+ data.tar.gz: 20dc4ed1f691faa7d0574b784921dd5e14e70ce23511d9d7cb4b3065a7a5c009
5
5
  SHA512:
6
- metadata.gz: 81f339164b6a02619c57f9c9d25daf5c1f652b6e547f3923a7957f7a8afed622c14cc11f4368009d9a37d8c414a60e5210cc83785b4409895e045e3bf6b024a0
7
- data.tar.gz: ccd3bc3cad6e3f140df1bc79a9b402508178baabb2730364aecf1270a99a20fd932d4e5e9af301e93b879b808c72db2044e4cd197c9edd562cb159f03ce901bd
6
+ metadata.gz: c54571ff121ccd42d0678af124c50a74c1b0643cfd801d5d8fe62361ef5e7631ef0f0788f4fa376d2410477114f850b8fb57f94757cdcb2b0654b8c3cd3e25d8
7
+ data.tar.gz: 4e374d252d9afedcc1c2692667030ba88a79fa09fa49c2a89c2bd468e0f307ca909bee7f3864d059a98166f353aef0fa95bbcdf2e8d8c2a8dc1e2bc45cafeac3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mangadex (5.7.5.1)
4
+ mangadex (5.7.5.2)
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.10535)
49
- sorbet-static (= 0.5.10535)
48
+ sorbet (0.5.10539)
49
+ sorbet-static (= 0.5.10539)
50
50
  sorbet-runtime (0.5.10539)
51
- sorbet-static (0.5.10535-x86_64-linux)
51
+ sorbet-static (0.5.10539-x86_64-linux)
52
52
  stringio (3.0.2)
53
53
  unf (0.1.4)
54
54
  unf_ext
@@ -35,12 +35,12 @@ module Mangadex
35
35
  Mangadex::Internal::Request.get(
36
36
  '/author',
37
37
  Mangadex::Internal::Definition.validate(args, {
38
- limit: { accepts: Integer },
39
- offset: { accepts: Integer },
40
- ids: { accepts: [String] },
38
+ limit: { accepts: Integer, converts: :to_i },
39
+ offset: { accepts: Integer, converts: :to_i },
40
+ ids: { accepts: [String], converts: :to_a },
41
41
  name: { accepts: String },
42
42
  order: { accepts: Hash },
43
- includes: { accepts: [String] },
43
+ includes: { accepts: [String], converts: :to_a },
44
44
  })
45
45
  )
46
46
  end
@@ -73,7 +73,7 @@ module Mangadex
73
73
  Mangadex::Internal::Request.get(
74
74
  format('/author/%{id}', id: id),
75
75
  Mangadex::Internal::Definition.validate(args, {
76
- includes: { accepts: [String] },
76
+ includes: { accepts: [String], converts: :to_a },
77
77
  })
78
78
  )
79
79
  end
@@ -36,7 +36,7 @@ module Mangadex
36
36
  Mangadex::Internal::Request.get(
37
37
  '/chapter/%{id}' % {id: id},
38
38
  Mangadex::Internal::Definition.validate(args, {
39
- includes: { accepts: [String] },
39
+ includes: { accepts: [String], converts: :to_a },
40
40
  }),
41
41
  )
42
42
  end
@@ -52,7 +52,7 @@ module Mangadex
52
52
  volume: { accepts: String },
53
53
  chapter: { accepts: String },
54
54
  translated_language: { accepts: %r{^[a-zA-Z\-]{2,5}$} },
55
- groups: { accepts: [String] },
55
+ groups: { accepts: [String], converts: :to_a },
56
56
  version: { accepts: Integer, required: true },
57
57
  }),
58
58
  )
@@ -25,12 +25,10 @@ module Mangadex
25
25
 
26
26
  sig { sig(args: T::Api::Arguments).returns(T::Api::GenericResponse) }
27
27
  def self.list(**args)
28
- to_a = Mangadex::Internal::Definition.converts(:to_a)
29
-
30
28
  Mangadex::Internal::Request.get(
31
29
  '/manga/list',
32
30
  Mangadex::Internal::Definition.validate(args, {
33
- ids: { accepts: [String], converts: to_a, required: true },
31
+ ids: { accepts: [String], converts: :to_a, required: true },
34
32
  grouped: { accepts: [true, false] },
35
33
  })
36
34
  )
@@ -17,13 +17,13 @@ module Mangadex
17
17
  Mangadex::Internal::Request.get(
18
18
  '/cover',
19
19
  Mangadex::Internal::Definition.validate(args, {
20
- limit: { accepts: Integer },
21
- offset: { accepts: Integer },
22
- manga: { accepts: [String] },
23
- ids: { accepts: [String] },
24
- uploaders: { accepts: [String] },
20
+ limit: { accepts: Integer, converts: :to_i },
21
+ offset: { accepts: Integer, converts: :to_i },
22
+ manga: { accepts: [String], converts: :to_a },
23
+ ids: { accepts: [String], converts: :to_a },
24
+ uploaders: { accepts: [String], converts: :to_a },
25
25
  order: { accepts: Hash },
26
- includes: { accepts: [String] },
26
+ includes: { accepts: [String], converts: :to_a },
27
27
  })
28
28
  )
29
29
  end
@@ -53,7 +53,7 @@ module Mangadex
53
53
  Mangadex::Internal::Request.get(
54
54
  '/cover/%{id}' % {id: id},
55
55
  Mangadex::Internal::Definition.validate(args, {
56
- includes: { accepts: [String] },
56
+ includes: { accepts: [String], converts: :to_a },
57
57
  })
58
58
  )
59
59
  end
@@ -99,8 +99,8 @@ module Mangadex
99
99
  Mangadex::Internal::Request.get(
100
100
  '/user/list',
101
101
  Mangadex::Internal::Definition.validate(args, {
102
- limit: { accepts: Integer },
103
- offset: { accepts: Integer },
102
+ limit: { accepts: Integer, converts: :to_i },
103
+ offset: { accepts: Integer, converts: :to_i },
104
104
  }),
105
105
  )
106
106
  end
@@ -112,8 +112,8 @@ module Mangadex
112
112
  Mangadex::Internal::Request.get(
113
113
  '/user/%{id}/list' % {id: user_id},
114
114
  Mangadex::Internal::Definition.validate(args, {
115
- limit: { accepts: Integer },
116
- offset: { accepts: Integer },
115
+ limit: { accepts: Integer, converts: :to_i },
116
+ offset: { accepts: Integer, converts: :to_i },
117
117
  }),
118
118
  )
119
119
  end
@@ -47,7 +47,13 @@ module Mangadex
47
47
  def convert_value(value)
48
48
  if converts.is_a?(Symbol)
49
49
  converts_proc = self.class.converts(converts)
50
- return converts_proc.call(value) if converts_proc
50
+ if converts_proc
51
+ begin
52
+ return converts_proc.call(value)
53
+ rescue => exception
54
+ raise ArgumentError.new("Proc parsing error: #{exception}")
55
+ end
56
+ end
51
57
  end
52
58
  if converts.is_a?(Proc)
53
59
  converts.call(value)
@@ -117,24 +123,24 @@ module Mangadex
117
123
  validate(
118
124
  args,
119
125
  {
120
- limit: { accepts: Integer },
121
- offset: { accepts: Integer },
122
- ids: { accepts: [String] },
126
+ limit: { accepts: Integer, converts: :to_i },
127
+ offset: { accepts: Integer, converts: :to_i },
128
+ ids: { accepts: [String], converts: :to_a },
123
129
  title: { accepts: String },
124
130
  manga: { accepts: String },
125
- groups: { accepts: [String] },
126
- uploader: { accepts: [String], converts: converts(:to_a) },
127
- chapter: { accepts: [String], converts: converts(:to_a) },
128
- translated_language: { accepts: [String], converts: converts(:to_a) },
129
- original_language: { accepts: [String] },
130
- excluded_original_language: { accepts: [String] },
131
+ groups: { accepts: [String], converts: :to_a },
132
+ uploader: { accepts: [String], converts: :to_a },
133
+ chapter: { accepts: [String], converts: :to_a },
134
+ translated_language: { accepts: [String], converts: :to_a },
135
+ original_language: { accepts: [String], converts: :to_a },
136
+ excluded_original_language: { accepts: [String], converts: :to_a },
131
137
  content_rating: Definitions::ContentRating,
132
138
  include_future_updates: { accepts: %w(0 1) },
133
139
  created_at_since: { accepts: %r{^\d{4}-[0-1]\d-([0-2]\d|3[0-1])T([0-1]\d|2[0-3]):[0-5]\d:[0-5]\d$} },
134
140
  updated_at_since: { accepts: %r{^\d{4}-[0-1]\d-([0-2]\d|3[0-1])T([0-1]\d|2[0-3]):[0-5]\d:[0-5]\d$} },
135
141
  publish_at_since: { accepts: %r{^\d{4}-[0-1]\d-([0-2]\d|3[0-1])T([0-1]\d|2[0-3]):[0-5]\d:[0-5]\d$} },
136
142
  order: { accepts: Hash },
137
- includes: { accepts: [String], converts: converts(:to_a) },
143
+ includes: { accepts: [String], converts: :to_a },
138
144
  include_empty_pages: { accepts: [0, 1], converts: converts(:to_i) },
139
145
  include_future_publish_at: { accepts: [0, 1], converts: converts(:to_i) },
140
146
  include_external_url: { accepts: [0, 1], converts: converts(:to_i) },
@@ -27,33 +27,31 @@ module Mangadex
27
27
 
28
28
  sig { params(args: T::Api::Arguments).returns(T::Api::MangaResponse) }
29
29
  def self.list(**args)
30
- to_a = Mangadex::Internal::Definition.converts(:to_a)
31
-
32
30
  Mangadex::Internal::Request.get(
33
31
  '/manga',
34
32
  Mangadex::Internal::Definition.validate(args, {
35
33
  limit: { accepts: Integer, converts: :to_i },
36
- offset: { accepts: Integer },
34
+ offset: { accepts: Integer, converts: :to_i },
37
35
  title: { accepts: String },
38
36
  author_or_artist: { accepts: String },
39
- authors: { accepts: [String] },
40
- artists: { accepts: [String] },
37
+ authors: { accepts: [String], converts: :to_a },
38
+ artists: { accepts: [String], converts: :to_a },
41
39
  year: { accepts: Integer },
42
- included_tags: { accepts: [String] },
40
+ included_tags: { accepts: [String], converts: :to_a },
43
41
  included_tags_mode: { accepts: %w(OR AND) },
44
- excluded_tags: { accepts: [String] },
42
+ excluded_tags: { accepts: [String], converts: :to_a },
45
43
  excluded_tags_mode: { accepts: %w(OR AND) },
46
- status: { accepts: %w(ongoing completed hiatus cancelled), converts: to_a },
47
- original_language: { accepts: [String] },
48
- excluded_original_language: { accepts: [String] },
49
- available_translated_language: { accepts: [String] },
50
- publication_demographic: { accepts: %w(shounen shoujo josei seinen none), converts: to_a },
44
+ status: { accepts: %w(ongoing completed hiatus cancelled), converts: :to_a },
45
+ original_language: { accepts: [String], converts: :to_a },
46
+ excluded_original_language: { accepts: [String], converts: :to_a },
47
+ available_translated_language: { accepts: [String], converts: :to_a },
48
+ publication_demographic: { accepts: %w(shounen shoujo josei seinen none), converts: :to_a },
51
49
  ids: { accepts: Array },
52
- content_rating: { accepts: %w(safe suggestive erotica pornographic), converts: to_a },
50
+ content_rating: { accepts: %w(safe suggestive erotica pornographic), converts: :to_a },
53
51
  created_at_since: { accepts: %r{^\d{4}-[0-1]\d-([0-2]\d|3[0-1])T([0-1]\d|2[0-3]):[0-5]\d:[0-5]\d$} },
54
52
  updated_at_since: { accepts: %r{^\d{4}-[0-1]\d-([0-2]\d|3[0-1])T([0-1]\d|2[0-3]):[0-5]\d:[0-5]\d$} },
55
53
  order: { accepts: Hash },
56
- includes: { accepts: Array, converts: to_a },
54
+ includes: { accepts: Array, converts: :to_a },
57
55
  has_available_chapters: { accepts: ['0', '1', 'true', 'false'] },
58
56
  group: { accepts: String },
59
57
  }),
@@ -74,13 +72,12 @@ module Mangadex
74
72
 
75
73
  sig { params(id: String, args: T::Api::Arguments).returns(T::Api::MangaResponse) }
76
74
  def self.view(id, **args)
77
- to_a = Mangadex::Internal::Definition.converts(:to_a)
78
75
  Mangadex::Internal::Definition.must(id)
79
76
 
80
77
  Mangadex::Internal::Request.get(
81
78
  '/manga/%{id}' % {id: id},
82
79
  Mangadex::Internal::Definition.validate(args, {
83
- includes: { accepts: Array, converts: to_a },
80
+ includes: { accepts: Array, converts: :to_a },
84
81
  })
85
82
  )
86
83
  end
@@ -116,16 +113,14 @@ module Mangadex
116
113
 
117
114
  sig { params(args: T::Api::Arguments).returns(T::Api::MangaResponse) }
118
115
  def self.random(**args)
119
- to_a = Mangadex::Internal::Definition.converts(:to_a)
120
-
121
116
  Mangadex::Internal::Request.get(
122
117
  '/manga/random',
123
118
  Mangadex::Internal::Definition.validate(args, {
124
119
  includes: { accepts: Array },
125
- content_rating: { accepts: %w(safe suggestive erotica pornographic), converts: to_a },
126
- included_tags: { accepts: [String] },
120
+ content_rating: { accepts: %w(safe suggestive erotica pornographic), converts: :to_a },
121
+ included_tags: { accepts: [String], converts: :to_a },
127
122
  included_tags_mode: { accepts: %w(OR AND) },
128
- excluded_tags: { accepts: [String] },
123
+ excluded_tags: { accepts: [String], converts: :to_a },
129
124
  excluded_tags_mode: { accepts: %w(OR AND) },
130
125
  })
131
126
  )
@@ -8,19 +8,17 @@ module Mangadex
8
8
 
9
9
  sig { params(args: T::Api::Arguments).returns(Mangadex::Api::Response[Report]) }
10
10
  def self.list(**args)
11
- to_a = Mangadex::Internal::Definition.converts(:to_a)
12
-
13
11
  Mangadex::Internal::Request.get(
14
12
  '/report',
15
13
  Mangadex::Internal::Definition.validate(args, {
16
- limit: { accepts: Integer },
17
- offset: { accepts: Integer },
14
+ limit: { accepts: Integer, converts: :to_i },
15
+ offset: { accepts: Integer, converts: :to_i },
18
16
  category: { accepts: %w(manga chapter scanlation_group user author) },
19
17
  reason_id: { accepts: String },
20
18
  object_id: { accepts: String },
21
19
  status: { accepts: %w(waiting accepted refused autoresolved) },
22
20
  order: { accepts: Hash },
23
- includes: { accepts: Array, converts: to_a },
21
+ includes: { accepts: Array, converts: :to_a },
24
22
  }),
25
23
  auth: true,
26
24
  )
@@ -27,11 +27,11 @@ module Mangadex
27
27
  Mangadex::Internal::Request.get(
28
28
  '/group',
29
29
  Mangadex::Internal::Definition.validate(args, {
30
- limit: { accepts: Integer },
31
- offset: { accepts: Integer },
32
- ids: { accepts: [String] },
30
+ limit: { accepts: Integer, converts: :to_i },
31
+ offset: { accepts: Integer, converts: :to_i },
32
+ ids: { accepts: [String], converts: :to_a },
33
33
  name: { accepts: String },
34
- includes: { accepts: [String] },
34
+ includes: { accepts: [String], converts: :to_a },
35
35
  }),
36
36
  )
37
37
  end
@@ -57,7 +57,7 @@ module Mangadex
57
57
  Mangadex::Internal::Request.get(
58
58
  '/group/%{id}' % {id: id},
59
59
  Mangadex::Internal::Definition.validate(args, {
60
- includes: { accepts: [String] },
60
+ includes: { accepts: [String], converts: :to_a },
61
61
  }),
62
62
  )
63
63
  end
@@ -20,12 +20,10 @@ module Mangadex
20
20
 
21
21
  sig { params(args: T::Api::Arguments).returns(T::Api::GenericResponse) }
22
22
  def self.list(**args)
23
- to_a = Mangadex::Internal::Definition.converts(:to_a)
24
-
25
23
  Mangadex::Internal::Request.get(
26
24
  '/statistics/manga',
27
25
  Mangadex::Internal::Definition.validate(args, {
28
- manga: { accepts: [String], converts: to_a },
26
+ manga: { accepts: [String], converts: :to_a },
29
27
  })
30
28
  )
31
29
  end
@@ -54,7 +54,7 @@ module Mangadex
54
54
  '/upload/%{upload_session_id}/commit' % {upload_session_id: upload_session_id},
55
55
  payload: Mangadex::Internal::Definition.validate(args, {
56
56
  chapter_draft: { accepts: Hash }, # todo enforce chapter_draft content?
57
- page_order: { accepts: [String] },
57
+ page_order: { accepts: [String], converts: :to_a },
58
58
  }),
59
59
  )
60
60
  end
data/lib/mangadex/user.rb CHANGED
@@ -11,8 +11,8 @@ module Mangadex
11
11
  Mangadex::Internal::Request.get(
12
12
  '/user',
13
13
  Mangadex::Internal::Definition.validate(args, {
14
- limit: { accepts: Integer },
15
- offset: { accepts: Integer },
14
+ limit: { accepts: Integer, converts: :to_i },
15
+ offset: { accepts: Integer, converts: :to_i },
16
16
  ids: { accepts: Array },
17
17
  username: { accepts: String },
18
18
  order: { accepts: Hash },
@@ -89,8 +89,8 @@ module Mangadex
89
89
  Mangadex::Internal::Request.get(
90
90
  '/user/follows/group',
91
91
  Mangadex::Internal::Definition.validate(args, {
92
- limit: { accepts: Integer },
93
- offset: { accepts: Integer },
92
+ limit: { accepts: Integer, converts: :to_i },
93
+ offset: { accepts: Integer, converts: :to_i },
94
94
  includes: { accepts: Array },
95
95
  }),
96
96
  auth: true,
@@ -117,8 +117,8 @@ module Mangadex
117
117
  Mangadex::Internal::Request.get(
118
118
  '/user/follows/user',
119
119
  Mangadex::Internal::Definition.validate(args, {
120
- limit: { accepts: Integer },
121
- offset: { accepts: Integer },
120
+ limit: { accepts: Integer, converts: :to_i },
121
+ offset: { accepts: Integer, converts: :to_i },
122
122
  }),
123
123
  auth: true,
124
124
  )
@@ -4,7 +4,7 @@ module Mangadex
4
4
  MAJOR = "5"
5
5
  MINOR = "7"
6
6
  TINY = "5"
7
- PATCH = "1"
7
+ PATCH = "3"
8
8
 
9
9
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
10
10
  FULL = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
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.1
4
+ version: 5.7.5.3
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-05 00:00:00.000000000 Z
11
+ date: 2022-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: psych
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
246
  - !ruby/object:Gem::Version
247
247
  version: '0'
248
248
  requirements: []
249
- rubygems_version: 3.3.7
249
+ rubygems_version: 3.2.15
250
250
  signing_key:
251
251
  specification_version: 4
252
252
  summary: Your next favourite Ruby gem for interacting with Mangadex.org