restful_resource 2.7.0 → 2.8.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 +4 -4
- data/Gemfile.lock +25 -25
- data/lib/restful_resource/base.rb +8 -8
- data/lib/restful_resource/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c511ad574a9784552504e068391cf15f73bdbbf4f89c42d725ecfd64221e772f
|
|
4
|
+
data.tar.gz: 84ac5026baabbe9433a51f4cac7e01e79c8ce28fb9a2175d98277024de0d76b6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ab6abfd19fa1cc2466d44583741f806616d338d865139860b8d088b7a9dd2a021d70966d59d2bb10839e13cc26d8c0f715c5d87c7061c9b9c9dcbad75df28c49
|
|
7
|
+
data.tar.gz: d2b5848f1554b203817b026141db8853b774a655d50e1a8766ab19bb2c09e735c07825a7ced98274dadb9834c9209da029eb4e0a8d6dff72b9befe074bb92765
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
restful_resource (2.
|
|
4
|
+
restful_resource (2.8.0)
|
|
5
5
|
activesupport
|
|
6
6
|
faraday (~> 0.15.0)
|
|
7
7
|
faraday-cdn-metrics
|
|
@@ -15,14 +15,14 @@ PATH
|
|
|
15
15
|
GEM
|
|
16
16
|
remote: https://rubygems.org/
|
|
17
17
|
specs:
|
|
18
|
-
activesupport (6.0.
|
|
18
|
+
activesupport (6.0.1)
|
|
19
19
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
20
20
|
i18n (>= 0.7, < 2)
|
|
21
21
|
minitest (~> 5.1)
|
|
22
22
|
tzinfo (~> 1.1)
|
|
23
|
-
zeitwerk (~> 2.
|
|
23
|
+
zeitwerk (~> 2.2)
|
|
24
24
|
ast (2.4.0)
|
|
25
|
-
carwow_rubocop (3.0.
|
|
25
|
+
carwow_rubocop (3.0.4)
|
|
26
26
|
rubocop (>= 0.68)
|
|
27
27
|
rubocop-performance
|
|
28
28
|
rubocop-rspec
|
|
@@ -41,52 +41,52 @@ GEM
|
|
|
41
41
|
faraday (~> 0.8)
|
|
42
42
|
faraday_middleware (0.13.1)
|
|
43
43
|
faraday (>= 0.7.4, < 1.0)
|
|
44
|
-
ffi (1.11.
|
|
44
|
+
ffi (1.11.2)
|
|
45
45
|
i18n (1.7.0)
|
|
46
46
|
concurrent-ruby (~> 1.0)
|
|
47
47
|
jaro_winkler (1.5.3)
|
|
48
48
|
link_header (0.0.8)
|
|
49
49
|
method_source (0.9.2)
|
|
50
|
-
minitest (5.
|
|
50
|
+
minitest (5.13.0)
|
|
51
51
|
multipart-post (2.1.1)
|
|
52
|
-
parallel (1.
|
|
53
|
-
parser (2.6.
|
|
52
|
+
parallel (1.18.0)
|
|
53
|
+
parser (2.6.5.0)
|
|
54
54
|
ast (~> 2.4.0)
|
|
55
55
|
pry (0.12.2)
|
|
56
56
|
coderay (~> 1.1.0)
|
|
57
57
|
method_source (~> 0.9.0)
|
|
58
58
|
rack (2.0.7)
|
|
59
59
|
rainbow (3.0.0)
|
|
60
|
-
rake (
|
|
61
|
-
rspec (3.
|
|
62
|
-
rspec-core (~> 3.
|
|
63
|
-
rspec-expectations (~> 3.
|
|
64
|
-
rspec-mocks (~> 3.
|
|
65
|
-
rspec-core (3.
|
|
66
|
-
rspec-support (~> 3.
|
|
67
|
-
rspec-expectations (3.
|
|
60
|
+
rake (13.0.0)
|
|
61
|
+
rspec (3.9.0)
|
|
62
|
+
rspec-core (~> 3.9.0)
|
|
63
|
+
rspec-expectations (~> 3.9.0)
|
|
64
|
+
rspec-mocks (~> 3.9.0)
|
|
65
|
+
rspec-core (3.9.0)
|
|
66
|
+
rspec-support (~> 3.9.0)
|
|
67
|
+
rspec-expectations (3.9.0)
|
|
68
68
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
69
|
-
rspec-support (~> 3.
|
|
69
|
+
rspec-support (~> 3.9.0)
|
|
70
70
|
rspec-its (1.3.0)
|
|
71
71
|
rspec-core (>= 3.0.0)
|
|
72
72
|
rspec-expectations (>= 3.0.0)
|
|
73
|
-
rspec-mocks (3.
|
|
73
|
+
rspec-mocks (3.9.0)
|
|
74
74
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
75
|
-
rspec-support (~> 3.
|
|
76
|
-
rspec-support (3.
|
|
75
|
+
rspec-support (~> 3.9.0)
|
|
76
|
+
rspec-support (3.9.0)
|
|
77
77
|
rspec_junit_formatter (0.4.1)
|
|
78
78
|
rspec-core (>= 2, < 4, != 2.12.0)
|
|
79
|
-
rubocop (0.
|
|
79
|
+
rubocop (0.75.1)
|
|
80
80
|
jaro_winkler (~> 1.5.1)
|
|
81
81
|
parallel (~> 1.10)
|
|
82
82
|
parser (>= 2.6)
|
|
83
83
|
rainbow (>= 2.2.2, < 4.0)
|
|
84
84
|
ruby-progressbar (~> 1.7)
|
|
85
85
|
unicode-display_width (>= 1.4.0, < 1.7)
|
|
86
|
-
rubocop-performance (1.
|
|
86
|
+
rubocop-performance (1.5.0)
|
|
87
87
|
rubocop (>= 0.71.0)
|
|
88
|
-
rubocop-rspec (1.
|
|
89
|
-
rubocop (>= 0.
|
|
88
|
+
rubocop-rspec (1.36.0)
|
|
89
|
+
rubocop (>= 0.68.1)
|
|
90
90
|
ruby-progressbar (1.10.1)
|
|
91
91
|
thread_safe (0.3.6)
|
|
92
92
|
typhoeus (1.3.1)
|
|
@@ -94,7 +94,7 @@ GEM
|
|
|
94
94
|
tzinfo (1.2.5)
|
|
95
95
|
thread_safe (~> 0.1)
|
|
96
96
|
unicode-display_width (1.6.0)
|
|
97
|
-
zeitwerk (2.2.
|
|
97
|
+
zeitwerk (2.2.1)
|
|
98
98
|
|
|
99
99
|
PLATFORMS
|
|
100
100
|
ruby
|
|
@@ -33,14 +33,14 @@ module RestfulResource
|
|
|
33
33
|
@resource_path = url
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
def self.find(id, params
|
|
36
|
+
def self.find(id, **params)
|
|
37
37
|
params_without_options, options = format_params(params)
|
|
38
38
|
|
|
39
39
|
response = http.get(member_url(id, params_without_options), **options)
|
|
40
40
|
new(parse_json(response.body))
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
-
def self.where(params
|
|
43
|
+
def self.where(**params)
|
|
44
44
|
params_without_options, options = format_params(params)
|
|
45
45
|
|
|
46
46
|
url = collection_url(params_without_options)
|
|
@@ -48,7 +48,7 @@ module RestfulResource
|
|
|
48
48
|
paginate_response(response)
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
-
def self.get(params
|
|
51
|
+
def self.get(**params)
|
|
52
52
|
params_without_options, options = format_params(params)
|
|
53
53
|
|
|
54
54
|
response = http.get(collection_url(params_without_options), **options)
|
|
@@ -92,7 +92,7 @@ module RestfulResource
|
|
|
92
92
|
new(parse_json(response.body))
|
|
93
93
|
end
|
|
94
94
|
|
|
95
|
-
def self.all(params
|
|
95
|
+
def self.all(**params)
|
|
96
96
|
where(params)
|
|
97
97
|
end
|
|
98
98
|
|
|
@@ -133,14 +133,14 @@ module RestfulResource
|
|
|
133
133
|
result
|
|
134
134
|
end
|
|
135
135
|
|
|
136
|
-
def self.collection_url(params)
|
|
136
|
+
def self.collection_url(**params)
|
|
137
137
|
url = merge_url_paths(base_url, @resource_path, @action_prefix)
|
|
138
138
|
replace_parameters(url, params)
|
|
139
139
|
end
|
|
140
140
|
|
|
141
141
|
private
|
|
142
142
|
|
|
143
|
-
def self.format_params(params
|
|
143
|
+
def self.format_params(**params)
|
|
144
144
|
headers = params.delete(:headers) || {}
|
|
145
145
|
|
|
146
146
|
headers[:cache_control] = 'no-cache' if params.delete(:no_cache)
|
|
@@ -154,7 +154,7 @@ module RestfulResource
|
|
|
154
154
|
uri.merge(paths.compact.join('/')).to_s
|
|
155
155
|
end
|
|
156
156
|
|
|
157
|
-
def self.member_url(id, params)
|
|
157
|
+
def self.member_url(id, **params)
|
|
158
158
|
raise ResourceIdMissingError if id.blank?
|
|
159
159
|
|
|
160
160
|
url = merge_url_paths(base_url, @resource_path, CGI.escape(id.to_s), @action_prefix)
|
|
@@ -173,7 +173,7 @@ module RestfulResource
|
|
|
173
173
|
ActiveSupport::JSON.decode(json)
|
|
174
174
|
end
|
|
175
175
|
|
|
176
|
-
def self.replace_parameters(url, params)
|
|
176
|
+
def self.replace_parameters(url, **params)
|
|
177
177
|
missing_params = []
|
|
178
178
|
params = params.with_indifferent_access
|
|
179
179
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: restful_resource
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Santoro
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2019-
|
|
12
|
+
date: 2019-11-12 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bundler
|