jsender 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/jsender/json.rb +2 -4
- data/lib/jsender/rack.rb +2 -2
- data/lib/jsender/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d75b90bfce8adb0939e083bab54e86bcdb1eff66ef2f85ba05ce3bcc3ed7e1c5
|
4
|
+
data.tar.gz: 8486e4e03baa69f5f5b15b2f78da1766210147fd391b7047995f047f4e47cf36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fe75bab3185bb22859bce17bf04aef99999f92096d104beabb179050a00fd90dc8f7277a7db70045f49593aa5a188ed2296d30163f9b98fef38f9e74149cfa8
|
7
|
+
data.tar.gz: f6781d02443b8968bc1fb36ec52526353e86591b6ea90ffdab9922b5b1d935879515d0e1d9942244d76bef56541620c055692ea037c79fc90be15fdf422117c6
|
data/lib/jsender/json.rb
CHANGED
@@ -11,12 +11,10 @@ module Jsender
|
|
11
11
|
}.to_json
|
12
12
|
end
|
13
13
|
|
14
|
-
def failure(message: "A failure has occurred")
|
14
|
+
def failure(message: "A failure has occurred", data: nil)
|
15
15
|
{
|
16
16
|
'status' => 'fail',
|
17
|
-
'data' => {
|
18
|
-
'message' => message
|
19
|
-
}
|
17
|
+
'data' => data || { 'message' => message }
|
20
18
|
}.to_json
|
21
19
|
end
|
22
20
|
|
data/lib/jsender/rack.rb
CHANGED
@@ -10,11 +10,11 @@ module Jsender
|
|
10
10
|
]
|
11
11
|
end
|
12
12
|
|
13
|
-
def failure(code: 400, flow_id: nil, message: "A failure has occurred", body_as_array: false)
|
13
|
+
def failure(code: 400, flow_id: nil, message: "A failure has occurred", data: nil, body_as_array: false)
|
14
14
|
[
|
15
15
|
code,
|
16
16
|
headers(flow_id: flow_id),
|
17
|
-
body(data: Jsender::Json.failure(message: message), body_as_array: body_as_array)
|
17
|
+
body(data: Jsender::Json.failure(message: message, data: data), body_as_array: body_as_array)
|
18
18
|
]
|
19
19
|
end
|
20
20
|
|
data/lib/jsender/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsender
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hetzner Seals Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
124
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.6
|
125
|
+
rubygems_version: 2.7.6
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: JSender facilitates a simple jsend implementation for ruby
|