stoplight-admin 0.2.0 → 0.2.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: c8de483523582e4f5420376eebc393789ab80ad5
4
- data.tar.gz: 94cbdc63059d7bcbacc572c01e9306d0344da004
3
+ metadata.gz: 944587e0c8997010343182749c29cc46b2319f02
4
+ data.tar.gz: 7ccc70e70f24087052b8e0e85420b6bfeb3cb508
5
5
  SHA512:
6
- metadata.gz: 652f770e26f68d41a378883f35d46a1db16e4c3294d4391fee89073e26d52331c613f7a363bc2eb46b11549963cf30eea9a0ef34816ab978448a64170f627a08
7
- data.tar.gz: 8ed8e6dc5273690fbda2a05a6c6feae57cd44efe91bbaadda677ebdda05d79d8054cf943693d35158fa7e2776cfb3393444787aba05c8ad64412d9f5ff7f5bb8
6
+ metadata.gz: c69a0da21be4865804e20aa81cf17196ff3929fe2d97c07d92683bbf1229ee889646af1786a663dc01ded615f35754ef2d1389b8fb91282df4d6ef23b54db7bf
7
+ data.tar.gz: ffa74510eec93b8004a3baccc808368f1df7187cb59304d982d8b335bdc8b3c1542360072f5a490694eb89ac287d08358e4ff611a2f43bacced99eab3eec230e
data/README.md CHANGED
@@ -18,7 +18,7 @@ First you'll need a `Gemfile`:
18
18
  ``` rb
19
19
  source 'https://rubygems.org'
20
20
 
21
- gem 'stoplight-admin', '~> 0.2.0'
21
+ gem 'stoplight-admin', '~> 0.2.1'
22
22
  ```
23
23
 
24
24
  Run [Bundler][3] to install the dependencies:
@@ -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
- [*params[:names]].each { |l| lock(l) }
124
+ with_lights { |l| lock(l) }
119
125
  redirect to('/')
120
126
  end
121
127
 
122
128
  app.post '/unlock' do
123
- [*params[:names]].each { |l| unlock(l) }
129
+ with_lights { |l| unlock(l) }
124
130
  redirect to('/')
125
131
  end
126
132
 
127
133
  app.post '/green' do
128
- [*params[:names]].each { |l| green(l) }
134
+ with_lights { |l| green(l) }
129
135
  redirect to('/')
130
136
  end
131
137
 
132
138
  app.post '/red' do
133
- [*params[:names]].each { |l| red(l) }
139
+ with_lights { |l| red(l) }
134
140
  redirect to('/')
135
141
  end
136
142
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'stoplight-admin'
5
- spec.version = '0.2.0'
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.}
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.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Desautels