sinatra-rest-base 1.0.2 → 1.0.3

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
  SHA1:
3
- metadata.gz: 5e4c051e044943fb538e806a31e6330b75b89fc8
4
- data.tar.gz: a6af540e82d2a48a635e4d45c882efd9c33053fe
3
+ metadata.gz: 75d50b09e35bd0c09b5384a9f6c053e8b8b7c22d
4
+ data.tar.gz: 76e0bcb886023c0e11e1bb0a362d13cc5862f566
5
5
  SHA512:
6
- metadata.gz: 838b719f9a9f5d39a07d160249e2207cbe6156f72b5ac03a6a254c197e135e52e2cf207b6b232185fc141e25776ecc90fd876f274f8a3f4468118d47fee4bb3e
7
- data.tar.gz: e511cf7ac1853a6cc368be5ec05226976f72561ea59933be66a1701c0deccbaf832d3d84e16772a2a9257917eebb89d2c66eea9ce55411f24543a27959ba1277
6
+ metadata.gz: 12e058363080135672533f3bfe0d74034d67adca7993bba787c45d8201cdabf8983d0e8ab85e784071803a865df1f93463059e581ae0e4109971229828b92b0e
7
+ data.tar.gz: 74f257be8746f15e4b43105c87def2243afc46f056055c3d984c3964fd37211d9c079801a639d97e4d48142c444ef0416b9b95358400b986ebe4fde1c229da31
@@ -7,6 +7,7 @@ module RestBase
7
7
  end
8
8
 
9
9
  def has_version?(version)
10
+ return true unless settings.header_versioning
10
11
  @env['HTTP_ACCEPT'] = "*/*" if @env['HTTP_ACCEPT'].nil?
11
12
  @env['HTTP_ACCEPT'].include?(version)
12
13
  end
@@ -57,7 +58,7 @@ module RestBase
57
58
 
58
59
  response_hash = { }
59
60
  response_hash[:errors] = error_hash unless error_hash.nil? || error_hash.empty?
60
- response_hash[:result] = response.body unless response.body.nil?
61
+ response_hash[:result] = response.body unless response.body.nil? || response.body.empty?
61
62
  response_hash[:forensics] = @forensics if add_forensics_to_response? && !(@forensics.nil? || @forensics.empty?)
62
63
 
63
64
  return '' if empty_body_status_code? && (response.body.empty?)
@@ -1,3 +1,3 @@
1
1
  module RestBase
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-rest-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - bmills