counterman 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +23 -0
- data/README.md +0 -1
- data/counterman.gemspec +2 -2
- data/lib/counterman/hash_operations.rb +16 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52dcde8aa400fc53ffc9dd3f6a37f99b5ded626a
|
4
|
+
data.tar.gz: 37d4707c25f4f77a3ad92c63d389975e98c9dcf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21d689cc468f9e2f468930216a5dc86e4cb8a3b1647527f2f0efb8091006ca2a968ef96a0cf91a9294f1b079ddff178d9927ce3614ad7e505c1cbe86ad32de83
|
7
|
+
data.tar.gz: 0650937451143cdbf73b0ed690be2d9687ebce584f91ea9cc1b9769ab5770d4ea2e6103e6e948956078520895c005171a042e4ab27e7aa9e0828fc3fae37b518
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
Copyright (c) 2014 Alex MacCaw
|
2
|
+
Copyright (c) 2012 Bruno Aguirre
|
3
|
+
|
4
|
+
MIT License
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
7
|
+
a copy of this software and associated documentation files (the
|
8
|
+
"Software"), to deal in the Software without restriction, including
|
9
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
10
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
11
|
+
permit persons to whom the Software is furnished to do so, subject to
|
12
|
+
the following conditions:
|
13
|
+
|
14
|
+
The above copyright notice and this permission notice shall be
|
15
|
+
included in all copies or substantial portions of the Software.
|
16
|
+
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
18
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
19
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
20
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
21
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
22
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
23
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
|
data/counterman.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "counterman"
|
3
|
-
s.version = "0.0.
|
3
|
+
s.version = "0.0.3"
|
4
4
|
s.summary = "Counter Analytics"
|
5
5
|
s.description = "Fast and furious tracking system using Redis hash operations"
|
6
|
-
s.authors = ["maccman"]
|
6
|
+
s.authors = ["maccman", "elcuervo"]
|
7
7
|
s.licenses = ["MIT"]
|
8
8
|
s.email = ["info@eribium.org"]
|
9
9
|
s.homepage = "http://github.com/maccman/counterman"
|
@@ -7,5 +7,21 @@ class Counterman
|
|
7
7
|
def count(id)
|
8
8
|
safe { redis.hget(key, id).to_i }
|
9
9
|
end
|
10
|
+
|
11
|
+
def count_all(ids)
|
12
|
+
redis.pipelined do
|
13
|
+
ids.each do |id|
|
14
|
+
redis.hget(key, id)
|
15
|
+
end
|
16
|
+
end.map(&:to_i)
|
17
|
+
end
|
18
|
+
|
19
|
+
def all_counts
|
20
|
+
counts = redis.hgetall(key)
|
21
|
+
counts.inject({}) do |hash, (k,v)|
|
22
|
+
hash[k.to_i] = v.to_i
|
23
|
+
hash
|
24
|
+
end
|
25
|
+
end
|
10
26
|
end
|
11
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: counterman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- maccman
|
8
|
+
- elcuervo
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2014-
|
12
|
+
date: 2014-09-10 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: redis
|
@@ -77,6 +78,7 @@ files:
|
|
77
78
|
- ".travis.yml"
|
78
79
|
- Gemfile
|
79
80
|
- Gemfile.lock
|
81
|
+
- LICENSE.txt
|
80
82
|
- README.md
|
81
83
|
- Rakefile
|
82
84
|
- counterman.gemspec
|