stoplight-admin 0.1.1 → 0.2.0

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: fc75f3964699a81674cbfb5377897a0e9a67b6a6
4
- data.tar.gz: b9bcd80f86b64f8c3909c28fd79efd0149cd9d7a
3
+ metadata.gz: c8de483523582e4f5420376eebc393789ab80ad5
4
+ data.tar.gz: 94cbdc63059d7bcbacc572c01e9306d0344da004
5
5
  SHA512:
6
- metadata.gz: 23f3504f213fe6990c9074db979d73a3928b87605b789a00e812a6921159287038f8106233a985b51641fc8b706f63f991473d9b7c87bdf4de112c10206c80fd
7
- data.tar.gz: 205dc3bb8e9218d7a9b08c34249e2060de2682d4f0021e2f59d5f9d39c87f162f087a8375bc6b8d19699ced0db53b911b8a1204da841d2128fc70e07e823f49b
6
+ metadata.gz: 652f770e26f68d41a378883f35d46a1db16e4c3294d4391fee89073e26d52331c613f7a363bc2eb46b11549963cf30eea9a0ef34816ab978448a64170f627a08
7
+ data.tar.gz: 8ed8e6dc5273690fbda2a05a6c6feae57cd44efe91bbaadda677ebdda05d79d8054cf943693d35158fa7e2776cfb3393444787aba05c8ad64412d9f5ff7f5bb8
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.1.0'
21
+ gem 'stoplight-admin', '~> 0.2.0'
22
22
  ```
23
23
 
24
24
  Run [Bundler][3] to install the dependencies:
@@ -33,12 +33,12 @@ example using a local Redis data store:
33
33
  ``` rb
34
34
  # app.rb
35
35
 
36
+ require 'redis'
36
37
  require 'sinatra'
37
38
  require 'sinatra/stoplight_admin'
38
39
 
39
- REDIS_URL = 'redis://localhost:6379'
40
- set :data_store, Stoplight::DataStore::Redis.new(url: REDIS_URL)
41
-
40
+ redis = Redis.new(url: 'redis://localhost:6379')
41
+ set :data_store, Stoplight::DataStore::Redis.new(redis)
42
42
  ```
43
43
 
44
44
  ## Usage
@@ -9,9 +9,7 @@ module Sinatra
9
9
  module Helpers
10
10
  def data_store
11
11
  return @data_store if defined?(@data_store)
12
-
13
- Stoplight.data_store settings.data_store
14
- @data_store = Stoplight.data_store
12
+ @data_store = Stoplight.data_store = settings.data_store
15
13
  end
16
14
 
17
15
  def lights
@@ -97,6 +95,10 @@ module Sinatra
97
95
  def red(light)
98
96
  data_store.set_state(light, Stoplight::DataStore::STATE_LOCKED_RED)
99
97
  end
98
+
99
+ def purge
100
+ data_store.purge
101
+ end
100
102
  end
101
103
 
102
104
  def self.registered(app)
@@ -138,6 +140,11 @@ module Sinatra
138
140
  .each { |l| green(l) }
139
141
  redirect to('/')
140
142
  end
143
+
144
+ app.post '/purge' do
145
+ purge
146
+ redirect to('/')
147
+ end
141
148
  end
142
149
  end
143
150
 
@@ -7,6 +7,8 @@
7
7
  .btn-group
8
8
  %form{method: 'post', action: '/green_all'}
9
9
  %button.btn-lg.btn.btn-success{type: 'submit', disabled: failure_count > 0 ? nil : 'disabled'} Greenify All
10
+ %form{method: 'post', action: '/purge'}
11
+ %button.btn-lg.btn.btn-default{type: 'submit'} Purge Lights
10
12
 
11
13
  .progress
12
14
  .progress-bar.progress-bar-danger{style: "width: #{failure_percentage}%"}
@@ -40,6 +40,10 @@
40
40
  list-style-type: none;
41
41
  }
42
42
 
43
+ .btn-group form {
44
+ display: inline-block;
45
+ }
46
+
43
47
  %body
44
48
  .navbar.navbar-inverse.navbar-fixed-top{role: 'navigation'}
45
49
  .container
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'stoplight-admin'
5
- spec.version = '0.1.1'
5
+ spec.version = '0.2.0'
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.1.0'
24
+ spec.add_dependency 'stoplight', '~> 0.2.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.1.1
4
+ version: 0.2.0
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-08-15 00:00:00.000000000 Z
12
+ date: 2014-08-18 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.1.0
90
+ version: 0.2.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.1.0
97
+ version: 0.2.0
98
98
  description: A simple administration interface for the stoplight gem.
99
99
  email:
100
100
  - camdez@gmail.com