impressionist 1.4.13 → 1.5.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: 26b1ba3eb3dcb6e51c0b28a6f0f5362510098d11
4
- data.tar.gz: 64b95b9bccb3aa0810fc5b06925dce5ef590988a
3
+ metadata.gz: cb9ffa85fa4e4bcd8eebad92acee8eb81c3f48de
4
+ data.tar.gz: 9073d41d76c1eec72dbc44b51fce2c6100269c34
5
5
  SHA512:
6
- metadata.gz: 7e31c9470fb5c7261f7b156404e5a6a20eb1ebc5487bde84e7fe1fab75a731ca0fa2a0398fabff491dcbf3e32f1c46694adce428f0745726a7535d30a5e557ab
7
- data.tar.gz: 263082fdc47df01e46b169d4183231405ab5a2918166d3194bad9e0679b247af1bd2e893adc85fbebaad3471305656990975a4cf9b05e2d4081a440ecb3afd82
6
+ metadata.gz: 02d800f34d2d75e3e1605e5abee38c554b874509a3b2d9cd7ea199bb2cfbbda1ccadd6b1e0661b3021ea86eb686e0a632736ef7cc1deef75490d89bc75a4ba88
7
+ data.tar.gz: 26147d35e22672d3624340d52c8b8b2649ab65641c7377f9cc5c14f4d01e9c24a2cc2cf42b21a516ee04989aaf15b22d573d856706e5f2a264a09d12166472d6
@@ -1,21 +1,26 @@
1
1
  language: ruby
2
- before_script:
2
+ before_script:
3
3
  - cd tests/test_app
4
4
  - bundle exec rails g impressionist -f
5
5
  - bundle exec rake db:migrate
6
6
  - cd ..
7
7
  rvm:
8
- - 1.9.2
9
8
  - 1.9.3
10
9
  - 2.0.0
11
- - jruby-19mode
12
- - rbx-19mode
10
+ - jruby-head
11
+ - rbx
12
+ - ruby-head
13
13
  gemfile:
14
14
  - gemfiles/rails32.gemfile
15
15
  - gemfiles/rails40.gemfile
16
16
  matrix:
17
- exclude:
18
- - rvm: 1.9.2
19
- gemfile: gemfiles/rails40.gemfile
20
17
  allow_failures:
21
- - rvm: 1.9.2
18
+ - rvm: jruby-head
19
+ - rvm: rbx
20
+ - rvm: ruby-head
21
+ fast_finish: true
22
+ notifications:
23
+ email:
24
+ - acnalesso@yahoo.co.uk
25
+ - john@couponshack.com
26
+ - mmcmahand@gmail.com
@@ -1,3 +1,7 @@
1
+ == 1.5.0 (2013-12-30)
2
+ * Added message filtering.
3
+ * (@overovermind)
4
+
1
5
  == 1.4.8 (2013-09-01)
2
6
  * Fixed #108
3
7
  * Clean up
data/Gemfile CHANGED
@@ -1,5 +1,8 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem 'rake', '>= 0.9'
4
+ gem 'rdoc', '>= 2.4.2'
5
+
3
6
  platforms :jruby do
4
7
  gem 'activerecord-jdbcsqlite3-adapter'
5
8
  gem 'jdbc-sqlite3'
@@ -10,4 +13,14 @@ platforms :ruby, :mswin, :mingw do
10
13
  gem 'sqlite3'
11
14
  end
12
15
 
16
+ group :test do
17
+ gem 'capybara', '>= 2.0.3'
18
+ gem 'minitest'
19
+ gem 'minitest-rails'
20
+ gem 'rails', '>= 3.2.15'
21
+ gem 'rspec-rails'
22
+ gem 'simplecov'
23
+ gem 'systemu'
24
+ end
25
+
13
26
  gemspec
data/README.md CHANGED
@@ -124,6 +124,10 @@ Usage
124
124
 
125
125
  @widget.impressionist_count(:filter=>:all)
126
126
 
127
+ 9. Get impression count by message. This only counts impressions of the given message.
128
+
129
+ @widget.impressionist_count(:message=>"pageview", :filter=>:all)
130
+
127
131
  Logging impressions for authenticated users happens automatically. If you have
128
132
  a current_user helper or use @current_user in your before_filter to set your
129
133
  authenticated user, current_user.id will be written to the user_id field in the
@@ -5,7 +5,11 @@ module Impressionist
5
5
  module ClassMethods
6
6
  attr_accessor :impressionist_cache_options
7
7
 
8
- DEFAULT_CACHE = { :counter_cache => false, :column_name => :impressions_count, :unique => false }
8
+ DEFAULT_CACHE ||= {
9
+ :counter_cache => false,
10
+ :column_name => :impressions_count,
11
+ :unique => false
12
+ }
9
13
 
10
14
  def impressionist_counter_cache_options
11
15
  @impressionist_cache_options ||= {}
@@ -31,6 +35,10 @@ module Impressionist
31
35
  # If a start_date is provided, finds impressions between then and the end_date. Otherwise returns all impressions
32
36
  imps = options[:start_date].blank? ? impressions : impressions.where("created_at >= ? and created_at <= ?", options[:start_date], options[:end_date])
33
37
 
38
+ if options[:message]
39
+ imps = imps.where("impressions.message = ?", options[:message])
40
+ end
41
+
34
42
  # Count all distinct impressions unless the :all filter is provided.
35
43
  distinct = options[:filter] != :all
36
44
  if Rails::VERSION::MAJOR == 4
@@ -1,12 +1,26 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '~> 3.2.12'
4
- gem 'jquery-rails'
5
- gem 'json'
3
+ gem 'rake', '>= 0.9'
4
+ gem 'rdoc', '>= 2.4.2'
6
5
 
7
- gem 'activerecord-jdbcsqlite3-adapter', :platforms => [:jruby]
8
- gem 'jdbc-sqlite3', :platforms => [:jruby]
6
+ platforms :jruby do
7
+ gem 'activerecord-jdbcsqlite3-adapter'
8
+ gem 'jdbc-sqlite3'
9
+ gem 'jruby-openssl'
10
+ end
9
11
 
10
- gem 'sqlite3', :platforms => [:ruby, :mswin, :mingw]
12
+ platforms :ruby, :mswin, :mingw do
13
+ gem 'sqlite3'
14
+ end
11
15
 
12
- gemspec :path => '../'
16
+ group :test do
17
+ gem 'capybara', '>= 2.0.3'
18
+ gem 'minitest'
19
+ gem 'minitest-rails'
20
+ gem 'rails', '~> 3.2.15'
21
+ gem 'rspec-rails'
22
+ gem 'simplecov'
23
+ gem 'systemu'
24
+ end
25
+
26
+ gemspec :path => '../'
@@ -1,11 +1,26 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '~> 4.0.0'
4
- gem 'jquery-rails'
5
- gem 'json'
3
+ gem 'rake', '>= 0.9'
4
+ gem 'rdoc', '>= 2.4.2'
6
5
 
7
- gem 'activerecord-jdbcsqlite3-adapter', '1.3.0.rc1', :platforms => [:jruby]
6
+ platforms :jruby do
7
+ gem 'activerecord-jdbcsqlite3-adapter'
8
+ gem 'jdbc-sqlite3'
9
+ gem 'jruby-openssl'
10
+ end
8
11
 
9
- gem 'sqlite3', :platforms => [:ruby, :mswin, :mingw]
12
+ platforms :ruby, :mswin, :mingw do
13
+ gem 'sqlite3'
14
+ end
10
15
 
11
- gemspec :path => '../'
16
+ group :test do
17
+ gem 'capybara', '>= 2.0.3'
18
+ gem 'minitest'
19
+ gem 'minitest-rails'
20
+ gem 'rails', '~> 4.0.1'
21
+ gem 'rspec-rails'
22
+ gem 'simplecov'
23
+ gem 'systemu'
24
+ end
25
+
26
+ gemspec :path => '../'
@@ -19,16 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if s.respond_to? :required_rubygems_version=
20
20
 
21
21
  s.add_dependency 'httpclient', '~> 2.2'
22
+ s.add_dependency 'nokogiri', '~> 1.5'
22
23
 
23
- s.add_dependency 'nokogiri', '>= 1.5.0'
24
-
25
- s.add_development_dependency 'capybara', '>= 2.0.3'
26
- s.add_development_dependency 'rake', '>= 0.9'
27
- s.add_development_dependency 'rails', '>= 3.2.12', '< 4.1'
28
- s.add_development_dependency 'rdoc', '>= 2.4.2'
29
- s.add_development_dependency 'rspec-rails'
30
- s.add_development_dependency 'simplecov'
31
- s.add_development_dependency 'systemu'
32
- s.add_development_dependency 'minitest'
33
- s.add_development_dependency 'minitest-rails'
24
+ s.add_development_dependency 'bundler', '~> 1.0'
34
25
  end
@@ -1,3 +1,3 @@
1
1
  module Impressionist
2
- VERSION = "1.4.13"
2
+ VERSION = "1.5.1"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '3.2.12'
3
+ gem 'rails', '~> 3.2'
4
4
 
5
5
  gem 'impressionist', :path => '../../'
6
6
 
@@ -14,7 +14,7 @@ platforms :ruby, :mswin, :mingw do
14
14
  gem 'pg'
15
15
  gem 'sqlite3'
16
16
  gem 'mysql2'
17
- gem "mongoid", "~> 3.1.4"
17
+ gem 'mongoid', '~> 3.1'
18
18
  gem 'bson_ext'
19
19
  end
20
20
 
@@ -23,8 +23,8 @@ gem 'json'
23
23
  # Gems used only for assets and not required
24
24
  # in production environments by default.
25
25
  group :assets do
26
- gem 'sass-rails', '~> 3.2.3'
27
- gem 'coffee-rails', '~> 3.2.1'
26
+ gem 'sass-rails', '~> 3.2'
27
+ gem 'coffee-rails', '~> 3.2'
28
28
 
29
29
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
30
30
  # gem 'therubyracer'
@@ -39,10 +39,9 @@ group :development, :test do
39
39
  end
40
40
 
41
41
  group :test do
42
+ gem 'capybara'
42
43
  gem 'simplecov'
43
44
  gem 'systemu'
44
- gem 'capybara', '~> 2.0.0'
45
45
  end
46
46
 
47
47
  gem 'jquery-rails'
48
-
@@ -10,5 +10,4 @@
10
10
  // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
11
  // GO AFTER THE REQUIRES BELOW.
12
12
  //
13
- //= require jquery_ujs
14
13
  //= require_tree .
@@ -17,6 +17,14 @@ describe Impression do
17
17
  @article.impressions.last.message.should eq "test message"
18
18
  end
19
19
 
20
+ it "should return the impression count for the message specified" do
21
+ @article.impressions.create(:message => "pageview")
22
+ @article.impressions.create(:message => "pageview")
23
+ @article.impressions.create(:message => "visit")
24
+
25
+ @article.impressionist_count(:message => "pageview", :filter => :all).should eq 2
26
+ end
27
+
20
28
  it "should return the impression count for all with no date range specified" do
21
29
  @article.impressionist_count(:filter=>:all).should eq 11
22
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: impressionist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.13
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - johnmcaliley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-28 00:00:00.000000000 Z
11
+ date: 2013-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -28,148 +28,30 @@ dependencies:
28
28
  name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 1.5.0
33
+ version: '1.5'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
39
- - !ruby/object:Gem::Version
40
- version: 1.5.0
41
- - !ruby/object:Gem::Dependency
42
- name: capybara
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '>='
46
- - !ruby/object:Gem::Version
47
- version: 2.0.3
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '>='
53
- - !ruby/object:Gem::Version
54
- version: 2.0.3
55
- - !ruby/object:Gem::Dependency
56
- name: rake
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '>='
60
- - !ruby/object:Gem::Version
61
- version: '0.9'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '>='
67
- - !ruby/object:Gem::Version
68
- version: '0.9'
69
- - !ruby/object:Gem::Dependency
70
- name: rails
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - '>='
74
- - !ruby/object:Gem::Version
75
- version: 3.2.12
76
- - - <
77
- - !ruby/object:Gem::Version
78
- version: '4.1'
79
- type: :development
80
- prerelease: false
81
- version_requirements: !ruby/object:Gem::Requirement
82
- requirements:
83
- - - '>='
84
- - !ruby/object:Gem::Version
85
- version: 3.2.12
86
- - - <
87
- - !ruby/object:Gem::Version
88
- version: '4.1'
89
- - !ruby/object:Gem::Dependency
90
- name: rdoc
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - '>='
94
- - !ruby/object:Gem::Version
95
- version: 2.4.2
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - '>='
101
- - !ruby/object:Gem::Version
102
- version: 2.4.2
103
- - !ruby/object:Gem::Dependency
104
- name: rspec-rails
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - '>='
108
- - !ruby/object:Gem::Version
109
- version: '0'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - '>='
115
- - !ruby/object:Gem::Version
116
- version: '0'
117
- - !ruby/object:Gem::Dependency
118
- name: simplecov
119
- requirement: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - '>='
122
- - !ruby/object:Gem::Version
123
- version: '0'
124
- type: :development
125
- prerelease: false
126
- version_requirements: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - '>='
129
- - !ruby/object:Gem::Version
130
- version: '0'
131
- - !ruby/object:Gem::Dependency
132
- name: systemu
133
- requirement: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - '>='
136
- - !ruby/object:Gem::Version
137
- version: '0'
138
- type: :development
139
- prerelease: false
140
- version_requirements: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - '>='
143
- - !ruby/object:Gem::Version
144
- version: '0'
145
- - !ruby/object:Gem::Dependency
146
- name: minitest
147
- requirement: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - '>='
150
- - !ruby/object:Gem::Version
151
- version: '0'
152
- type: :development
153
- prerelease: false
154
- version_requirements: !ruby/object:Gem::Requirement
155
- requirements:
156
- - - '>='
38
+ - - ~>
157
39
  - !ruby/object:Gem::Version
158
- version: '0'
40
+ version: '1.5'
159
41
  - !ruby/object:Gem::Dependency
160
- name: minitest-rails
42
+ name: bundler
161
43
  requirement: !ruby/object:Gem::Requirement
162
44
  requirements:
163
- - - '>='
45
+ - - ~>
164
46
  - !ruby/object:Gem::Version
165
- version: '0'
47
+ version: '1.0'
166
48
  type: :development
167
49
  prerelease: false
168
50
  version_requirements: !ruby/object:Gem::Requirement
169
51
  requirements:
170
- - - '>='
52
+ - - ~>
171
53
  - !ruby/object:Gem::Version
172
- version: '0'
54
+ version: '1.0'
173
55
  description: Log impressions from controller actions or from a model
174
56
  email: john.mcaliley@gmail.com
175
57
  executables: []