stoplight 2.1.0 → 2.1.1

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
2
  SHA1:
3
- metadata.gz: c744702c57c79bb96de6ba01eeb2c4adcc65eadd
4
- data.tar.gz: face2e75b1ac458693f3d160a33d534dd1e0b226
3
+ metadata.gz: b437a495ce48094d005d041a4cb8b9650f00980a
4
+ data.tar.gz: d800f7a86abc22e555a268e196724f57cf9324f0
5
5
  SHA512:
6
- metadata.gz: 258fd3aa57d2f49e4b049d98d83c899f80d47cdbd354436b854b56959aabd0e21f9d34e25fc607dc7d189dcdb8896e5b4cbdb6825f27435d3cd4e40654096179
7
- data.tar.gz: 8369dc5c2f5355ed9936eea5d8999bdfa3965a891dbf62150dc1f748196aa46f87bec0e5201a473f5e72c6c0ef008e3f135cd8170bc5f72c1023784b862a62a7
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
@@ -26,7 +26,7 @@ module Stoplight
26
26
  def get_all(light)
27
27
  failures, state = @redis.multi do
28
28
  query_failures(light)
29
- @redis.hget('stoplight:states', light.name)
29
+ @redis.hget(states_key, light.name)
30
30
  end
31
31
 
32
32
  [
@@ -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 = object['error']['class']
29
- error_message = object['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('%Y-%m-%dT%H:%M:%S.%N%:z')
62
+ time: time.strftime(TIME_FORMAT)
60
63
  )
61
64
  end
62
65
  end
@@ -1,5 +1,5 @@
1
1
  # coding: utf-8
2
2
 
3
3
  module Stoplight
4
- VERSION = Gem::Version.new('2.1.0')
4
+ VERSION = Gem::Version.new('2.1.1')
5
5
  end
@@ -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.0
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: 2016-08-04 00:00:00.000000000 Z
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.6.4
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/stoplight/color_spec.rb
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/light/runnable_spec.rb
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/raven_spec.rb
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/notifier_spec.rb
316
- - spec/stoplight/state_spec.rb
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/stoplight_spec.rb
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