flexirest 1.10.10 → 1.10.11
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/docs/body-types.md +2 -2
- data/docs/empty-body-handling.md +4 -0
- data/docs/parallel-requests.md +1 -1
- data/docs/using-callbacks.md +1 -0
- data/lib/flexirest/base_without_validation.rb +1 -1
- data/lib/flexirest/request.rb +4 -4
- data/lib/flexirest/version.rb +1 -1
- data/spec/lib/base_without_validation_spec.rb +2 -2
- data/spec/lib/configuration_spec.rb +1 -1
- data/spec/lib/connection_spec.rb +1 -1
- data/spec/lib/request_spec.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60510339b01a0ade8d9cd94686ecec5f431bcb58570c66b48fdc76075faf4d4f
|
4
|
+
data.tar.gz: 203e88d288ba8fa7f46f757a9aa24177908df116a272b754dc9bd685b19302db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2d51bcbce5d390baa8140cc222cbe69bfb873cb6db399a3e955358b36b39aea6241df15abd8458b79e03d87e3e4643551d2d809dabd0a4ae92c9131e9277da1
|
7
|
+
data.tar.gz: 73445e4f9be17c311354112a41e7a9290695da228d853e1a67ea063d8aae8a1370f7bf4991fa43bd70a264b608c94416ad005929aa055863686ca919c6fe19ce
|
data/CHANGELOG.md
CHANGED
data/docs/body-types.md
CHANGED
@@ -45,10 +45,10 @@ class Person < Flexirest::Base
|
|
45
45
|
put :save, '/person/:id/logs', request_body_type: :plain
|
46
46
|
end
|
47
47
|
|
48
|
-
Person.save(id: 1, body: '["Something here"]',
|
48
|
+
Person.save(id: 1, body: '["Something here"]',
|
49
49
|
content_type: "application/json")
|
50
50
|
```
|
51
51
|
|
52
52
|
-----
|
53
53
|
|
54
|
-
[< Authentication](authentication.md) | [
|
54
|
+
[< Authentication](authentication.md) | [Empty body handling >](empty-body-handling.md)
|
data/docs/empty-body-handling.md
CHANGED
data/docs/parallel-requests.md
CHANGED
data/docs/using-callbacks.md
CHANGED
@@ -105,6 +105,7 @@ class Animal < Flexirest::Base
|
|
105
105
|
Flexirest::Logger.info(" \033[1;4;32m#{Flexirest.name}\033[0m Invalidating cache for #{self.class.name} #{request.url}")
|
106
106
|
Rails.cache.delete("#{self.class.name}:#{request.url}")
|
107
107
|
end
|
108
|
+
nil
|
108
109
|
end
|
109
110
|
|
110
111
|
def cache(name, response)
|
data/lib/flexirest/request.rb
CHANGED
@@ -404,7 +404,7 @@ module Flexirest
|
|
404
404
|
end
|
405
405
|
end
|
406
406
|
if missing.any?
|
407
|
-
raise Flexirest::MissingParametersException.new("The following parameters weren't
|
407
|
+
raise Flexirest::MissingParametersException.new("The following parameters weren't specified: #{missing.join(", ")}")
|
408
408
|
end
|
409
409
|
end
|
410
410
|
end
|
@@ -434,7 +434,7 @@ module Flexirest
|
|
434
434
|
end
|
435
435
|
|
436
436
|
if missing.present?
|
437
|
-
raise Flexirest::MissingParametersException.new("The following parameters weren't
|
437
|
+
raise Flexirest::MissingParametersException.new("The following parameters weren't specified: #{missing.join(", ")}")
|
438
438
|
end
|
439
439
|
end
|
440
440
|
|
@@ -934,7 +934,7 @@ module Flexirest
|
|
934
934
|
end
|
935
935
|
|
936
936
|
class HTTPException < RequestException
|
937
|
-
attr_accessor :status, :result, :request_url, :body
|
937
|
+
attr_accessor :status, :result, :request_url, :body
|
938
938
|
def initialize(options)
|
939
939
|
@status = options[:status]
|
940
940
|
@result = options[:result]
|
@@ -942,7 +942,7 @@ module Flexirest
|
|
942
942
|
@body = options[:raw_response]
|
943
943
|
@method = options[:method]
|
944
944
|
end
|
945
|
-
alias_method :
|
945
|
+
alias_method :raw_response, :body
|
946
946
|
|
947
947
|
def message
|
948
948
|
method = @method.try(:upcase)
|
data/lib/flexirest/version.rb
CHANGED
@@ -114,12 +114,12 @@ describe Flexirest::BaseWithoutValidation do
|
|
114
114
|
expect(client["test"]).to be_an_instance_of(DateTime)
|
115
115
|
end
|
116
116
|
|
117
|
-
it "should allow strings of 4 digits and not
|
117
|
+
it "should allow strings of 4 digits and not interpret them as dates" do
|
118
118
|
client = EmptyExample.new(test: "2015")
|
119
119
|
expect(client["test"]).to be_an_instance_of(String)
|
120
120
|
end
|
121
121
|
|
122
|
-
it "should allow strings of 8 digits and not
|
122
|
+
it "should allow strings of 8 digits and not interpret them as dates" do
|
123
123
|
client = EmptyExample.new(test: "1266129")
|
124
124
|
expect(client["test"]).to be_an_instance_of(String)
|
125
125
|
end
|
data/spec/lib/connection_spec.rb
CHANGED
data/spec/lib/request_spec.rb
CHANGED
@@ -532,7 +532,7 @@ describe Flexirest::Request do
|
|
532
532
|
expect(ret).to be_truthy
|
533
533
|
end
|
534
534
|
|
535
|
-
it "should handle a
|
535
|
+
it "should handle a 200 response with an empty body and not erase the instance's attributes" do
|
536
536
|
expect_any_instance_of(Flexirest::Connection).to receive(:put).and_return(::FaradayResponseMock.new(OpenStruct.new(body: "", response_headers: {}, status: 200)))
|
537
537
|
client = ExampleClient.new
|
538
538
|
client.id = "1234"
|
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.10.
|
4
|
+
version: 1.10.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Jeffries
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -370,7 +370,7 @@ licenses:
|
|
370
370
|
- MIT
|
371
371
|
metadata:
|
372
372
|
source_code_uri: https://github.com/flexirest/flexirest
|
373
|
-
post_install_message:
|
373
|
+
post_install_message:
|
374
374
|
rdoc_options: []
|
375
375
|
require_paths:
|
376
376
|
- lib
|
@@ -385,8 +385,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
385
385
|
- !ruby/object:Gem::Version
|
386
386
|
version: '0'
|
387
387
|
requirements: []
|
388
|
-
rubygems_version: 3.
|
389
|
-
signing_key:
|
388
|
+
rubygems_version: 3.3.7
|
389
|
+
signing_key:
|
390
390
|
specification_version: 4
|
391
391
|
summary: This gem is for accessing REST services in a flexible way. ActiveResource
|
392
392
|
already exists for this, but it doesn't work where the resource naming doesn't follow
|