flexirest 1.3.30 → 1.3.31

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f486c610e559403248c73cd363d61cef2cc6189
4
- data.tar.gz: 4c9dbe026c0ca6a04957882f88cd06ffb530b294
3
+ metadata.gz: fcf49e613a33a734a49d4e4c363e34dd7dda7621
4
+ data.tar.gz: 15be49cb1ebeed32f1930c2b63798523de0323e3
5
5
  SHA512:
6
- metadata.gz: 515563435824f29cd71526ba447b5eaa5c8408d44cddef0690cf71354d8e4b2c99841cef905095879f5cb707b5fa31a7b2014904180bad3f2fa272029405d6d4
7
- data.tar.gz: 306bb5c6193a912a0404895b090385617a9c16644a2c371ce0b0febc27512e75ff64828277a55d15a4fa2055bdad43b82472b65c44c675171d9a419385af6ea0
6
+ metadata.gz: 2029a279a42b2c222736e5e7ad81ef13a74f043ba003bb02335e065bd2924853d386413ee2bc48ad8bc9fc81d41bcba5546c03c10d6a443d6e1082bd6eeb46b6
7
+ data.tar.gz: ec66f6352df44de47c8420cfcbfa323cc42807ff3f89893dfca94de84f4f1074f0ceb75d8234ffa087986b381fd45ef4b32868f0fea80ea46b634438c7391916
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.31
4
+
5
+ Bugfix:
6
+
7
+ - Working with later versions of Faraday where the response seems to have lost response_headers
8
+
3
9
  ## 1.3.30
4
10
 
5
11
  Bugfix:
@@ -195,7 +195,7 @@ module Flexirest
195
195
  if verbose?
196
196
  Flexirest::Logger.debug " Response"
197
197
  Flexirest::Logger.debug " << Status : #{response_env.status}"
198
- response_env.response_headers.each do |k,v|
198
+ (response_env.response_headers || response_env.try(:response).try(:headers)).each do |k,v|
199
199
  Flexirest::Logger.debug " << #{k} : #{v}"
200
200
  end
201
201
  Flexirest::Logger.debug " << Body:\n#{response_env.body}"
@@ -500,8 +500,8 @@ module Flexirest
500
500
  end
501
501
 
502
502
  def hal_response?
503
- _, content_type = @response.response_headers.detect{|k,v| k.downcase == "content-type"}
504
- faked_response = @response.response_headers.detect{|k,v| k.downcase == "x-arc-faked-response"}
503
+ _, content_type = (@response.response_headers || @response.try(:response).try(:headers)).detect{|k,v| k.downcase == "content-type"}
504
+ faked_response = (@response.response_headers || @response.try(:response).try(:headers)).detect{|k,v| k.downcase == "x-arc-faked-response"}
505
505
  if content_type && content_type.respond_to?(:each)
506
506
  content_type.each do |ct|
507
507
  return true if ct[%r{application\/hal\+json}i]
@@ -561,11 +561,13 @@ module Flexirest
561
561
  end
562
562
 
563
563
  def is_json_response?
564
- @response.response_headers['Content-Type'].nil? || @response.response_headers['Content-Type'].include?('json')
564
+ headers = (@response.response_headers || @response.try(:response).try(:headers))
565
+ headers['Content-Type'].nil? || headers['Content-Type'].include?('json')
565
566
  end
566
567
 
567
568
  def is_xml_response?
568
- @response.response_headers['Content-Type'].include?('xml')
569
+ headers = (@response.response_headers || @response.try(:response).try(:headers))
570
+ headers['Content-Type'].include?('xml')
569
571
  end
570
572
 
571
573
  def generate_new_object(options={})
@@ -605,8 +607,8 @@ module Flexirest
605
607
  else
606
608
  result = new_object(body, @overridden_name)
607
609
  result._status = @response.status
608
- result._headers = @response.response_headers
609
- result._etag = @response.response_headers['ETag']
610
+ result._headers = (@response.response_headers || @response.try(:response).try(:headers))
611
+ result._etag = result._headers['ETag']
610
612
  if !object_is_class? && options[:mutable] != false
611
613
  @object._copy_from(result)
612
614
  @object._clean!
@@ -1,3 +1,3 @@
1
1
  module Flexirest
2
- VERSION = "1.3.30"
2
+ VERSION = "1.3.31"
3
3
  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.3.30
4
+ version: 1.3.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-22 00:00:00.000000000 Z
11
+ date: 2017-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
298
298
  version: '0'
299
299
  requirements: []
300
300
  rubyforge_project:
301
- rubygems_version: 2.5.1
301
+ rubygems_version: 2.5.2
302
302
  signing_key:
303
303
  specification_version: 4
304
304
  summary: This gem is for accessing REST services in a flexible way. ActiveResource