redlics 0.1.5 → 0.1.6
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 +4 -4
- data/lib/redlics/counter.rb +3 -6
- data/lib/redlics/tracker.rb +1 -1
- data/lib/redlics/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 724a34a6d432d7dced851a903f0af979f157c7cd
|
4
|
+
data.tar.gz: 94ec00b7a62ee7a1d6a87d934fb604b84388b93b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e67674ebcd341d698a475a3a04730f1d00a0f911a7108e6e268074927676ec2d869b8f9ec5998204f3e060e07c510afb7e876d8a81f4018f2adeaf9d629330cf
|
7
|
+
data.tar.gz: b105b0e91e2459388d1c21ace343f95b34ac61e15712d32fae33455733029b29bf60496994a13827a812045379b11f97c10ab3ee12922c13427ee22cfa80605c
|
data/lib/redlics/counter.rb
CHANGED
@@ -55,10 +55,7 @@ module Redlics
|
|
55
55
|
# @return [Array] list of counted granularities
|
56
56
|
def count_with_args(*args)
|
57
57
|
options = args.last.instance_of?(Hash) ? args.pop : {}
|
58
|
-
options.merge!(
|
59
|
-
event: args[0],
|
60
|
-
id: args[1]
|
61
|
-
})
|
58
|
+
options.merge!(event: args[0])
|
62
59
|
count_with_hash(options)
|
63
60
|
end
|
64
61
|
|
@@ -72,7 +69,7 @@ module Redlics
|
|
72
69
|
key = Key.name(CONTEXT, options[:event], granularity, options[:past], { id: options[:id], bucketized: true })
|
73
70
|
Redlics.redis.pipelined do |redis|
|
74
71
|
redis.hincrby(key[0], key[1], 1)
|
75
|
-
redis.expire(key[0], options[:expiration_for] && options[:expiration_for][granularity] || Redlics.config.counter_expirations[granularity])
|
72
|
+
redis.expire(key[0], (options[:expiration_for] && options[:expiration_for][granularity] || Redlics.config.counter_expirations[granularity]).to_i)
|
76
73
|
end
|
77
74
|
end
|
78
75
|
|
@@ -86,7 +83,7 @@ module Redlics
|
|
86
83
|
key = Key.name(CONTEXT, options[:event], granularity, options[:past], { id: options[:id], bucketized: false })
|
87
84
|
Redlics.redis.pipelined do |redis|
|
88
85
|
redis.incr(key)
|
89
|
-
redis.expire(key, options[:expiration_for] && options[:expiration_for][granularity] || Redlics.config.counter_expirations[granularity])
|
86
|
+
redis.expire(key, (options[:expiration_for] && options[:expiration_for][granularity] || Redlics.config.counter_expirations[granularity]).to_i)
|
90
87
|
end
|
91
88
|
end
|
92
89
|
|
data/lib/redlics/tracker.rb
CHANGED
@@ -31,7 +31,7 @@ module Redlics
|
|
31
31
|
key = Key.name(CONTEXT, options[:event], granularity, options[:past])
|
32
32
|
Redlics.redis.pipelined do |redis|
|
33
33
|
redis.setbit(key, options[:id].to_i, 1)
|
34
|
-
redis.expire(key, options[:expiration_for] && options[:expiration_for][granularity] || Redlics.config.tracker_expirations[granularity])
|
34
|
+
redis.expire(key, (options[:expiration_for] && options[:expiration_for][granularity] || Redlics.config.tracker_expirations[granularity]).to_i)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
data/lib/redlics/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redlics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Egon Zemmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|