stoplight 0.5.2 → 1.0.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: bcc53c7687a3a7fc307685f81463b7a97aec96bd
4
- data.tar.gz: 7fe4bfe9357b1a52ffad84dbba77decbb8875979
3
+ metadata.gz: 99e35ef6375d1da3d14f453873c410bcad7ad4c6
4
+ data.tar.gz: 16d8b5d40dd9f17de105a3df570f5d41cdd997c6
5
5
  SHA512:
6
- metadata.gz: d2461d125e6b721bb12d38eddfa0047e823899febb818f7276006cea9a8da70cef5215efe77b6017b0fe3a3b92c389e0927306b385cdf347a3903d048fed989b
7
- data.tar.gz: bd7939dd6723a2a405865aa756b9cc4d903b00931eff7796d3276ea98aa3d4b139b23809cd726ee3a17b446ca59a976a0095645283386d10ac2e65f1390c5290
6
+ metadata.gz: 24bc5b7cc600179cdd4ef63976d544379574078c33810faf507aaee6e8a37e78c8a28f88d5897ff053f9b8ffc819dd6a5b07ddecb2e97402ffa7deb436b325ac
7
+ data.tar.gz: d3b3339c2ff9c14233ea35035ac96e127894d5455748d9085f7384077bb04d45c7ac31c5f4bd7ed94d21ed876e66f52fda8363bfb5c7464e54b7f5cb18e94082
data/CHANGELOG.md CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  This project uses [Semantic Versioning][1].
4
4
 
5
- ## v0.5.2 (2014-11-19)
5
+ ## v1.0.0 (2015-02-19)
6
+
7
+ - Didn't change anything.
8
+
9
+ ## v0.5.2 (2015-02-13)
6
10
 
7
11
  - Created a convenience function for creating stoplights.
8
12
  - Created a `VERSION` constant.
data/LICENSE.md CHANGED
@@ -1,18 +1,20 @@
1
1
  Copyright (c) 2015 Cameron Desautels, Taylor Fausak & Justin Steffy
2
2
 
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of
4
- this software and associated documentation files (the "Software"), to deal in
5
- the Software without restriction, including without limitation the rights to
6
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7
- the Software, and to permit persons to whom the Software is furnished to do so,
8
- subject to the following conditions:
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject
9
+ to the following conditions:
9
10
 
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
12
13
 
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
18
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
19
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img alt="Stoplight" src="stoplight.png">
2
+ <img alt="Stoplight" src="https://a.pomf.se/wdlzpt.svg">
3
3
  </p>
4
4
 
5
5
  <h1 align="center">
@@ -36,15 +36,15 @@
36
36
  Check out [stoplight-admin][] for controlling your stoplights.
37
37
 
38
38
  - [Installation](#installation)
39
- - [Setup](#setup)
40
- - [Data store](#data-store)
41
- - [Notifiers](#notifiers)
42
- - [Rails](#rails)
43
39
  - [Basic usage](#basic-usage)
44
40
  - [Custom errors](#custom-errors)
45
41
  - [Custom fallback](#custom-fallback)
46
42
  - [Custom threshold](#custom-threshold)
47
43
  - [Custom timeout](#custom-timeout)
44
+ - [Rails](#rails)
45
+ - [Setup](#setup)
46
+ - [Data store](#data-store)
47
+ - [Notifiers](#notifiers)
48
48
  - [Rails](#rails-1)
49
49
  - [Advanced usage](#advanced-usage)
50
50
  - [Locking](#locking)
@@ -55,81 +55,13 @@ Check out [stoplight-admin][] for controlling your stoplights.
55
55
  Add it to your Gemfile:
56
56
 
57
57
  ``` rb
58
- gem 'stoplight', '~> 0.5.2'
58
+ gem 'stoplight', '~> 1.0'
59
59
  ```
60
60
 
61
61
  Or install it manually:
62
62
 
63
63
  ``` sh
64
- $ gem install stoplight --version '~> 0.5.2'
65
- ```
66
-
67
- ## Setup
68
-
69
- ### Data store
70
-
71
- Stoplight uses an in-memory data store out of the box.
72
-
73
- ``` rb
74
- require 'stoplight'
75
- # => true
76
- Stoplight::Light.default_data_store
77
- # => #<Stoplight::DataStore::Memory:...>
78
- ```
79
-
80
- If you want to use a persistent data store, you'll have to set it
81
- up. Currently the only supported persistent data store is Redis.
82
- Make sure you have [the Redis gem][] installed before configuring
83
- Stoplight.
84
-
85
- ``` rb
86
- require 'redis'
87
- # => true
88
- redis = Redis.new
89
- # => #<Redis client ...>
90
- data_store = Stoplight::DataStore::Redis.new(redis)
91
- # => #<Stoplight::DataStore::Redis:...>
92
- Stoplight::Light.default_data_store = data_store
93
- # => #<Stoplight::DataStore::Redis:...>
94
- ```
95
-
96
- ### Notifiers
97
-
98
- Stoplight sends notifications to standard error by default.
99
-
100
- ``` rb
101
- Stoplight::Light.default_notifiers
102
- # => [#<Stoplight::Notifier::IO:...>]
103
- ```
104
-
105
- If you want to send notifications elsewhere, you'll have to set
106
- them up. Currently the only other supported notifier is HipChat.
107
- Make sure you have [the HipChat gem][] installed before configuring
108
- Stoplight.
109
-
110
- ``` rb
111
- require 'hipchat'
112
- # => true
113
- hip_chat = HipChat::Client.new('token')
114
- # => #<HipChat::Client:...>
115
- notifier = Stoplight::Notifier::HipChat.new(hip_chat, 'room')
116
- # => #<Stoplight::Notifier::HipChat:...>
117
- Stoplight::Light.default_notifiers += [notifier]
118
- # => [#<Stoplight::Notifier::IO:...>, #<Stoplight::Notifier::HipChat:...>]
119
- ```
120
-
121
- ### Rails
122
-
123
- Stoplight is designed to work seamlessly with Rails. If you want
124
- to use the in-memory data store, you don't need to do anything
125
- special. If you want to use a persistent data store, you'll need
126
- to configure it. Create an initializer for Stoplight:
127
-
128
- ``` rb
129
- # config/initializers/stoplight.rb
130
- require 'stoplight'
131
- Stoplight::Light.default_data_store = Stoplight::DataStore::Redis.new(...)
132
- Stoplight::Light.default_notifiers += [Stoplight::Notifier::HipChat.new(...)]
64
+ $ gem install stoplight --version '~> 1.0'
133
65
  ```
134
66
 
135
67
  ## Basic usage
@@ -292,6 +224,74 @@ class ApplicationController < ActionController::Base
292
224
  end
293
225
  ```
294
226
 
227
+ ## Setup
228
+
229
+ ### Data store
230
+
231
+ Stoplight uses an in-memory data store out of the box.
232
+
233
+ ``` rb
234
+ require 'stoplight'
235
+ # => true
236
+ Stoplight::Light.default_data_store
237
+ # => #<Stoplight::DataStore::Memory:...>
238
+ ```
239
+
240
+ If you want to use a persistent data store, you'll have to set it
241
+ up. Currently the only supported persistent data store is Redis.
242
+ Make sure you have [the Redis gem][] installed before configuring
243
+ Stoplight.
244
+
245
+ ``` rb
246
+ require 'redis'
247
+ # => true
248
+ redis = Redis.new
249
+ # => #<Redis client ...>
250
+ data_store = Stoplight::DataStore::Redis.new(redis)
251
+ # => #<Stoplight::DataStore::Redis:...>
252
+ Stoplight::Light.default_data_store = data_store
253
+ # => #<Stoplight::DataStore::Redis:...>
254
+ ```
255
+
256
+ ### Notifiers
257
+
258
+ Stoplight sends notifications to standard error by default.
259
+
260
+ ``` rb
261
+ Stoplight::Light.default_notifiers
262
+ # => [#<Stoplight::Notifier::IO:...>]
263
+ ```
264
+
265
+ If you want to send notifications elsewhere, you'll have to set
266
+ them up. Currently the only other supported notifier is HipChat.
267
+ Make sure you have [the HipChat gem][] installed before configuring
268
+ Stoplight.
269
+
270
+ ``` rb
271
+ require 'hipchat'
272
+ # => true
273
+ hip_chat = HipChat::Client.new('token')
274
+ # => #<HipChat::Client:...>
275
+ notifier = Stoplight::Notifier::HipChat.new(hip_chat, 'room')
276
+ # => #<Stoplight::Notifier::HipChat:...>
277
+ Stoplight::Light.default_notifiers += [notifier]
278
+ # => [#<Stoplight::Notifier::IO:...>, #<Stoplight::Notifier::HipChat:...>]
279
+ ```
280
+
281
+ ### Rails
282
+
283
+ Stoplight is designed to work seamlessly with Rails. If you want
284
+ to use the in-memory data store, you don't need to do anything
285
+ special. If you want to use a persistent data store, you'll need
286
+ to configure it. Create an initializer for Stoplight:
287
+
288
+ ``` rb
289
+ # config/initializers/stoplight.rb
290
+ require 'stoplight'
291
+ Stoplight::Light.default_data_store = Stoplight::DataStore::Redis.new(...)
292
+ Stoplight::Light.default_notifiers += [Stoplight::Notifier::HipChat.new(...)]
293
+ ```
294
+
295
295
  ## Advanced usage
296
296
 
297
297
  ### Locking
@@ -322,8 +322,6 @@ Stoplight is brought to you by [@camdez][] and [@tfausak][] from
322
322
  [@OrgSync][]. We were inspired by Martin Fowler's [CircuitBreaker][]
323
323
  article.
324
324
 
325
- Emoji provided free by [Emoji One][].
326
-
327
325
  [stoplight-admin]: https://github.com/orgsync/stoplight-admin
328
326
  [the redis gem]: https://rubygems.org/gems/redis
329
327
  [the hipchat gem]: https://rubygems.org/gems/hipchat
@@ -331,4 +329,3 @@ Emoji provided free by [Emoji One][].
331
329
  [@tfausak]: https://github.com/tfausak
332
330
  [@orgsync]: https://github.com/OrgSync
333
331
  [circuitbreaker]: http://martinfowler.com/bliki/CircuitBreaker.html
334
- [emoji one]: http://www.emojione.com
@@ -1,5 +1,5 @@
1
1
  # coding: utf-8
2
2
 
3
3
  module Stoplight
4
- VERSION = Gem::Version.new('0.5.2')
4
+ VERSION = Gem::Version.new('1.0.0')
5
5
  end
@@ -19,10 +19,6 @@ describe Stoplight::Light::Runnable do
19
19
  let(:error_message) { random_string }
20
20
  let(:time) { Time.new }
21
21
 
22
- def random_number
23
- rand(1_000_000)
24
- end
25
-
26
22
  def random_string
27
23
  ('a'..'z').to_a.shuffle.first(8).join
28
24
  end
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.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Desautels
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-02-13 00:00:00.000000000 Z
13
+ date: 2015-02-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: benchmark-ips
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  version: '0'
221
221
  requirements: []
222
222
  rubyforge_project:
223
- rubygems_version: 2.4.5
223
+ rubygems_version: 2.4.6
224
224
  signing_key:
225
225
  specification_version: 4
226
226
  summary: Traffic control for code.