breakers 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: 6eab277573c135bff307496a5ff60036e8e2d7e6
4
- data.tar.gz: c1dfd133b1a41f3d9d6f10aede8cdce0265c43e2
3
+ metadata.gz: 35c7aacf61c91cf32f46b61946acb6f80d0b00fc
4
+ data.tar.gz: 4d62beb0e55e286b22ae035f2ac3a8f390a271fd
5
5
  SHA512:
6
- metadata.gz: 869a21c2cd1296d8e98ae7f13dd80352f31af945491e8afc6f2d694c8d057873879c05933551035b2f071902b2a08b7164d2107b7a671507ce1831ec9dc9e098
7
- data.tar.gz: 093725a48e5e68c0172cd5cfcfe9e1eb8ddff596501a26a055d27f322a1cba6db77c42296a55e7e309cbcc348414645fec630ea0d975e076c850f20d07047942
6
+ metadata.gz: 2cc042397050ea304a6632a7f758e9fe2f3efdabc48843759366f6f953a50762ecd432be06846d211b2e537b7e283730772f021febc866d85447166e32444323
7
+ data.tar.gz: 9358d0bbf12c1b5b378ecaa2b94584e775887e746958ef0405d176daf5a207ba780a108428ab7f49c6fa92eebe6174e90ad6668004b085de0b473fc4a6f90c77
@@ -25,6 +25,20 @@ module Breakers
25
25
  @client
26
26
  end
27
27
 
28
+ # Set a flag that can globally disable breakers
29
+ #
30
+ # @param value [Boolean] should breakers do its thing globally
31
+ def self.disabled=(value)
32
+ @disabled = value
33
+ end
34
+
35
+ # Return the status of global disabling
36
+ #
37
+ # @return [Boolean] is breakers disabled globally
38
+ def self.disabled?
39
+ defined?(@disabled) && @disabled == true
40
+ end
41
+
28
42
  # Breakers uses a number of Redis keys to store its data. You can pass an optional
29
43
  # prefix here to use for the keys so that they will be namespaced properly. Note that
30
44
  # it's also possible to create the Breakers::Client object with a Redis::Namespace
@@ -9,6 +9,10 @@ module Breakers
9
9
  end
10
10
 
11
11
  def call(request_env)
12
+ if Breakers.disabled?
13
+ return @app.call(request_env)
14
+ end
15
+
12
16
  service = Breakers.client.service_for_request(request_env: request_env)
13
17
 
14
18
  if !service
@@ -1,3 +1,3 @@
1
1
  module Breakers
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: breakers
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
  - Aubrey Holland
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-19 00:00:00.000000000 Z
11
+ date: 2016-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday