footrest 0.5.6 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/footrest.gemspec +2 -1
- data/lib/footrest/follow_redirects.rb +1 -1
- data/lib/footrest/request.rb +4 -0
- data/lib/footrest/response_middleware.rb +1 -1
- data/lib/footrest/version.rb +1 -1
- data/spec/footrest/http_error_spec.rb +3 -2
- metadata +30 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e1edaefd5d1a604cc0bce710c44e6a8cd7757b31f32950a5de5b637755c2f31
|
4
|
+
data.tar.gz: 61022350f362ef8cc04f1a8ec83c9e21645d314bac12b67984b234cd6b53570c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d589575e6b52848baf5af15e0027111826343f6bbd596d7e1b142a0f5108618a09ad422e5720e23950f7d9743e1d6d511a551ef4d8e519cf03ec5332b8590c85
|
7
|
+
data.tar.gz: 605dec8ec1e209bc6d685a70a8f18f0be7ca2baf202aa11ff7f867e7ec45a0f440b1549271a61d18629a2de0f99eedd188d8ea622a99cc134293fdb27d702b15
|
data/footrest.gemspec
CHANGED
@@ -25,8 +25,9 @@ Gem::Specification.new do |gem|
|
|
25
25
|
gem.add_development_dependency "webmock"
|
26
26
|
gem.add_development_dependency "pry"
|
27
27
|
gem.add_development_dependency "byebug"
|
28
|
+
gem.add_development_dependency "faraday", ">1.0.0", "< 2"
|
28
29
|
|
29
|
-
gem.add_dependency "faraday", ">= 0.9.0", "<
|
30
|
+
gem.add_dependency "faraday", ">= 0.9.0", "< 2"
|
30
31
|
gem.add_dependency "activesupport", ">= 3.0.0"
|
31
32
|
|
32
33
|
# Parses Link headers formatted according to RFC 5988 draft spec
|
@@ -3,7 +3,7 @@ require 'set'
|
|
3
3
|
|
4
4
|
module Footrest
|
5
5
|
# Public: Exception thrown when the maximum amount of requests is exceeded.
|
6
|
-
class RedirectLimitReached < Faraday::
|
6
|
+
class RedirectLimitReached < Faraday::ClientError
|
7
7
|
attr_reader :response
|
8
8
|
|
9
9
|
def initialize(response)
|
data/lib/footrest/request.rb
CHANGED
@@ -21,6 +21,10 @@ module Footrest
|
|
21
21
|
request_with_params_in_body(:put, path, options)
|
22
22
|
end
|
23
23
|
|
24
|
+
def patch(path, options={})
|
25
|
+
request_with_params_in_body(:patch, path, options)
|
26
|
+
end
|
27
|
+
|
24
28
|
def request_with_params_in_url(method, path, options)
|
25
29
|
request(method) do |r|
|
26
30
|
r.url(fullpath(path), options)
|
@@ -47,7 +47,7 @@ module Footrest
|
|
47
47
|
self.class.parser.call(body)
|
48
48
|
rescue StandardError, SyntaxError => err
|
49
49
|
raise err if err.is_a? SyntaxError and err.class.name != 'Psych::SyntaxError'
|
50
|
-
raise Faraday::
|
50
|
+
raise Faraday::ParsingError, err
|
51
51
|
end
|
52
52
|
else
|
53
53
|
body
|
data/lib/footrest/version.rb
CHANGED
@@ -9,7 +9,7 @@ module Footrest
|
|
9
9
|
describe HttpError::ErrorBase, :focus do
|
10
10
|
let(:response) { Faraday::Env.new(
|
11
11
|
:get,
|
12
|
-
{
|
12
|
+
{ }.to_json,
|
13
13
|
URI.parse('http://domain.com/api/v1/not_found'),
|
14
14
|
Faraday::RequestOptions.new,
|
15
15
|
{
|
@@ -22,7 +22,8 @@ module Footrest
|
|
22
22
|
nil,
|
23
23
|
nil,
|
24
24
|
{"Foo-Bar" => 'baz'},
|
25
|
-
400
|
25
|
+
400,
|
26
|
+
"Bad Response", { errors: [{message: "I don't even"}] }.to_json
|
26
27
|
) }
|
27
28
|
let(:error) { HttpError::ErrorBase.new(response) }
|
28
29
|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: footrest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Duane Johnson
|
8
8
|
- Nathan Mills
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-08-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -95,6 +95,26 @@ dependencies:
|
|
95
95
|
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: faraday
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: 1.0.0
|
105
|
+
- - "<"
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '2'
|
108
|
+
type: :development
|
109
|
+
prerelease: false
|
110
|
+
version_requirements: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ">"
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: 1.0.0
|
115
|
+
- - "<"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '2'
|
98
118
|
- !ruby/object:Gem::Dependency
|
99
119
|
name: faraday
|
100
120
|
requirement: !ruby/object:Gem::Requirement
|
@@ -104,7 +124,7 @@ dependencies:
|
|
104
124
|
version: 0.9.0
|
105
125
|
- - "<"
|
106
126
|
- !ruby/object:Gem::Version
|
107
|
-
version: '
|
127
|
+
version: '2'
|
108
128
|
type: :runtime
|
109
129
|
prerelease: false
|
110
130
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -114,7 +134,7 @@ dependencies:
|
|
114
134
|
version: 0.9.0
|
115
135
|
- - "<"
|
116
136
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
137
|
+
version: '2'
|
118
138
|
- !ruby/object:Gem::Dependency
|
119
139
|
name: activesupport
|
120
140
|
requirement: !ruby/object:Gem::Requirement
|
@@ -172,7 +192,7 @@ homepage: https://github.com/instructure/footrest
|
|
172
192
|
licenses:
|
173
193
|
- MIT
|
174
194
|
metadata: {}
|
175
|
-
post_install_message:
|
195
|
+
post_install_message:
|
176
196
|
rdoc_options: []
|
177
197
|
require_paths:
|
178
198
|
- lib
|
@@ -187,13 +207,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
207
|
- !ruby/object:Gem::Version
|
188
208
|
version: '0'
|
189
209
|
requirements: []
|
190
|
-
rubygems_version: 3.
|
191
|
-
signing_key:
|
210
|
+
rubygems_version: 3.5.4
|
211
|
+
signing_key:
|
192
212
|
specification_version: 4
|
193
213
|
summary: REST APIs
|
194
214
|
test_files:
|
195
|
-
- spec/footrest/http_error_spec.rb
|
196
215
|
- spec/footrest/client_spec.rb
|
197
|
-
- spec/footrest/
|
216
|
+
- spec/footrest/http_error_spec.rb
|
198
217
|
- spec/footrest/pagination_spec.rb
|
218
|
+
- spec/footrest/request_spec.rb
|
199
219
|
- spec/spec_helper.rb
|