footrest 0.5.3 → 0.5.6

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
- SHA1:
3
- metadata.gz: d90cd2fe4ddde8e1985ec60f1f1447ca0a702884
4
- data.tar.gz: 913f2e63743580ebdc0f4222b09bde60969acb13
2
+ SHA256:
3
+ metadata.gz: 40372fba249c8a24b3e6198a6926d935030fd191686884f9d357ad33af35306b
4
+ data.tar.gz: 60914c80b6bb3e30c853207dec563551463b8c9cf707a9ad36a752f547e3f7c6
5
5
  SHA512:
6
- metadata.gz: f9c31d958fb219775ee972ced3515faa054e6563617a89da529a29ec04b061bcbae9d04e1fc3290971559a165f8de74d87a215d901ee584300246501360fa329
7
- data.tar.gz: 3b73c2b03292cd5cae4af34a1e75982a459eaf5126f3063b109386d196729e8d348c47aedaf29e563d31c41fb45d63bb8c4966a12d7c2dbc32d8cd45932c2d80
6
+ metadata.gz: '0578c75a4542254954a50420c637b93148c9c2a8c42c9c2cecbd2ca7640b390205cddf4783a9e6caecb9be0784ab7e9d002f2617fcf18b41a1a11f1aa61a920b'
7
+ data.tar.gz: ff0192a555472cba9afba3181581b1db8c81e355a72a8d359336e8fd2bbbe3fab3ad6b3c1ccdc803b844af68026ddc90b8e31d526406ae203849b37181c73698
@@ -34,7 +34,8 @@ module Footrest
34
34
  end
35
35
 
36
36
  def errors
37
- JSON::pretty_generate(JSON::parse(@body)["errors"])
37
+ parsed_body = JSON::parse(@body)
38
+ JSON::pretty_generate(parsed_body["errors"] || parsed_body)
38
39
  rescue
39
40
  @body
40
41
  end
@@ -10,8 +10,8 @@ module Footrest
10
10
  end
11
11
 
12
12
  # Store a Proc that receives the body and returns the parsed result.
13
- def self.define_parser(parser = nil)
14
- @parser = parser || Proc.new
13
+ def self.define_parser(parser = nil, &block)
14
+ @parser = parser || block
15
15
  end
16
16
 
17
17
  def self.inherited(subclass)
@@ -1,3 +1,3 @@
1
1
  module Footrest
2
- VERSION = '0.5.3' unless defined?(Footrest::VERSION)
2
+ VERSION = '0.5.6' unless defined?(Footrest::VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: footrest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Duane Johnson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-07-05 00:00:00.000000000 Z
12
+ date: 2024-04-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -187,14 +187,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  - !ruby/object:Gem::Version
188
188
  version: '0'
189
189
  requirements: []
190
- rubyforge_project:
191
- rubygems_version: 2.6.13
190
+ rubygems_version: 3.1.6
192
191
  signing_key:
193
192
  specification_version: 4
194
193
  summary: REST APIs
195
194
  test_files:
196
- - spec/footrest/client_spec.rb
197
195
  - spec/footrest/http_error_spec.rb
198
- - spec/footrest/pagination_spec.rb
196
+ - spec/footrest/client_spec.rb
199
197
  - spec/footrest/request_spec.rb
198
+ - spec/footrest/pagination_spec.rb
200
199
  - spec/spec_helper.rb