impressionist 1.4.11 → 1.4.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/impressionist.gemspec +1 -1
- data/lib/impressionist/models/mongoid/impressionist/impressionable.rb +14 -21
- data/lib/impressionist/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e626e8beffd6313e99798eddb2c2bf382935acfd
|
4
|
+
data.tar.gz: c7a2adbc3fac02f565a257deffc30af5c6e13386
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30c6e2cbfc40499cdf435a9cd243f1e80d4ed0b0bd2a58c805b56c3db817f334c88d8f2cf72c3140a78e400edd21d1bf25c416c34c49097dd423c942915a4fdb
|
7
|
+
data.tar.gz: e29a4745d1c1f2e1049f741cce550c55e58d47bfd47f7feaab0a353cb1b0723f381fd12d54f3e05e6aa16c7a50c82a6f93c311e501606927691d982359584bd2
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
![Impressionist Logo](https://github.com/charlotte-ruby/impressionist/raw/master/logo.png)
|
2
2
|
|
3
3
|
[![Build Status](https://secure.travis-ci.org/charlotte-ruby/impressionist.png?branch=master)](http://travis-ci.org/charlotte-ruby/impressionist)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/charlotte-ruby/impressionist.png)](https://codeclimate.com/github/charlotte-ruby/impressionist)
|
4
5
|
|
5
6
|
impressionist
|
6
7
|
=============
|
@@ -224,9 +225,10 @@ Want to run the tests? Ok mummy
|
|
224
225
|
|
225
226
|
Contributors
|
226
227
|
------------
|
227
|
-
* [johnmcaliley](https://github.com/johnmcaliley)
|
228
|
+
* [johnmcaliley - creator](https://github.com/johnmcaliley)
|
229
|
+
* [Antonio C Nalesso - maintainer](https://github.com/nbit001)
|
228
230
|
* [coryschires](https://github.com/coryschires)
|
229
231
|
* [georgmittendorfer](https://github.com/georgmittendorfer)
|
230
|
-
|
232
|
+
|
231
233
|
|
232
234
|
Copyright (c) 2011 John McAliley. See LICENSE.txt for further details.
|
data/impressionist.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
|
21
21
|
s.add_dependency 'httpclient', '~> 2.2'
|
22
22
|
|
23
|
-
s.add_dependency 'nokogiri', '~> 1.
|
23
|
+
s.add_dependency 'nokogiri', '~> 1.5.0'
|
24
24
|
|
25
25
|
s.add_development_dependency 'capybara', '>= 2.0.3'
|
26
26
|
s.add_development_dependency 'rake', '>= 0.9'
|
@@ -4,28 +4,21 @@ module Impressionist
|
|
4
4
|
# extends AS::Concern
|
5
5
|
include Impressionist::IsImpressionable
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
# Overides impressionist_count in order to provied
|
10
|
-
# mongoid compability
|
7
|
+
# Overides impressionist_count in order to provide mongoid compability
|
11
8
|
def impressionist_count(options={})
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
imps = options[:start_date].blank? ?
|
19
|
-
impressions :
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
filter == :all ?
|
26
|
-
imps.count :
|
27
|
-
imps.where(filter.ne => nil).
|
28
|
-
distinct(filter).count
|
9
|
+
|
10
|
+
# Uses these options as defaults unless overridden in options hash
|
11
|
+
options.reverse_merge!(:filter => :request_hash, :start_date => nil, :end_date => Time.now)
|
12
|
+
|
13
|
+
# If a start_date is provided, finds impressions between then and the end_date.
|
14
|
+
# Otherwise returns all impressions
|
15
|
+
imps = options[:start_date].blank? ? impressions :
|
16
|
+
impressions.between(created_at: options[:start_date]..options[:end_date])
|
17
|
+
|
18
|
+
|
19
|
+
# Count all distinct impressions unless the :all filter is provided
|
20
|
+
distinct = options[:filter] != :all
|
21
|
+
distinct ? imps.where(options[:filter].ne => nil).distinct(options[:filter]).count : imps.count
|
29
22
|
end
|
30
23
|
|
31
24
|
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.
|
4
|
+
version: 1.4.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- johnmcaliley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.5.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.5.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: capybara
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|