flexirest 1.10.10 → 1.10.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +1 -1
- data/docs/body-types.md +2 -2
- data/docs/empty-body-handling.md +4 -0
- data/docs/{debugging.md → logging.md} +23 -4
- 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/caching.rb +2 -2
- data/lib/flexirest/configuration.rb +14 -0
- data/lib/flexirest/instrumentation.rb +1 -1
- data/lib/flexirest/request.rb +22 -14
- data/lib/flexirest/version.rb +1 -1
- data/spec/lib/base_without_validation_spec.rb +2 -2
- data/spec/lib/configuration_spec.rb +21 -1
- data/spec/lib/connection_spec.rb +1 -1
- data/spec/lib/instrumentation_spec.rb +1 -1
- data/spec/lib/json_api_spec.rb +4 -4
- data/spec/lib/request_spec.rb +23 -3
- data/spec/spec_helper.rb +2 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40ffddde69dc7fb5e5e16c7de3e881f4c913d573170c8ddefcdc799da6a2139e
|
4
|
+
data.tar.gz: 370540fa78e3d99f8a9ac798104e21a1f8d0f5bb8ff54e99d398b682f0a58be9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 253e46a23429c4f0ec77fe9bb223ec80ab758bf352232559e68ae63f1462710af268bee3d9662c5cf104b5f262ff3bea112f03991be8f08ec76777f5c45c021a
|
7
|
+
data.tar.gz: 65a2576d868804a56147227cddb604d3ade6c91960bcd5f59778e3aaad3489682bbc725942a4c1f6f93148333b9929d27238280eb9c8f76b1c9f98b770ea3bdd
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.10.12
|
4
|
+
|
5
|
+
Enhancement:
|
6
|
+
|
7
|
+
- Added a quiet! mode to silence logging (thanks to Mujtaba Saboor for the issue and PR)
|
8
|
+
|
9
|
+
## 1.10.11
|
10
|
+
|
11
|
+
Bugfix:
|
12
|
+
|
13
|
+
- HTTPClientException's instance body was return nil instead of the response. (thanks to @pinifloyd for the issue and PR)
|
14
|
+
|
3
15
|
## 1.10.10
|
4
16
|
|
5
17
|
Bugfix:
|
data/README.md
CHANGED
@@ -100,7 +100,7 @@ I've written a TON of documentation on how to use Flexirest and a LITTLE bit on
|
|
100
100
|
- [HTTP/parse error handling](docs/httpparse-error-handling.md)
|
101
101
|
- [Validation](docs/validation.md)
|
102
102
|
- [Filtering result lists](docs/filtering-result-lists.md)
|
103
|
-
- [
|
103
|
+
- [Logging](docs/logging.md)
|
104
104
|
- [XML responses](docs/xml-responses.md)
|
105
105
|
|
106
106
|
|
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
@@ -1,14 +1,18 @@
|
|
1
|
-
# *Flexirest:*
|
1
|
+
# *Flexirest:* Logging
|
2
2
|
|
3
|
-
|
3
|
+
## Verbose
|
4
|
+
|
5
|
+
You can turn on verbose logging to see what is sent to the API server and what is returned in one of these two ways:
|
4
6
|
|
5
7
|
```ruby
|
6
8
|
class Article < Flexirest::Base
|
7
|
-
verbose
|
9
|
+
verbose!
|
8
10
|
end
|
9
11
|
|
12
|
+
# or if you prefer
|
13
|
+
|
10
14
|
class Person < Flexirest::Base
|
11
|
-
verbose
|
15
|
+
verbose true
|
12
16
|
end
|
13
17
|
```
|
14
18
|
|
@@ -26,6 +30,21 @@ class Article < Flexirest::Base
|
|
26
30
|
end
|
27
31
|
```
|
28
32
|
|
33
|
+
## Quiet
|
34
|
+
|
35
|
+
By the same token, if you want to silence all log output from Flexirest, you can use quiet:
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
class Article < Flexirest::Base
|
39
|
+
quiet!
|
40
|
+
end
|
41
|
+
|
42
|
+
# or if you prefer
|
43
|
+
|
44
|
+
class Person < Flexirest::Base
|
45
|
+
quiet true
|
46
|
+
end
|
47
|
+
```
|
29
48
|
|
30
49
|
-----
|
31
50
|
|
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/caching.rb
CHANGED
@@ -48,10 +48,10 @@ module Flexirest
|
|
48
48
|
@@cache_store = nil
|
49
49
|
end
|
50
50
|
|
51
|
-
def read_cached_response(request)
|
51
|
+
def read_cached_response(request, quiet)
|
52
52
|
if cache_store && perform_caching && request.method[:method] == :get
|
53
53
|
key = "#{request.class_name}:#{request.original_url}"
|
54
|
-
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{key} - Trying to read from cache"
|
54
|
+
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{key} - Trying to read from cache" unless quiet
|
55
55
|
value = cache_store.read(key)
|
56
56
|
value = Marshal.load(value) rescue value
|
57
57
|
end
|
@@ -299,6 +299,20 @@ module Flexirest
|
|
299
299
|
value ? @verbose = value : @verbose
|
300
300
|
end
|
301
301
|
|
302
|
+
def quiet!(options = {})
|
303
|
+
@quiet = true
|
304
|
+
@verbose = false
|
305
|
+
end
|
306
|
+
|
307
|
+
def quiet(value = nil)
|
308
|
+
@quiet ||= false
|
309
|
+
if value == true || value == false
|
310
|
+
@quiet = value
|
311
|
+
@verbose = false if @quiet != false
|
312
|
+
end
|
313
|
+
@quiet
|
314
|
+
end
|
315
|
+
|
302
316
|
def translator(value = nil)
|
303
317
|
Flexirest::Logger.warn("DEPRECATION: The translator functionality of Flexirest has been replaced with proxy functionality, see https://github.com/andyjeffries/flexirest#proxying-apis for more information") unless value.nil?
|
304
318
|
@translator ||= nil
|
@@ -4,7 +4,7 @@ module Flexirest
|
|
4
4
|
self.class.time_spent += event.duration
|
5
5
|
self.class.calls_made += 1
|
6
6
|
name = '%s (%.1fms)' % [Flexirest.name, event.duration]
|
7
|
-
Flexirest::Logger.debug " \033[1;4;32m#{name}\033[0m #{event.payload[:name]}"
|
7
|
+
Flexirest::Logger.debug " \033[1;4;32m#{name}\033[0m #{event.payload[:name]}" unless event.payload[:quiet]
|
8
8
|
end
|
9
9
|
|
10
10
|
def self.time_spent=(value)
|
data/lib/flexirest/request.rb
CHANGED
@@ -184,6 +184,14 @@ module Flexirest
|
|
184
184
|
end
|
185
185
|
end
|
186
186
|
|
187
|
+
def quiet?
|
188
|
+
if object_is_class?
|
189
|
+
@object.quiet
|
190
|
+
else
|
191
|
+
@object.class.quiet
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
187
195
|
def translator
|
188
196
|
if object_is_class?
|
189
197
|
@object.translator
|
@@ -226,7 +234,7 @@ module Flexirest
|
|
226
234
|
@instrumentation_name = "#{class_name}##{@method[:name]}"
|
227
235
|
result = nil
|
228
236
|
cached = nil
|
229
|
-
ActiveSupport::Notifications.instrument("request_call.flexirest", :name => @instrumentation_name) do
|
237
|
+
ActiveSupport::Notifications.instrument("request_call.flexirest", :name => @instrumentation_name, quiet: quiet?) do
|
230
238
|
@explicit_parameters = explicit_parameters
|
231
239
|
@body = nil
|
232
240
|
prepare_params
|
@@ -244,7 +252,7 @@ module Flexirest
|
|
244
252
|
elsif @object.class.new.respond_to?(fake)
|
245
253
|
fake = @object.class.new.send(fake)
|
246
254
|
end
|
247
|
-
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name} - Faked response found"
|
255
|
+
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name} - Faked response found" unless quiet?
|
248
256
|
content_type = @method[:options][:fake_content_type] || "application/json"
|
249
257
|
return handle_response(OpenStruct.new(status:200, body:fake, response_headers:{"X-ARC-Faked-Response" => "true", "Content-Type" => content_type}))
|
250
258
|
end
|
@@ -260,13 +268,13 @@ module Flexirest
|
|
260
268
|
append_get_parameters
|
261
269
|
prepare_request_body
|
262
270
|
self.original_url = self.url
|
263
|
-
cached = original_object_class.read_cached_response(self)
|
271
|
+
cached = original_object_class.read_cached_response(self, quiet?)
|
264
272
|
if cached && !cached.is_a?(String)
|
265
273
|
if cached.expires && cached.expires > Time.now
|
266
|
-
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name} - Absolutely cached copy found"
|
274
|
+
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name} - Absolutely cached copy found" unless quiet?
|
267
275
|
return handle_cached_response(cached)
|
268
276
|
elsif cached.etag.to_s != "" #present? isn't working for some reason
|
269
|
-
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name} - Etag cached copy found with etag #{cached.etag}"
|
277
|
+
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name} - Etag cached copy found with etag #{cached.etag}" unless quiet?
|
270
278
|
etag = cached.etag
|
271
279
|
end
|
272
280
|
end
|
@@ -404,7 +412,7 @@ module Flexirest
|
|
404
412
|
end
|
405
413
|
end
|
406
414
|
if missing.any?
|
407
|
-
raise Flexirest::MissingParametersException.new("The following parameters weren't
|
415
|
+
raise Flexirest::MissingParametersException.new("The following parameters weren't specified: #{missing.join(", ")}")
|
408
416
|
end
|
409
417
|
end
|
410
418
|
end
|
@@ -434,7 +442,7 @@ module Flexirest
|
|
434
442
|
end
|
435
443
|
|
436
444
|
if missing.present?
|
437
|
-
raise Flexirest::MissingParametersException.new("The following parameters weren't
|
445
|
+
raise Flexirest::MissingParametersException.new("The following parameters weren't specified: #{missing.join(", ")}")
|
438
446
|
end
|
439
447
|
end
|
440
448
|
|
@@ -564,9 +572,9 @@ module Flexirest
|
|
564
572
|
connection = Flexirest::ConnectionManager.get_connection(base_url)
|
565
573
|
end
|
566
574
|
if @method[:options][:direct]
|
567
|
-
Flexirest::Logger.info " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name} - Requesting #{@url}"
|
575
|
+
Flexirest::Logger.info " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name} - Requesting #{@url}" unless quiet?
|
568
576
|
else
|
569
|
-
Flexirest::Logger.info " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name} - Requesting #{connection.base_url}#{@url}"
|
577
|
+
Flexirest::Logger.info " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name} - Requesting #{connection.base_url}#{@url}" unless quiet?
|
570
578
|
end
|
571
579
|
|
572
580
|
if verbose?
|
@@ -634,7 +642,7 @@ module Flexirest
|
|
634
642
|
|
635
643
|
if cached && response.status == 304
|
636
644
|
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name}" +
|
637
|
-
' - Etag copy is the same as the server'
|
645
|
+
' - Etag copy is the same as the server' unless quiet?
|
638
646
|
return handle_cached_response(cached)
|
639
647
|
end
|
640
648
|
|
@@ -647,9 +655,9 @@ module Flexirest
|
|
647
655
|
return @response = Flexirest::PlainResponse.from_response(@response)
|
648
656
|
elsif is_json_response? || is_xml_response?
|
649
657
|
if @response.respond_to?(:proxied) && @response.proxied
|
650
|
-
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name} - Response was proxied, unable to determine size"
|
658
|
+
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name} - Response was proxied, unable to determine size" unless quiet?
|
651
659
|
else
|
652
|
-
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name} - Response received #{@response.body.size} bytes"
|
660
|
+
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name} - Response received #{@response.body.size} bytes" unless quiet?
|
653
661
|
end
|
654
662
|
result = generate_new_object(ignore_root: ignore_root, ignore_xml_root: @method[:options][:ignore_xml_root])
|
655
663
|
# TODO: Cleanup when ignore_xml_root is removed
|
@@ -934,7 +942,7 @@ module Flexirest
|
|
934
942
|
end
|
935
943
|
|
936
944
|
class HTTPException < RequestException
|
937
|
-
attr_accessor :status, :result, :request_url, :body
|
945
|
+
attr_accessor :status, :result, :request_url, :body
|
938
946
|
def initialize(options)
|
939
947
|
@status = options[:status]
|
940
948
|
@result = options[:result]
|
@@ -942,7 +950,7 @@ module Flexirest
|
|
942
950
|
@body = options[:raw_response]
|
943
951
|
@method = options[:method]
|
944
952
|
end
|
945
|
-
alias_method :
|
953
|
+
alias_method :raw_response, :body
|
946
954
|
|
947
955
|
def message
|
948
956
|
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
|
@@ -209,7 +209,7 @@ describe Flexirest::Configuration do
|
|
209
209
|
end
|
210
210
|
end
|
211
211
|
|
212
|
-
it "should default to non-verbose
|
212
|
+
it "should default to non-verbose logging" do
|
213
213
|
class VerboseConfigurationExample1
|
214
214
|
include Flexirest::Configuration
|
215
215
|
end
|
@@ -229,6 +229,26 @@ describe Flexirest::Configuration do
|
|
229
229
|
expect(VerboseConfigurationExample3.verbose).to be_truthy
|
230
230
|
end
|
231
231
|
|
232
|
+
it "should default to non-quiet logging" do
|
233
|
+
class QuietConfigurationExample1
|
234
|
+
include Flexirest::Configuration
|
235
|
+
end
|
236
|
+
expect(QuietConfigurationExample1.quiet).to be_falsey
|
237
|
+
end
|
238
|
+
|
239
|
+
it "should be able to switch on quiet logging" do
|
240
|
+
class QuietConfigurationExample2
|
241
|
+
include Flexirest::Configuration
|
242
|
+
quiet!
|
243
|
+
end
|
244
|
+
class QuietConfigurationExample3
|
245
|
+
include Flexirest::Configuration
|
246
|
+
quiet true
|
247
|
+
end
|
248
|
+
expect(QuietConfigurationExample2.quiet).to be_truthy
|
249
|
+
expect(QuietConfigurationExample3.quiet).to be_truthy
|
250
|
+
end
|
251
|
+
|
232
252
|
it "should store a translator given" do
|
233
253
|
expect{ ConfigurationExample.send(:translator) }.to_not raise_error
|
234
254
|
ConfigurationExample.send(:translator, String.new)
|
data/spec/lib/connection_spec.rb
CHANGED
@@ -14,7 +14,7 @@ describe Flexirest::Instrumentation do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should call ActiveSupport::Notifications.instrument when making any request" do
|
17
|
-
expect(ActiveSupport::Notifications).to receive(:instrument).with("request_call.flexirest", {:name=>"InstrumentationExampleClient#fake"})
|
17
|
+
expect(ActiveSupport::Notifications).to receive(:instrument).with("request_call.flexirest", {:name=>"InstrumentationExampleClient#fake", :quiet=>false})
|
18
18
|
InstrumentationExampleClient.fake
|
19
19
|
end
|
20
20
|
|
data/spec/lib/json_api_spec.rb
CHANGED
@@ -332,7 +332,7 @@ describe 'JSON API' do
|
|
332
332
|
end
|
333
333
|
|
334
334
|
it 'should raise the relevant Flexirest error' do
|
335
|
-
expect
|
335
|
+
expect { make_request }.to raise_error(Flexirest::HTTPNotFoundClientException) do |exception|
|
336
336
|
expect(exception.result.first.detail).to eq("The record identified by 123456 could not be found")
|
337
337
|
end
|
338
338
|
end
|
@@ -349,7 +349,7 @@ describe 'JSON API' do
|
|
349
349
|
end
|
350
350
|
|
351
351
|
it 'should ignore the "data" key and raise the relevant Flexirest error' do
|
352
|
-
expect
|
352
|
+
expect { make_request }.to raise_error(Flexirest::HTTPNotFoundClientException) do |exception|
|
353
353
|
expect(exception.result.first.detail).to eq("The record identified by 123456 could not be found")
|
354
354
|
end
|
355
355
|
end
|
@@ -464,7 +464,7 @@ describe 'JSON API' do
|
|
464
464
|
end
|
465
465
|
|
466
466
|
it 'should raise exception when an association in the response is not defined in base class' do
|
467
|
-
expect
|
467
|
+
expect { subject.includes(:tags).not_recognized_assoc(1) }.to raise_error(Exception)
|
468
468
|
end
|
469
469
|
end
|
470
470
|
|
@@ -528,7 +528,7 @@ describe 'JSON API' do
|
|
528
528
|
article = JsonAPIExample::Article.new
|
529
529
|
article.item = 'item one'
|
530
530
|
article.tags = [tag, author]
|
531
|
-
expect
|
531
|
+
expect { article.create }.to raise_error(Exception)
|
532
532
|
end
|
533
533
|
|
534
534
|
it 'should perform a patch request in proper json api format' do
|
data/spec/lib/request_spec.rb
CHANGED
@@ -188,6 +188,13 @@ describe Flexirest::Request do
|
|
188
188
|
post :create, "/create"
|
189
189
|
end
|
190
190
|
|
191
|
+
class QuietExampleClient < ExampleClient
|
192
|
+
base_url "http://www.example.com"
|
193
|
+
quiet!
|
194
|
+
get :all, "/all"
|
195
|
+
post :create, "/create"
|
196
|
+
end
|
197
|
+
|
191
198
|
class CallbackBodyExampleClient < ExampleClient
|
192
199
|
base_url "http://www.example.com"
|
193
200
|
before_request do |name, request|
|
@@ -385,11 +392,14 @@ describe Flexirest::Request do
|
|
385
392
|
|
386
393
|
it "should use the URL method for Basic auth when basic_auth_method is set to :url (and not include Authorization header)" do
|
387
394
|
mocked_response = ::FaradayResponseMock.new(OpenStruct.new(body:'{"result":true}', response_headers:{}))
|
388
|
-
headers_not_including_auth = hash_excluding("Authorization")
|
389
395
|
|
390
396
|
connection = double(Flexirest::Connection).as_null_object
|
391
397
|
expect(Flexirest::ConnectionManager).to receive(:get_connection).with("http://john:smith@www.example.com").and_return(connection)
|
392
|
-
expect(connection).to receive(:get)
|
398
|
+
expect(connection).to receive(:get) do |path, options|
|
399
|
+
expect(path).to eq("/")
|
400
|
+
expect(options[:headers]).to eq({"Accept"=>"application/hal+json, application/json;q=0.5", "Content-Type"=>"application/x-www-form-urlencoded; charset=utf-8"})
|
401
|
+
end.and_return(mocked_response)
|
402
|
+
|
393
403
|
AuthenticatedBasicUrlExampleClient.all
|
394
404
|
end
|
395
405
|
|
@@ -532,7 +542,7 @@ describe Flexirest::Request do
|
|
532
542
|
expect(ret).to be_truthy
|
533
543
|
end
|
534
544
|
|
535
|
-
it "should handle a
|
545
|
+
it "should handle a 200 response with an empty body and not erase the instance's attributes" do
|
536
546
|
expect_any_instance_of(Flexirest::Connection).to receive(:put).and_return(::FaradayResponseMock.new(OpenStruct.new(body: "", response_headers: {}, status: 200)))
|
537
547
|
client = ExampleClient.new
|
538
548
|
client.id = "1234"
|
@@ -1120,6 +1130,16 @@ describe Flexirest::Request do
|
|
1120
1130
|
VerboseExampleClient.all
|
1121
1131
|
end
|
1122
1132
|
|
1133
|
+
it "should not log if quiet" do
|
1134
|
+
connection = double(Flexirest::Connection).as_null_object
|
1135
|
+
expect(Flexirest::ConnectionManager).to receive(:get_connection).and_return(connection)
|
1136
|
+
expect(connection).to receive(:get).with("/all", an_instance_of(Hash)).and_return(::FaradayResponseMock.new(OpenStruct.new(body:'{"result":true}', response_headers:{"Content-Type" => "application/json", "Connection" => "close"})))
|
1137
|
+
expect(Flexirest::Logger).to_not receive(:debug)
|
1138
|
+
expect(Flexirest::Logger).to_not receive(:info)
|
1139
|
+
expect(Flexirest::Logger).to_not receive(:error)
|
1140
|
+
QuietExampleClient.all
|
1141
|
+
end
|
1142
|
+
|
1123
1143
|
it "should return the headers still for 202 responses" do
|
1124
1144
|
fake_location = "https://foo.example.com/123"
|
1125
1145
|
expect_any_instance_of(Flexirest::Connection).
|
data/spec/spec_helper.rb
CHANGED
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.12
|
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-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -280,7 +280,6 @@ files:
|
|
280
280
|
- docs/body-types.md
|
281
281
|
- docs/caching.md
|
282
282
|
- docs/combined-example.md
|
283
|
-
- docs/debugging.md
|
284
283
|
- docs/default-parameters.md
|
285
284
|
- docs/empty-body-handling.md
|
286
285
|
- docs/faking-calls.md
|
@@ -291,6 +290,7 @@ files:
|
|
291
290
|
- docs/issue_template.md
|
292
291
|
- docs/json-api.md
|
293
292
|
- docs/lazy-loading.md
|
293
|
+
- docs/logging.md
|
294
294
|
- docs/migrating-from-activerestclient.md
|
295
295
|
- docs/parallel-requests.md
|
296
296
|
- docs/per-request-parameter-encoding.md
|
@@ -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
|