stoplight 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stoplight/failure.rb +9 -5
- data/lib/stoplight/version.rb +1 -1
- data/spec/stoplight/failure_spec.rb +5 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e26d25f913bb759dccd62f2b12576cbe51550753c3c6428fb16cdb6052559928
|
4
|
+
data.tar.gz: 6cbfd0ccd62da40cb335e671c8ba2d84348652e206520355fa651eb2276e16ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a186fc199cd54411996a65c369c687dc1165ecb2115699c72e6aa005f1b3d5b0da3b5f90402d2c49b12d73ca708628b09f5b9ba02e57c127ce89a33f8dc16cd2
|
7
|
+
data.tar.gz: 7ee5b81cad78ed7aaa7200aedf74cba3af8aff5b1e95940c572ca93bbefa28676ceb507ef04ce63bef28d9b6e7dcb2590653dd06704cf14b561653662c9fa30b
|
data/lib/stoplight/failure.rb
CHANGED
@@ -52,14 +52,18 @@ module Stoplight
|
|
52
52
|
time == other.time
|
53
53
|
end
|
54
54
|
|
55
|
+
# @param options [Object, nil]
|
55
56
|
# @return [String]
|
56
|
-
def to_json
|
57
|
+
def to_json(options = nil)
|
57
58
|
JSON.generate(
|
58
|
-
|
59
|
-
|
60
|
-
|
59
|
+
{
|
60
|
+
error: {
|
61
|
+
class: error_class,
|
62
|
+
message: error_message
|
63
|
+
},
|
64
|
+
time: time.strftime(TIME_FORMAT)
|
61
65
|
},
|
62
|
-
|
66
|
+
options
|
63
67
|
)
|
64
68
|
end
|
65
69
|
end
|
data/lib/stoplight/version.rb
CHANGED
@@ -89,6 +89,11 @@ RSpec.describe Stoplight::Failure do
|
|
89
89
|
expect(described_class.new(error_class, error_message, time).to_json)
|
90
90
|
.to eql(json)
|
91
91
|
end
|
92
|
+
|
93
|
+
it 'generates JSON with options' do
|
94
|
+
expect(described_class.new(error_class, error_message, time).to_json({}))
|
95
|
+
.to eql(json)
|
96
|
+
end
|
92
97
|
end
|
93
98
|
|
94
99
|
describe '::TIME_FORMAT' do
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stoplight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Desautels
|
8
8
|
- Taylor Fausak
|
9
9
|
- Justin Steffy
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-07-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: benchmark-ips
|
@@ -275,7 +275,7 @@ homepage: https://github.com/orgsync/stoplight
|
|
275
275
|
licenses:
|
276
276
|
- MIT
|
277
277
|
metadata: {}
|
278
|
-
post_install_message:
|
278
|
+
post_install_message:
|
279
279
|
rdoc_options: []
|
280
280
|
require_paths:
|
281
281
|
- lib
|
@@ -290,8 +290,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
290
290
|
- !ruby/object:Gem::Version
|
291
291
|
version: '0'
|
292
292
|
requirements: []
|
293
|
-
rubygems_version: 3.
|
294
|
-
signing_key:
|
293
|
+
rubygems_version: 3.1.2
|
294
|
+
signing_key:
|
295
295
|
specification_version: 4
|
296
296
|
summary: Traffic control for code.
|
297
297
|
test_files:
|