stoplight-admin 0.2.0 → 0.2.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 +1 -1
- data/lib/sinatra/stoplight_admin.rb +10 -4
- data/stoplight-admin.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 944587e0c8997010343182749c29cc46b2319f02
|
4
|
+
data.tar.gz: 7ccc70e70f24087052b8e0e85420b6bfeb3cb508
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c69a0da21be4865804e20aa81cf17196ff3929fe2d97c07d92683bbf1229ee889646af1786a663dc01ded615f35754ef2d1389b8fb91282df4d6ef23b54db7bf
|
7
|
+
data.tar.gz: ffa74510eec93b8004a3baccc808368f1df7187cb59304d982d8b335bdc8b3c1542360072f5a490694eb89ac287d08358e4ff611a2f43bacced99eab3eec230e
|
data/README.md
CHANGED
@@ -99,6 +99,12 @@ module Sinatra
|
|
99
99
|
def purge
|
100
100
|
data_store.purge
|
101
101
|
end
|
102
|
+
|
103
|
+
def with_lights
|
104
|
+
[*params[:names]]
|
105
|
+
.map { |l| URI.unescape(l) }
|
106
|
+
.each { |l| yield(l) }
|
107
|
+
end
|
102
108
|
end
|
103
109
|
|
104
110
|
def self.registered(app)
|
@@ -115,22 +121,22 @@ module Sinatra
|
|
115
121
|
end
|
116
122
|
|
117
123
|
app.post '/lock' do
|
118
|
-
|
124
|
+
with_lights { |l| lock(l) }
|
119
125
|
redirect to('/')
|
120
126
|
end
|
121
127
|
|
122
128
|
app.post '/unlock' do
|
123
|
-
|
129
|
+
with_lights { |l| unlock(l) }
|
124
130
|
redirect to('/')
|
125
131
|
end
|
126
132
|
|
127
133
|
app.post '/green' do
|
128
|
-
|
134
|
+
with_lights { |l| green(l) }
|
129
135
|
redirect to('/')
|
130
136
|
end
|
131
137
|
|
132
138
|
app.post '/red' do
|
133
|
-
|
139
|
+
with_lights { |l| red(l) }
|
134
140
|
redirect to('/')
|
135
141
|
end
|
136
142
|
|
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.1'
|
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.}
|