tally_counter 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/tally_counter/version.rb +1 -1
- data/lib/tally_counter.rb +3 -1
- metadata +5 -5
data/lib/tally_counter.rb
CHANGED
@@ -27,6 +27,8 @@ module TallyCounter
|
|
27
27
|
end
|
28
28
|
|
29
29
|
class KeyGenerate
|
30
|
+
NAME = 'tally_counter'.freeze
|
31
|
+
|
30
32
|
# @param [Integer] a seconds interval for Window use
|
31
33
|
# @param [String] optional app namespace
|
32
34
|
def initialize(interval, namespace = nil)
|
@@ -38,7 +40,7 @@ module TallyCounter
|
|
38
40
|
# @param [Integer] offset for window to step back
|
39
41
|
def for(time, offset = 0)
|
40
42
|
timestamp = @window.floor(time, offset).to_i
|
41
|
-
[@namespace,
|
43
|
+
[@namespace, NAME, timestamp].compact.join(':')
|
42
44
|
end
|
43
45
|
end
|
44
46
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tally_counter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2013-06-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: redis
|
16
|
-
requirement: &
|
16
|
+
requirement: &2168806000 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2168806000
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rack-test
|
27
|
-
requirement: &
|
27
|
+
requirement: &2168805560 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2168805560
|
36
36
|
description: Tally web application hits with Rack & Redis sorted sets
|
37
37
|
email:
|
38
38
|
- xternal1+github@gmail.com
|