event-counter 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5e4803060e3164a0eaf04624b6d5002c0789dd4
4
- data.tar.gz: 58e249fde274f8d405e6d9d872fbdef6ca799a87
3
+ metadata.gz: 2e96e3d7d0cb196c379e9989606677fde34f1a7b
4
+ data.tar.gz: 84320e90a25619c11d1c3bc033af1c80569adf51
5
5
  SHA512:
6
- metadata.gz: 9002dad388634f8afd70f9c8f57591e32eb1e8ed0ac859daee6b15609e2699c3cc90ee1103e5c15f2a3aa2430a02df6a00bea150f11f21b34e52022e71266120
7
- data.tar.gz: e321c6a69d69f52b1b1b7b53c65fa14865723ed46e037a8ad3e3b4b4ebbf0017577c0d627f1c69d82d403753886dd0a254454ca31c94740196a7789265f6d81d
6
+ metadata.gz: 900c5d1a1575b8202fd92c0f4624b42cb8019e42d46c598d2ed8101db3749909a254b2b21f1cde05a2a510870f36851c5a4877a72c131c4ab7d3e63aaf3632ef
7
+ data.tar.gz: 7d624a8d626091a9af525aa608b9316f56c3e288716d042701b86c0881fdbcea483130f002403a373e6a77b82cfcd72456c281f6c3ddcff500ed65db8650bdcf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # EventCounter Changelog
2
2
 
3
+ 0.3.1 (2014-11-08)
4
+
5
+ * Added default interval to counter definition
6
+
3
7
  0.3.0 (2014-11-08)
4
8
 
5
9
  * counter definition method name changed
data/README.md CHANGED
@@ -10,7 +10,7 @@ Let's define counters in model
10
10
 
11
11
  ```ruby
12
12
  class Article < ActiveRecord::Base
13
- has_counter :views, interval: 5.minutes
13
+ has_counter :views, interval: 5.minutes # default interval is :day
14
14
 
15
15
  # :year, :month, :week and :day symbols are supported
16
16
  has_counter :views_by_week, interval: :week
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- event-counter (0.3.0)
4
+ event-counter (0.3.1)
5
5
  activerecord (>= 3)
6
6
  activesupport (>= 3)
7
7
  pg (~> 0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- event-counter (0.3.0)
4
+ event-counter (0.3.1)
5
5
  activerecord (>= 3)
6
6
  activesupport (>= 3)
7
7
  pg (~> 0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- event-counter (0.3.0)
4
+ event-counter (0.3.1)
5
5
  activerecord (>= 3)
6
6
  activesupport (>= 3)
7
7
  pg (~> 0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- event-counter (0.3.0)
4
+ event-counter (0.3.1)
5
5
  activerecord (>= 3)
6
6
  activesupport (>= 3)
7
7
  pg (~> 0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- event-counter (0.3.0)
4
+ event-counter (0.3.1)
5
5
  activerecord (>= 3)
6
6
  activesupport (>= 3)
7
7
  pg (~> 0)
@@ -10,7 +10,7 @@ class EventCounter < ActiveRecord::Base
10
10
 
11
11
  # :nodoc:
12
12
  module ClassMethods
13
- def has_counter(name, interval)
13
+ def has_counter(name, interval: :day)
14
14
  event_counters[name] = interval
15
15
 
16
16
  clause = { name: name.to_s }
@@ -1,4 +1,4 @@
1
1
  # This module contains VERSION
2
2
  module EventCounterVersion
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
data/spec/spec_helper.rb CHANGED
@@ -39,11 +39,11 @@ end
39
39
 
40
40
  # :nodoc:
41
41
  class Ball < ActiveRecord::Base
42
- has_counter :rotations, 5.minutes
43
- has_counter :rotations_by_week, :week
44
- has_counter :rotations_by_month, :month
45
- has_counter :rotations_by_year, :year
46
- has_counter :rotations_by_two_year, 2.years
42
+ has_counter :rotations, interval: 5.minutes
43
+ has_counter :rotations_by_week, interval: :week
44
+ has_counter :rotations_by_month, interval: :month
45
+ has_counter :rotations_by_year, interval: :year
46
+ has_counter :rotations_by_two_year, interval: 2.years
47
47
  end
48
48
 
49
49
  Dir[File.expand_path('../support/*.rb', __FILE__)].each do |file|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: event-counter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Orel