allowed 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e4af22af5347dd855c58679dcd9aed1720709ac
4
- data.tar.gz: 97dec94a7a9d9cfa1476f232aa19fcd50548fc18
3
+ metadata.gz: b83e748a4e838b74f0fde18b565a70fc275c5a20
4
+ data.tar.gz: 0d303293277213a9d78846e9b377c64b0ba62dd0
5
5
  SHA512:
6
- metadata.gz: ab767b716ee8ce8d01565f2921e26726b6bec321d0ef4a875fad88c39a48bd43a010a0cb33b2c8df4c158114829b308c90d3f2e8e23b08aa91dd6f7ebdad0710
7
- data.tar.gz: c3b654d80a5c00138b85e8d6a46f95b91a53fb92635ec416aab56c82945a5135ad43b31f7a2de29f275d795171d798535964f6089d0bbd73d304319343c84fb1
6
+ metadata.gz: 000cf8977c79b48d5146937437ed9882217430afb02b254a906b1d442352bf7db89aa1a45d1684831f80e0340665cfac0d295c2ba9c624746fc55275bb11ba03
7
+ data.tar.gz: 0d05ba8f62763fc240f2a11297e333698b8fde2315ce77b1e3c34980440d1815d82fb69fcd24a76667436ec84a03c8a666dd44c42c6e3dcd15d9573700b5e520
data/lib/allowed/limit.rb CHANGED
@@ -26,6 +26,7 @@ module Allowed
26
26
  @_throttle_failures.each do |throttle|
27
27
  throttle.callback.call(self)
28
28
  end
29
+ @_throttle_failures = []
29
30
  end
30
31
  private :handle_throttles
31
32
 
@@ -61,6 +61,12 @@ describe Allowed::Limit, "#handle_throttles" do
61
61
 
62
62
  expect(callback).to have_received(:call).with(subject).once
63
63
  end
64
+
65
+ it "clears the failed throttles" do
66
+ subject.__send__(:handle_throttles)
67
+
68
+ expect(subject.instance_variable_get("@_throttle_failures")).to be_empty
69
+ end
64
70
  end
65
71
 
66
72
  describe Allowed::Limit, "#validate_throttles" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allowed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tristan Dunn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-06 00:00:00.000000000 Z
11
+ date: 2014-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord