stoplight 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/lib/stoplight/light/runnable.rb +2 -2
- data/spec/stoplight/light/runnable_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9619bee3f557017bc7b877349a5a2b5985e535ce
|
4
|
+
data.tar.gz: 5dec1f7bce5d8373cea3747e8dc587e0795e19c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f12b3bbf04f13f74c91ef78c3c85909a720e15003808609bb9d06e5886643a52d17a83e37263e1dc10666dd286f8e3fdb2784652b553b35eafc47f920368d76
|
7
|
+
data.tar.gz: 4437c4f2618ac10732bdccd600699590780d1d162d8f6523206115a283d0d616e389a58fbe7ea56c07010f087768ed9918fbd2f092177e9944ea33fc6b142bc0
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
This project uses [Semantic Versioning][1].
|
4
4
|
|
5
|
+
## v0.5.1 (2014-11-19)
|
6
|
+
|
7
|
+
- Fixed a logic bug that incorrectly determined red lights to be yellow.
|
8
|
+
|
9
|
+
## v0.5.0 (2014-11-19)
|
10
|
+
|
5
11
|
- Data stores and notifiers can be configured on a per-stoplight basis. This
|
6
12
|
allows stoplights to use stoplights internally.
|
7
13
|
- Stoplights use stoplights internally to wrap calls to data stores and
|
data/README.md
CHANGED
@@ -5,13 +5,13 @@ module Stoplight
|
|
5
5
|
module Runnable
|
6
6
|
def color
|
7
7
|
failures, state = failures_and_state
|
8
|
-
|
8
|
+
failure = failures.first
|
9
9
|
|
10
10
|
case
|
11
11
|
when state == State::LOCKED_GREEN then Color::GREEN
|
12
12
|
when state == State::LOCKED_RED then Color::RED
|
13
13
|
when failures.size < threshold then Color::GREEN
|
14
|
-
when
|
14
|
+
when failure && Time.new - failure.time >= timeout then Color::YELLOW
|
15
15
|
else Color::RED
|
16
16
|
end
|
17
17
|
end
|
@@ -58,6 +58,16 @@ describe Stoplight::Light::Runnable do
|
|
58
58
|
subject.data_store.record_failure(subject, other)
|
59
59
|
expect(subject.color).to eql(Stoplight::Color::YELLOW)
|
60
60
|
end
|
61
|
+
|
62
|
+
it 'is red when the least recent failure is old' do
|
63
|
+
other = Stoplight::Failure.new(
|
64
|
+
error.class.name, error.message, Time.new - subject.timeout)
|
65
|
+
subject.data_store.record_failure(subject, other)
|
66
|
+
(subject.threshold - 1).times do
|
67
|
+
subject.data_store.record_failure(subject, failure)
|
68
|
+
end
|
69
|
+
expect(subject.color).to eql(Stoplight::Color::RED)
|
70
|
+
end
|
61
71
|
end
|
62
72
|
|
63
73
|
describe '#run' do
|
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: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Desautels
|
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
218
|
version: '0'
|
219
219
|
requirements: []
|
220
220
|
rubyforge_project:
|
221
|
-
rubygems_version: 2.4.
|
221
|
+
rubygems_version: 2.4.4
|
222
222
|
signing_key:
|
223
223
|
specification_version: 4
|
224
224
|
summary: Traffic control for code.
|