stoplight 2.1.0 → 2.1.1
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 +4 -4
- data/README.md +0 -3
- data/lib/stoplight/data_store/redis.rb +1 -1
- data/lib/stoplight/failure.rb +6 -3
- data/lib/stoplight/version.rb +1 -1
- data/spec/stoplight/failure_spec.rb +10 -0
- metadata +20 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b437a495ce48094d005d041a4cb8b9650f00980a
|
4
|
+
data.tar.gz: d800f7a86abc22e555a268e196724f57cf9324f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 016ae8d5369b6014df8e912f1268d179721ac29c0cc924c9568266c5f4b38ee052b622550dbe7bed46688f17af44b305a1dfc165889a02eec45ed533c34a435b
|
7
|
+
data.tar.gz: c413ef054fa34bbad236c5c734e55103e4a519b893b13c7b67e29ae9ca95cd8e7b850ed2f4019cda21f53e83e82d4417b048fe6108edd23fddc9e2a603420c59
|
data/README.md
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
[![Version badge][]][version]
|
4
4
|
[![Build badge][]][build]
|
5
5
|
[![Coverage badge][]][coverage]
|
6
|
-
[![Grade badge][]][grade]
|
7
6
|
[![Climate badge][]][climate]
|
8
7
|
[![Dependencies badge][]][dependencies]
|
9
8
|
|
@@ -477,8 +476,6 @@ Stoplight is licensed under [the MIT License][].
|
|
477
476
|
[build]: https://travis-ci.org/orgsync/stoplight
|
478
477
|
[Coverage badge]: https://img.shields.io/coveralls/orgsync/stoplight/master.svg?label=coverage
|
479
478
|
[coverage]: https://coveralls.io/r/orgsync/stoplight
|
480
|
-
[Grade badge]: https://img.shields.io/badge/grade-A-brightgreen.svg
|
481
|
-
[grade]: http://www.libgrader.com/libraries/ruby/stoplight
|
482
479
|
[Climate badge]: https://img.shields.io/codeclimate/github/orgsync/stoplight.svg?label=climate
|
483
480
|
[climate]: https://codeclimate.com/github/orgsync/stoplight
|
484
481
|
[Dependencies badge]: https://img.shields.io/gemnasium/orgsync/stoplight.svg?label=dependencies
|
data/lib/stoplight/failure.rb
CHANGED
@@ -5,6 +5,8 @@ require 'time'
|
|
5
5
|
|
6
6
|
module Stoplight
|
7
7
|
class Failure # rubocop:disable Style/Documentation
|
8
|
+
TIME_FORMAT = '%Y-%m-%dT%H:%M:%S.%N%:z'.freeze
|
9
|
+
|
8
10
|
# @return [String]
|
9
11
|
attr_reader :error_class
|
10
12
|
# @return [String]
|
@@ -24,9 +26,10 @@ module Stoplight
|
|
24
26
|
# @raise [ArgumentError]
|
25
27
|
def self.from_json(json)
|
26
28
|
object = JSON.parse(json)
|
29
|
+
error_object = object['error']
|
27
30
|
|
28
|
-
error_class =
|
29
|
-
error_message =
|
31
|
+
error_class = error_object['class']
|
32
|
+
error_message = error_object['message']
|
30
33
|
time = Time.parse(object['time'])
|
31
34
|
|
32
35
|
new(error_class, error_message, time)
|
@@ -56,7 +59,7 @@ module Stoplight
|
|
56
59
|
class: error_class,
|
57
60
|
message: error_message
|
58
61
|
},
|
59
|
-
time: time.strftime(
|
62
|
+
time: time.strftime(TIME_FORMAT)
|
60
63
|
)
|
61
64
|
end
|
62
65
|
end
|
data/lib/stoplight/version.rb
CHANGED
@@ -90,4 +90,14 @@ RSpec.describe Stoplight::Failure do
|
|
90
90
|
.to eql(json)
|
91
91
|
end
|
92
92
|
end
|
93
|
+
|
94
|
+
describe '::TIME_FORMAT' do
|
95
|
+
it 'is a string' do
|
96
|
+
expect(described_class::TIME_FORMAT).to be_a(String)
|
97
|
+
end
|
98
|
+
|
99
|
+
it 'is frozen' do
|
100
|
+
expect(described_class::TIME_FORMAT).to be_frozen
|
101
|
+
end
|
102
|
+
end
|
93
103
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stoplight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Desautels
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2018-04-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: concurrent-ruby
|
@@ -287,32 +287,32 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
287
287
|
version: '0'
|
288
288
|
requirements: []
|
289
289
|
rubyforge_project:
|
290
|
-
rubygems_version: 2.
|
290
|
+
rubygems_version: 2.5.2
|
291
291
|
signing_key:
|
292
292
|
specification_version: 4
|
293
293
|
summary: Traffic control for code.
|
294
294
|
test_files:
|
295
295
|
- spec/spec_helper.rb
|
296
|
-
- spec/
|
297
|
-
- spec/stoplight/data_store/base_spec.rb
|
298
|
-
- spec/stoplight/data_store/memory_spec.rb
|
299
|
-
- spec/stoplight/data_store/redis_spec.rb
|
300
|
-
- spec/stoplight/data_store_spec.rb
|
301
|
-
- spec/stoplight/default_spec.rb
|
296
|
+
- spec/stoplight_spec.rb
|
302
297
|
- spec/stoplight/error_spec.rb
|
303
298
|
- spec/stoplight/failure_spec.rb
|
304
|
-
- spec/stoplight/
|
305
|
-
- spec/stoplight/light_spec.rb
|
306
|
-
- spec/stoplight/notifier/base_spec.rb
|
307
|
-
- spec/stoplight/notifier/bugsnag_spec.rb
|
308
|
-
- spec/stoplight/notifier/generic_spec.rb
|
309
|
-
- spec/stoplight/notifier/hip_chat_spec.rb
|
310
|
-
- spec/stoplight/notifier/honeybadger_spec.rb
|
299
|
+
- spec/stoplight/notifier/raven_spec.rb
|
311
300
|
- spec/stoplight/notifier/io_spec.rb
|
312
301
|
- spec/stoplight/notifier/logger_spec.rb
|
313
|
-
- spec/stoplight/notifier/
|
302
|
+
- spec/stoplight/notifier/honeybadger_spec.rb
|
303
|
+
- spec/stoplight/notifier/generic_spec.rb
|
314
304
|
- spec/stoplight/notifier/slack_spec.rb
|
315
|
-
- spec/stoplight/
|
316
|
-
- spec/stoplight/
|
305
|
+
- spec/stoplight/notifier/base_spec.rb
|
306
|
+
- spec/stoplight/notifier/bugsnag_spec.rb
|
307
|
+
- spec/stoplight/notifier/hip_chat_spec.rb
|
317
308
|
- spec/stoplight/version_spec.rb
|
318
|
-
- spec/
|
309
|
+
- spec/stoplight/state_spec.rb
|
310
|
+
- spec/stoplight/notifier_spec.rb
|
311
|
+
- spec/stoplight/color_spec.rb
|
312
|
+
- spec/stoplight/default_spec.rb
|
313
|
+
- spec/stoplight/data_store_spec.rb
|
314
|
+
- spec/stoplight/data_store/memory_spec.rb
|
315
|
+
- spec/stoplight/data_store/redis_spec.rb
|
316
|
+
- spec/stoplight/data_store/base_spec.rb
|
317
|
+
- spec/stoplight/light/runnable_spec.rb
|
318
|
+
- spec/stoplight/light_spec.rb
|