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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1bc58f25a7575987707c4e3c1db283b667c92def
4
- data.tar.gz: 1366d3c96dc8d9f450df03b08e9dd4baca0352d3
3
+ metadata.gz: e626e8beffd6313e99798eddb2c2bf382935acfd
4
+ data.tar.gz: c7a2adbc3fac02f565a257deffc30af5c6e13386
5
5
  SHA512:
6
- metadata.gz: b443bea4b273f98ec4a62cc06e57ad8db6743c25789087d78058c1a9b22332daadcdcf88b64ff8fd5f74b477814afa8146a07b9219e29febc0dea4248a4e67eb
7
- data.tar.gz: 6c56d18c5464fcbf7241e5a33a815c254db3194673535524c29eaa2733d0e99d09ed6cc63cde068de75fb8f5ca6cdf41bdbf1955c8e71193eb0e9725e0864b34
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
- * [Antonio C Nalesso](https://github.com/nbit001)
232
+
231
233
 
232
234
  Copyright (c) 2011 John McAliley. See LICENSE.txt for further details.
@@ -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.6.0'
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
- ## TODO: Make it readable
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
- options.
13
- reverse_merge!(
14
- :filter=>:request_hash,
15
- :start_date=>nil,
16
- :end_date=>Time.now)
17
-
18
- imps = options[:start_date].blank? ?
19
- impressions :
20
- impressions.
21
- between(created_at: options[:start_date]..options[:end_date])
22
-
23
- filter = options[:filter]
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
@@ -1,3 +1,3 @@
1
1
  module Impressionist
2
- VERSION = "1.4.11"
2
+ VERSION = "1.4.12"
3
3
  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.11
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-10 00:00:00.000000000 Z
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.6.0
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.6.0
40
+ version: 1.5.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: capybara
43
43
  requirement: !ruby/object:Gem::Requirement