flexirest 1.9.18 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/flexirest.gemspec +0 -8
- data/lib/flexirest/request.rb +15 -1
- data/lib/flexirest/version.rb +1 -1
- data/spec/lib/request_spec.rb +3 -3
- 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: 9f713d7d9f8f37de42e54bd20623b4477b9893b6cd40f0d2d5e8c5a06079a821
|
4
|
+
data.tar.gz: b5fc1fe7bffbe57a6adf9443aab86d91313fddd90b2fcc2ef35f50f2b41ec942
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eedfb75a0ecacbb1114d62fad201cf5e478242dd74126b87b29f1081e9c56b4194b600c6d729ac8afa70a7dd4ee8d66a03057974a2e52ee76f575e848027bfca
|
7
|
+
data.tar.gz: 955f229836e2e6fbc6273b1505294619ab0a614af05e79d0e5113b956959dbf22bb76ed23b2a169a9dafe207b6ab48b3559f7adeb84f22e3fcff01fbc223b28f
|
data/CHANGELOG.md
CHANGED
data/flexirest.gemspec
CHANGED
@@ -53,12 +53,4 @@ Gem::Specification.new do |spec|
|
|
53
53
|
else
|
54
54
|
spec.add_runtime_dependency "activesupport", "< 5.0.0"
|
55
55
|
end
|
56
|
-
# JSON is an implicit dependency of something, but JSON v2+ requires Ruby 2+
|
57
|
-
# Same with "tins" which is a dependency of coveralls
|
58
|
-
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
|
59
|
-
spec.add_runtime_dependency "json", "< 2.0.0"
|
60
|
-
spec.add_runtime_dependency "tins", "~> 1.6.0"
|
61
|
-
spec.add_runtime_dependency "term-ansicolor", "~> 1.3.2"
|
62
|
-
spec.add_runtime_dependency "public_suffix", "~> 1.4.6"
|
63
|
-
end
|
64
56
|
end
|
data/lib/flexirest/request.rb
CHANGED
@@ -630,6 +630,16 @@ module Flexirest
|
|
630
630
|
raise HTTPConflictClientException.new(status:status, result:error_response, raw_response: @response.body, url:@url, method: http_method)
|
631
631
|
elsif status == 429
|
632
632
|
raise HTTPTooManyRequestsClientException.new(status:status, result:error_response, raw_response: @response.body, url:@url, method: http_method)
|
633
|
+
elsif status == 500
|
634
|
+
raise HTTPInternalServerException.new(status:status, result:error_response, raw_response: @response.body, url:@url, method: http_method)
|
635
|
+
elsif status == 501
|
636
|
+
raise HTTPNotImplementedServerException.new(status:status, result:error_response, raw_response: @response.body, url:@url, method: http_method)
|
637
|
+
elsif status == 502
|
638
|
+
raise HTTPBadGatewayServerException.new(status:status, result:error_response, raw_response: @response.body, url:@url, method: http_method)
|
639
|
+
elsif status == 503
|
640
|
+
raise HTTPServiceUnavailableServerException.new(status:status, result:error_response, raw_response: @response.body, url:@url, method: http_method)
|
641
|
+
elsif status == 504
|
642
|
+
raise HTTPGatewayTimeoutServerException.new(status:status, result:error_response, raw_response: @response.body, url:@url, method: http_method)
|
633
643
|
elsif (400..499).include? status
|
634
644
|
raise HTTPClientException.new(status:status, result:error_response, raw_response: @response.body, url:@url, method: http_method)
|
635
645
|
elsif (500..599).include? status
|
@@ -901,5 +911,9 @@ module Flexirest
|
|
901
911
|
class HTTPNotFoundClientException < HTTPClientException ; end
|
902
912
|
class HTTPTooManyRequestsClientException < HTTPClientException ; end
|
903
913
|
class HTTPServerException < HTTPException ; end
|
904
|
-
|
914
|
+
class HTTPInternalServerException < HTTPServerException ; end
|
915
|
+
class HTTPNotImplementedServerException < HTTPServerException ; end
|
916
|
+
class HTTPBadGatewayServerException < HTTPServerException ; end
|
917
|
+
class HTTPServiceUnavailableServerException < HTTPServerException ; end
|
918
|
+
class HTTPGatewayTimeoutServerException < HTTPServerException ; end
|
905
919
|
end
|
data/lib/flexirest/version.rb
CHANGED
data/spec/lib/request_spec.rb
CHANGED
@@ -1005,7 +1005,7 @@ describe Flexirest::Request do
|
|
1005
1005
|
rescue Flexirest::HTTPServerException => e
|
1006
1006
|
e
|
1007
1007
|
end
|
1008
|
-
expect(e).to be_instance_of(Flexirest::
|
1008
|
+
expect(e).to be_instance_of(Flexirest::HTTPInternalServerException)
|
1009
1009
|
expect(e.status).to eq(500)
|
1010
1010
|
expect(e.result.first_name).to eq("John")
|
1011
1011
|
end
|
@@ -1021,7 +1021,7 @@ describe Flexirest::Request do
|
|
1021
1021
|
rescue Flexirest::HTTPServerException => e
|
1022
1022
|
e
|
1023
1023
|
end
|
1024
|
-
expect(e.message).to eq(%q{The POST to '/create' returned a 500 status, which raised a Flexirest::
|
1024
|
+
expect(e.message).to eq(%q{The POST to '/create' returned a 500 status, which raised a Flexirest::HTTPInternalServerException with a body of: \{"first_name":"John", "id":1234\}})
|
1025
1025
|
end
|
1026
1026
|
|
1027
1027
|
it "should raise a parse exception for invalid JSON returns" do
|
@@ -1036,7 +1036,7 @@ describe Flexirest::Request do
|
|
1036
1036
|
rescue => e
|
1037
1037
|
e
|
1038
1038
|
end
|
1039
|
-
expect(e).to be_instance_of(Flexirest::
|
1039
|
+
expect(e).to be_instance_of(Flexirest::HTTPInternalServerException)
|
1040
1040
|
expect(e.status).to eq(500)
|
1041
1041
|
expect(e.result).to eq(error_content)
|
1042
1042
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flexirest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Jeffries
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|