prop 0.6.2 → 0.6.3

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.
Files changed (5) hide show
  1. data/VERSION +1 -1
  2. data/lib/prop.rb +1 -0
  3. data/prop.gemspec +1 -1
  4. data/test/test_prop.rb +16 -0
  5. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.2
1
+ 0.6.3
data/lib/prop.rb CHANGED
@@ -84,6 +84,7 @@ class Prop
84
84
 
85
85
  reader.call(cache_key).to_i
86
86
  end
87
+ alias :count :query
87
88
 
88
89
  private
89
90
 
data/prop.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{prop}
8
- s.version = "0.6.2"
8
+ s.version = "0.6.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Morten Primdahl"]
data/test/test_prop.rb CHANGED
@@ -94,6 +94,22 @@ class TestProp < Test::Unit::TestCase
94
94
  end
95
95
  end
96
96
 
97
+ context "#query" do
98
+ setup do
99
+ Prop.configure(:hello, :threshold => 20, :interval => 20)
100
+ Prop.throttle!(:hello)
101
+ Prop.throttle!(:hello)
102
+ end
103
+
104
+ should "be aliased by #count" do
105
+ assert_equal Prop.count(:hello), 2
106
+ end
107
+
108
+ should "return the number of hits on a throttle" do
109
+ assert_equal Prop.query(:hello), 2
110
+ end
111
+ end
112
+
97
113
  context "#throttle!" do
98
114
  should "increment counter correctly" do
99
115
  3.times do |i|
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prop
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 2
10
- version: 0.6.2
9
+ - 3
10
+ version: 0.6.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Morten Primdahl