flexirest 1.10.10 → 1.10.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 55d28434a66d8b6b7b6421c2778bb23c0f548c2f80d1b37bcab0dc6b95188bc6
4
- data.tar.gz: 3659a7ab74c41da1846372ebdd406cb232579acedbe31c26b304bebbacbb0003
3
+ metadata.gz: 60510339b01a0ade8d9cd94686ecec5f431bcb58570c66b48fdc76075faf4d4f
4
+ data.tar.gz: 203e88d288ba8fa7f46f757a9aa24177908df116a272b754dc9bd685b19302db
5
5
  SHA512:
6
- metadata.gz: 2ad7882b187e5906b49acbca900fbd8a954e30533ef280d8cb61d82b9a4a9a1ef3307e355fbc293a050672b72d176ef32c3ce11101974c5116681fc9b1ce1015
7
- data.tar.gz: c3f789601f482846bbd495a89796d907dc6c8e06d11af81170f0176e700164594892fa9ea4f842be8e98997a06719292a7ebfa0f53527f4845149fb1f13251fc
6
+ metadata.gz: f2d51bcbce5d390baa8140cc222cbe69bfb873cb6db399a3e955358b36b39aea6241df15abd8458b79e03d87e3e4643551d2d809dabd0a4ae92c9131e9277da1
7
+ data.tar.gz: 73445e4f9be17c311354112a41e7a9290695da228d853e1a67ea063d8aae8a1370f7bf4991fa43bd70a264b608c94416ad005929aa055863686ca919c6fe19ce
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.10.11
4
+
5
+ Bugfix:
6
+
7
+ - HTTPClientException's instance body was return nil instead of the response. (thanks to @pinifloyd for the issue and PR)
8
+
3
9
  ## 1.10.10
4
10
 
5
11
  Bugfix:
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) | [Parallel requests >](parallel-requests.md)
54
+ [< Authentication](authentication.md) | [Empty body handling >](empty-body-handling.md)
@@ -20,3 +20,7 @@ class Person < Flexirest::Base
20
20
  put :save, "/people/:id", ignore_empty_response: true
21
21
  end
22
22
  ```
23
+
24
+ -----
25
+
26
+ [< Body types](body-types.md) | [Parallel requests >](parallel-requests.md)
@@ -25,4 +25,4 @@ puts @employers.size #=> 7
25
25
 
26
26
  -----
27
27
 
28
- [< Body types](body-types.md) | [Faking calls >](faking-calls.md)
28
+ [< Empty body handling](empty-body-handling.md) | [Faking calls >](faking-calls.md)
@@ -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)
@@ -66,7 +66,7 @@ module Flexirest
66
66
  @dirty_attributes.keys
67
67
  end
68
68
 
69
- # Returns hash of old and new vaules for each changed field
69
+ # Returns hash of old and new values for each changed field
70
70
  def changes
71
71
  @dirty_attributes
72
72
  end
@@ -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 specifed: #{missing.join(", ")}")
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 specifed: #{missing.join(", ")}")
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, :raw_response
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 :body, :raw_response
945
+ alias_method :raw_response, :body
946
946
 
947
947
  def message
948
948
  method = @method.try(:upcase)
@@ -1,3 +1,3 @@
1
1
  module Flexirest
2
- VERSION = "1.10.10"
2
+ VERSION = "1.10.11"
3
3
  end
@@ -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 intepret them as dates" do
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 intepret them as dates" do
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
@@ -209,7 +209,7 @@ describe Flexirest::Configuration do
209
209
  end
210
210
  end
211
211
 
212
- it "should default to non-verbose loggingg" do
212
+ it "should default to non-verbose logging" do
213
213
  class VerboseConfigurationExample1
214
214
  include Flexirest::Configuration
215
215
  end
@@ -10,7 +10,7 @@ describe Flexirest::Connection do
10
10
  @connection.reconnect
11
11
  end
12
12
 
13
- it "should contain a Farday connection" do
13
+ it "should contain a Faraday connection" do
14
14
  expect(@connection.session).to be_a_kind_of(Faraday::Connection)
15
15
  end
16
16
 
@@ -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 204 response and not erase the instance's attributes" do
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.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-01-26 00:00:00.000000000 Z
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.1.2
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