sinatra-rest-base 1.0.4 → 1.0.5

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: 24af1cf8be8da4b7423bf9e76473d2848e365f65
4
- data.tar.gz: aba24043540d4645d0af30268dda2b57df333af9
3
+ metadata.gz: ff6f4161b7d5522f0eb184d73b71293be4b5d30c
4
+ data.tar.gz: 447ad644655c050702ff3cdd63c5aa42d9bf6264
5
5
  SHA512:
6
- metadata.gz: 23e50403fb3aceec1bac42a754e9c7a313634c5c81ced7ce9c7d4a1cdbebc47dbb55b58da2221a47bbfea91ebb4e573a30d3399bd9b38fa4bfd02eea72018b2f
7
- data.tar.gz: 2bd4bb2135d2deaa0ba284529235d3e7e330b833bd27e7c01f52d361b9e5cffcbb4dde9bd8f3e9cccd5a7db586a3cf577e8adf2200a646e610127e0a9a429c95
6
+ metadata.gz: c846f4ed62acf44a8cd0830f828e23e7b2dec06eb0b69b44d2e2667d2d8f45344791edfff60b3f511b70c6a8350fce594998b1590275aa38e6e4adb3f5d58753
7
+ data.tar.gz: 985c2c0dc8638a77c59588b63ca6ef71751d4d14be684cee5b7077effbbac546df73d465852119f0dcd233e92a41b1070d39e1fc9c5bb478600119e2484f4c17
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/sinatra-rest-base.svg)](http://badge.fury.io/rb/sinatra-rest-base)
4
4
 
5
+ [![sinatra-rest-base API Documentation](https://www.omniref.com/ruby/gems/sinatra-rest-base.png)](https://www.omniref.com/ruby/gems/sinatra-rest-base)
6
+
5
7
  Core base for quick configuration of Sinatra for RESTful Services
6
8
 
7
9
  #### What Does the Core Cover
@@ -44,16 +46,16 @@ Normal Sinatra Appication inherit from either Sinatra::Application or Sinatra::B
44
46
  In your main application file, do the following:
45
47
 
46
48
  ```
47
- require 'rest'
49
+ require 'rest_base'
48
50
 
49
- class SinatraApp < Rest::Application
51
+ class SinatraApp < RestBase::Application
50
52
  end
51
53
  ```
52
54
 
53
55
  then in any other partial class file of the main application file, you just have to name the class like follow:
54
56
 
55
57
  ```
56
- require 'rest'
58
+ require 'rest_base'
57
59
 
58
60
  class SinatraApp
59
61
 
@@ -55,7 +55,7 @@ module RestBase
55
55
 
56
56
  if (response.status >= 400)
57
57
  error_hash = response.body
58
- error_hash = [error_hash] if error_hash.is_a?(String)
58
+ error_hash = [error_hash] unless error_hash.is_a?(Array)
59
59
 
60
60
  response.body = nil
61
61
  end
@@ -1,3 +1,3 @@
1
1
  module RestBase
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
@@ -20,7 +20,7 @@ describe RestBase::Application do
20
20
  end
21
21
 
22
22
  it "should create a hashed error response based on the body" do
23
- @expected_body[:errors] = { :error => "This is the hashed error handler" }
23
+ @expected_body[:errors] = [{ :error => "This is the hashed error handler" }]
24
24
 
25
25
  get '/hashed_error_handeling', {}, @headers
26
26
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-rest-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - bmills
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-04 00:00:00.000000000 Z
11
+ date: 2015-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json