minato-utils 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/Gemfile.lock +15 -16
- data/lib/minato/utils/response.rb +15 -0
- data/lib/minato/utils/response_handler.rb +1 -4
- data/lib/minato/utils/version.rb +1 -1
- data/lib/minato/utils.rb +1 -0
- data/minato-ruby-utils.gemspec +2 -2
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8a8780ff0c7c10c83e68eeb49c4196c3eeb1aa7c257b09aac2d07bf92a6aa38
|
4
|
+
data.tar.gz: 351586a3040d8a0b23f3cf4c0b7660325ce69bf45d7decba22c3ee98cc6e9afa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 815edaaf1d439b7b3c42baabc00374544c12fcdf14ce8b6e0b2e11426525d061635aca8b2536fd815a77efe70802947d177c20686e8bc91f7486a553a1b1048c
|
7
|
+
data.tar.gz: 7d24d96cf10fbea8ccf237acb44232993dfcc7224ee8bcff07ec4f5431869562e04ce0a03f54874dde20fcc36f86738a6a5817875056795b3170c7d51083eff3
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,30 +1,29 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
minato-utils (0.
|
5
|
-
activesupport (~>
|
4
|
+
minato-utils (0.4.0)
|
5
|
+
activesupport (~> 7.0.4)
|
6
6
|
httparty (~> 0.18)
|
7
7
|
simple_command (~> 0.1.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activemodel (
|
13
|
-
activesupport (=
|
14
|
-
activerecord (
|
15
|
-
activemodel (=
|
16
|
-
activesupport (=
|
17
|
-
activesupport (
|
12
|
+
activemodel (7.0.4)
|
13
|
+
activesupport (= 7.0.4)
|
14
|
+
activerecord (7.0.4)
|
15
|
+
activemodel (= 7.0.4)
|
16
|
+
activesupport (= 7.0.4)
|
17
|
+
activesupport (7.0.4)
|
18
18
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
19
19
|
i18n (>= 1.6, < 2)
|
20
20
|
minitest (>= 5.1)
|
21
21
|
tzinfo (~> 2.0)
|
22
|
-
zeitwerk (~> 2.3)
|
23
22
|
addressable (2.8.0)
|
24
23
|
public_suffix (>= 2.0.2, < 5.0)
|
25
24
|
ast (2.4.2)
|
26
25
|
coderay (1.1.3)
|
27
|
-
concurrent-ruby (1.1.
|
26
|
+
concurrent-ruby (1.1.10)
|
28
27
|
crack (0.4.5)
|
29
28
|
rexml
|
30
29
|
database_cleaner-active_record (2.0.1)
|
@@ -36,14 +35,14 @@ GEM
|
|
36
35
|
httparty (0.20.0)
|
37
36
|
mime-types (~> 3.0)
|
38
37
|
multi_xml (>= 0.5.2)
|
39
|
-
i18n (1.
|
38
|
+
i18n (1.12.0)
|
40
39
|
concurrent-ruby (~> 1.0)
|
41
40
|
json (2.6.1)
|
42
41
|
method_source (1.0.0)
|
43
42
|
mime-types (3.4.1)
|
44
43
|
mime-types-data (~> 3.2015)
|
45
44
|
mime-types-data (3.2022.0105)
|
46
|
-
minitest (5.
|
45
|
+
minitest (5.16.3)
|
47
46
|
multi_xml (0.6.0)
|
48
47
|
parallel (1.21.0)
|
49
48
|
parser (3.0.3.2)
|
@@ -92,21 +91,21 @@ GEM
|
|
92
91
|
ruby-progressbar (1.11.0)
|
93
92
|
simple_command (0.1.0)
|
94
93
|
sqlite3 (1.4.2)
|
95
|
-
tzinfo (2.0.
|
94
|
+
tzinfo (2.0.5)
|
96
95
|
concurrent-ruby (~> 1.0)
|
97
96
|
unicode-display_width (2.1.0)
|
98
97
|
webmock (3.14.0)
|
99
98
|
addressable (>= 2.8.0)
|
100
99
|
crack (>= 0.3.2)
|
101
100
|
hashdiff (>= 0.4.0, < 2.0.0)
|
102
|
-
zeitwerk (2.5.1)
|
103
101
|
|
104
102
|
PLATFORMS
|
103
|
+
x64-mingw32
|
105
104
|
x86_64-darwin-21
|
106
105
|
x86_64-linux
|
107
106
|
|
108
107
|
DEPENDENCIES
|
109
|
-
activerecord (~>
|
108
|
+
activerecord (~> 7.0.4)
|
110
109
|
bundler (~> 2.2)
|
111
110
|
database_cleaner-active_record (~> 2.0.1)
|
112
111
|
json (~> 2.6)
|
@@ -122,4 +121,4 @@ DEPENDENCIES
|
|
122
121
|
webmock (~> 3.14)
|
123
122
|
|
124
123
|
BUNDLED WITH
|
125
|
-
2.3.
|
124
|
+
2.3.25
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Minato
|
4
|
+
module Utils
|
5
|
+
class Response
|
6
|
+
attr_reader :code, :header, :body
|
7
|
+
|
8
|
+
def initialize(response)
|
9
|
+
@code = response.code
|
10
|
+
@header = response.header.to_hash || {}
|
11
|
+
@body = Helpers.parse_json(response.body)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -9,10 +9,7 @@ module Minato
|
|
9
9
|
class << self
|
10
10
|
def handle(response)
|
11
11
|
raise_exception(response) if response_error?(response)
|
12
|
-
|
13
|
-
body = Minato::Utils::Helpers.parse_json(response.body)
|
14
|
-
header = response.header.to_hash || {}
|
15
|
-
{ body: body, header: header }
|
12
|
+
Response.new(response)
|
16
13
|
end
|
17
14
|
|
18
15
|
private
|
data/lib/minato/utils/version.rb
CHANGED
data/lib/minato/utils.rb
CHANGED
data/minato-ruby-utils.gemspec
CHANGED
@@ -24,11 +24,11 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
|
27
|
-
spec.add_dependency 'activesupport', '~>
|
27
|
+
spec.add_dependency 'activesupport', '~> 7.0.4'
|
28
28
|
spec.add_dependency 'httparty', '~> 0.18'
|
29
29
|
spec.add_dependency 'simple_command', '~> 0.1.0'
|
30
30
|
|
31
|
-
spec.add_development_dependency 'activerecord', '~>
|
31
|
+
spec.add_development_dependency 'activerecord', '~> 7.0.4'
|
32
32
|
spec.add_development_dependency 'bundler', '~> 2.2'
|
33
33
|
spec.add_development_dependency 'database_cleaner-active_record', '~> 2.0.1'
|
34
34
|
spec.add_development_dependency 'json', '~> 2.6'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minato-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ferreri
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 7.0.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 7.0.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: httparty
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 7.0.4
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 7.0.4
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: bundler
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -266,6 +266,7 @@ files:
|
|
266
266
|
- lib/minato/utils/exception.rb
|
267
267
|
- lib/minato/utils/helpers.rb
|
268
268
|
- lib/minato/utils/logger.rb
|
269
|
+
- lib/minato/utils/response.rb
|
269
270
|
- lib/minato/utils/response_handler.rb
|
270
271
|
- lib/minato/utils/version.rb
|
271
272
|
- minato-ruby-utils.gemspec
|