stoplight-admin 0.2.3 → 0.2.4
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 +1 -1
- data/lib/sinatra/stoplight_admin.rb +12 -16
- data/stoplight-admin.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bb02fe7651f5652d9327f2718b6f05c6ebc8b01
|
4
|
+
data.tar.gz: e45454e40b2c0fe3bf74c4a2063adeb545a5e72f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7a314d8646ae6b6e7c2485f1080fb41cf917096df87bdf2a3ae324507596274ab9724968a1ea4e2dd03133781706df72b67014f5008eebe0f9a3a517b932c4e
|
7
|
+
data.tar.gz: ae06de52f512dadd77bddb035a1ff3b94e8a689af8ad191ae2dfb9d86f26e59afc4cdc15eabf63b0803014529b694c82ef52f96c23d965dc1a8e2ab3467b153e
|
data/README.md
CHANGED
@@ -20,17 +20,13 @@ module Sinatra
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def light_info(light)
|
23
|
-
green = Stoplight.green?(light)
|
24
|
-
attempts = green ? 0 : data_store.
|
25
|
-
failures = green ? [] : data_store.
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
'error' => f,
|
31
|
-
'time' => 'unknown time'
|
32
|
-
}
|
33
|
-
end
|
23
|
+
green = Stoplight.data_store.green?(light)
|
24
|
+
attempts = green ? 0 : data_store.get_attempts(light)
|
25
|
+
failures = green ? [] : data_store.get_failures(light).map do |f|
|
26
|
+
{
|
27
|
+
'error' => f.error.inspect,
|
28
|
+
'time' => f.time.to_s
|
29
|
+
}
|
34
30
|
end
|
35
31
|
|
36
32
|
{
|
@@ -51,7 +47,7 @@ module Sinatra
|
|
51
47
|
def locked?(light_name)
|
52
48
|
[Stoplight::DataStore::STATE_LOCKED_GREEN,
|
53
49
|
Stoplight::DataStore::STATE_LOCKED_RED]
|
54
|
-
.include?(data_store.
|
50
|
+
.include?(data_store.get_state(light_name))
|
55
51
|
end
|
56
52
|
|
57
53
|
def stat_params(ls)
|
@@ -76,7 +72,7 @@ module Sinatra
|
|
76
72
|
|
77
73
|
def lock(light)
|
78
74
|
new_state =
|
79
|
-
if Stoplight.green?(light)
|
75
|
+
if Stoplight.data_store.green?(light)
|
80
76
|
Stoplight::DataStore::STATE_LOCKED_GREEN
|
81
77
|
else
|
82
78
|
Stoplight::DataStore::STATE_LOCKED_RED
|
@@ -90,7 +86,7 @@ module Sinatra
|
|
90
86
|
end
|
91
87
|
|
92
88
|
def green(light)
|
93
|
-
if data_store.
|
89
|
+
if data_store.get_state(light) == Stoplight::DataStore::STATE_LOCKED_RED
|
94
90
|
new_state = Stoplight::DataStore::STATE_LOCKED_GREEN
|
95
91
|
data_store.set_state(light, new_state)
|
96
92
|
end
|
@@ -104,7 +100,7 @@ module Sinatra
|
|
104
100
|
end
|
105
101
|
|
106
102
|
def purge
|
107
|
-
data_store.
|
103
|
+
data_store.clear_stale
|
108
104
|
end
|
109
105
|
|
110
106
|
def with_lights
|
@@ -149,7 +145,7 @@ module Sinatra
|
|
149
145
|
|
150
146
|
app.post '/green_all' do
|
151
147
|
data_store.names
|
152
|
-
.reject { |l| Stoplight.green?(l) }
|
148
|
+
.reject { |l| Stoplight.data_store.green?(l) }
|
153
149
|
.each { |l| green(l) }
|
154
150
|
redirect to('/')
|
155
151
|
end
|
data/stoplight-admin.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'stoplight-admin'
|
5
|
-
spec.version = '0.2.
|
5
|
+
spec.version = '0.2.4'
|
6
6
|
spec.authors = ['Cameron Desautels', 'Taylor Fausak']
|
7
7
|
spec.email = %w(camdez@gmail.com taylor@fausak.me)
|
8
8
|
spec.summary = %q{A simple administration interface for the stoplight gem.}
|
@@ -21,5 +21,5 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency 'haml', '~> 4.0.4'
|
22
22
|
spec.add_dependency 'redis', '~> 3.1.0'
|
23
23
|
spec.add_dependency 'sinatra', '~> 1.4.5'
|
24
|
-
spec.add_dependency 'stoplight', '~> 0.
|
24
|
+
spec.add_dependency 'stoplight', '~> 0.3.0'
|
25
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stoplight-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Desautels
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-09-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -87,14 +87,14 @@ dependencies:
|
|
87
87
|
requirements:
|
88
88
|
- - ~>
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: 0.
|
90
|
+
version: 0.3.0
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - ~>
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: 0.
|
97
|
+
version: 0.3.0
|
98
98
|
description: A simple administration interface for the stoplight gem.
|
99
99
|
email:
|
100
100
|
- camdez@gmail.com
|