counterman 0.0.1 → 0.0.2

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/counterman.gemspec +1 -1
  3. data/lib/counterman.rb +1 -13
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54385171cb60d92865307932d22b25e205eb06a0
4
- data.tar.gz: 8e67a8f47b43988d73bfcc79fa777a66ae1c7534
3
+ metadata.gz: b15f287c962b9008501e517ed42562727bae1a87
4
+ data.tar.gz: a40596670152e2525b3a20697dfae93ede01b512
5
5
  SHA512:
6
- metadata.gz: c83b01b5c2e9c581f8cdfbcd112af488bbb735cee79c53fa6785506eca3af975b86a0b30ce08d079886ca29103af583da87617c9f90029c3b333dc64d32e0dc4
7
- data.tar.gz: 704364f2fcc14088612000bb4de09caba7ffcaac6cf86931b92be969a8c12aba940416b645f692c17fbbefc7804de28638b4d85066034298504d931ed4cbfe8e
6
+ metadata.gz: 692ffa84d67351fb0b1dc5e627f65c13f4be6b0982c815664df12c4df7a99c40726cf8651a2bea1fa6889135f3ff121fdd25d67369b01a13720bee08bdf35b61
7
+ data.tar.gz: 64a98da2c5c39af89f93e2900eb16892ef3fd402fe7f64e5b29cce7469d86ec4ac19d1e081d7afff82d1bb4ea471364c9e7b94f9f78fa8f3b84b376d54f98321
data/counterman.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "counterman"
3
- s.version = "0.0.1"
3
+ s.version = "0.0.2"
4
4
  s.summary = "Counter Analytics"
5
5
  s.description = "Fast and furious tracking system using Redis hash operations"
6
6
  s.authors = ["maccman"]
data/lib/counterman.rb CHANGED
@@ -31,24 +31,12 @@ class Counterman
31
31
  def initialize(options = {})
32
32
 
33
33
  self.options = default_options.merge!(options)
34
+ self.redis = options[:redis] || Redis.new
34
35
 
35
36
  spans = self.options.fetch(:time_spans, %w[year month week day hour minute])
36
37
  @time_spans = generate_spans(spans)
37
38
  end
38
39
 
39
- # Public: Lazily Instantiate and memoize the Redis connection
40
- #
41
- def redis
42
- @redis ||= case options[:redis]
43
- when nil
44
- Redis.new
45
- when Hash
46
- Redis.new options[:redis]
47
- else
48
- options[:redis]
49
- end
50
- end
51
-
52
40
 
53
41
  # Public: Marks an id to a given event on a given time
54
42
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: counterman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - maccman