counterman 0.0.2 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b15f287c962b9008501e517ed42562727bae1a87
4
- data.tar.gz: a40596670152e2525b3a20697dfae93ede01b512
3
+ metadata.gz: 52dcde8aa400fc53ffc9dd3f6a37f99b5ded626a
4
+ data.tar.gz: 37d4707c25f4f77a3ad92c63d389975e98c9dcf0
5
5
  SHA512:
6
- metadata.gz: 692ffa84d67351fb0b1dc5e627f65c13f4be6b0982c815664df12c4df7a99c40726cf8651a2bea1fa6889135f3ff121fdd25d67369b01a13720bee08bdf35b61
7
- data.tar.gz: 64a98da2c5c39af89f93e2900eb16892ef3fd402fe7f64e5b29cce7469d86ec4ac19d1e081d7afff82d1bb4ea471364c9e7b94f9f78fa8f3b84b376d54f98321
6
+ metadata.gz: 21d689cc468f9e2f468930216a5dc86e4cb8a3b1647527f2f0efb8091006ca2a968ef96a0cf91a9294f1b079ddff178d9927ce3614ad7e505c1cbe86ad32de83
7
+ data.tar.gz: 0650937451143cdbf73b0ed690be2d9687ebce584f91ea9cc1b9769ab5770d4ea2e6103e6e948956078520895c005171a042e4ab27e7aa9e0828fc3fae37b518
@@ -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
-
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "counterman"
3
- s.version = "0.0.2"
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.2
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-06-16 00:00:00.000000000 Z
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