circuit_breaker 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +4 -0
- data/README.txt +2 -2
- data/circuit_breaker.gemspec +1 -1
- data/lib/circuit_breaker.rb +2 -1
- data/lib/circuit_breaker/version.rb +1 -1
- data/spec/circuit_breaker_spec.rb +11 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6aaf55f3e5b83c95308b3b37e3715dbacd1a7e24
|
4
|
+
data.tar.gz: f7651dd2b0415cd9ea025771bd9952d72d326455
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f90794b36378e369f60c643efab52618ba6aa9a65a5c5cba3d2d013d760fe8bab92731b1d2f314a6b877ee87bc91769e0d6218a5c5de532ddc74494fadb0a65e
|
7
|
+
data.tar.gz: 9be58ff32012fa17b86720182e9aaa1cab4dc583c113dc1f19bb878a198999ec576c99c532c225a4c1c8a3fffc98ddc8dbcc09d0a9a628fd01a9c01966c3d9bb
|
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -67,11 +67,11 @@
|
|
67
67
|
|
68
68
|
== INSTALL:
|
69
69
|
|
70
|
-
* gem install
|
70
|
+
* gem install circuit_breaker
|
71
71
|
|
72
72
|
== LICENSE:
|
73
73
|
|
74
|
-
Copyright (c)
|
74
|
+
Copyright (c) 2016, Will Sargent
|
75
75
|
All rights reserved.
|
76
76
|
|
77
77
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
|
data/circuit_breaker.gemspec
CHANGED
data/lib/circuit_breaker.rb
CHANGED
@@ -44,7 +44,7 @@
|
|
44
44
|
#
|
45
45
|
# end
|
46
46
|
#
|
47
|
-
# Copyright
|
47
|
+
# Copyright 2016 Will Sargent
|
48
48
|
# Author: Will Sargent <will.sargent@gmail.com>
|
49
49
|
# Many thanks to Devin Mullins
|
50
50
|
#
|
@@ -77,6 +77,7 @@ module CircuitBreaker
|
|
77
77
|
|
78
78
|
methods.each do |meth|
|
79
79
|
m = instance_method meth
|
80
|
+
undef_method(meth) if method_defined?(meth)
|
80
81
|
define_method meth do |*args|
|
81
82
|
circuit_handler.handle self.circuit_state, m.bind(self), *args
|
82
83
|
end
|
@@ -75,6 +75,17 @@ describe CircuitBreaker do
|
|
75
75
|
@test_object.circuit_state.failure_count.should == 1
|
76
76
|
end
|
77
77
|
|
78
|
+
it 'should not raise warning about method redefined' do
|
79
|
+
orig_stderr = $stderr
|
80
|
+
$stderr = StringIO.new
|
81
|
+
|
82
|
+
TestClass.circuit_method :second_method
|
83
|
+
|
84
|
+
$stderr.rewind
|
85
|
+
$stderr.string.chomp.should_not match(/warning: previous definition of second_method was here/)
|
86
|
+
$stderr = orig_stderr
|
87
|
+
end
|
88
|
+
|
78
89
|
describe "when closed" do
|
79
90
|
|
80
91
|
it "should execute without failing" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: circuit_breaker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Will Sargent
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aasm
|
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
134
|
version: '0'
|
135
135
|
requirements: []
|
136
136
|
rubyforge_project: will_sargent
|
137
|
-
rubygems_version: 2.
|
137
|
+
rubygems_version: 2.2.2
|
138
138
|
signing_key:
|
139
139
|
specification_version: 4
|
140
140
|
summary: CircuitBreaker is a relatively simple Ruby mixin that will wrap a call to
|