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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d54b8d2efe09a714ff7297af5afe424b569460ba
4
- data.tar.gz: 2200fa05c6037642b3230290968326d35ea34ae7
2
+ SHA256:
3
+ metadata.gz: d75b90bfce8adb0939e083bab54e86bcdb1eff66ef2f85ba05ce3bcc3ed7e1c5
4
+ data.tar.gz: 8486e4e03baa69f5f5b15b2f78da1766210147fd391b7047995f047f4e47cf36
5
5
  SHA512:
6
- metadata.gz: a12515fd684d1502c917f289a55d65e9fc0dc87f11f13127711fea0f099385059bfc4d5f3f253d166a559086c7c814c125d279fc4f56c2eee8cd792cd6aedd65
7
- data.tar.gz: 4e47367fdc446fc5f3da1063580942b4fe82775e1ba3c32e8f127bc122c5654ddabe66014fa3ab77e4c3c30c6d0014a81ed0f14407dc25ba07a3eda46b0dafe5
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
 
@@ -1,3 +1,3 @@
1
1
  module Jsender
2
- VERSION = "2.0.0"
2
+ VERSION = "2.1.0"
3
3
  end
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.0.0
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-01-18 00:00:00.000000000 Z
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.13
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