impressionist 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +0 -1
- data/.travis.yml +4 -4
- data/README.md +1 -1
- data/Rakefile +0 -2
- data/app/controllers/impressionist_controller.rb +1 -4
- data/app/models/impression.rb +0 -1
- data/app/models/impressionist/bots.rb +6 -0
- data/app/models/impressionist/impressionable.rb +16 -13
- data/lib/generators/active_record/templates/create_impressions_table.rb +1 -0
- data/lib/generators/impressionist_generator.rb +1 -0
- data/lib/generators/mongoid/impressionist_generator.rb +8 -0
- data/lib/generators/templates/impression.rb +1 -1
- data/lib/impressionist/controllers/mongoid/impressionist_controller.rb +10 -0
- data/lib/impressionist/engine.rb +8 -1
- data/lib/impressionist/models/active_record/impression.rb +4 -2
- data/lib/impressionist/models/active_record/impressionist/impressionable.rb +1 -1
- data/lib/impressionist/models/mongo_mapper/impression.rb +2 -0
- data/lib/impressionist/models/mongoid/impression.rb +32 -0
- data/lib/impressionist/models/mongoid/impressionist/impressionable.rb +52 -0
- data/lib/impressionist/version.rb +1 -1
- data/test_app/spec/{intializers → initializers}/initializers_spec.rb +0 -0
- data/test_app/spec/models/bots_spec.rb +27 -0
- data/test_app/spec/models/counter_caching_spec.rb +22 -2
- data/upgrade_migrations/version_1_1_2.rb +9 -0
- metadata +83 -26
data/.travis.yml
CHANGED
@@ -2,10 +2,10 @@ before_install: gem install bundler
|
|
2
2
|
before_script: "cd test_app && bundle install && ./script/rails generate impressionist && bundle exec rake db:migrate && cd .."
|
3
3
|
language: ruby
|
4
4
|
rvm:
|
5
|
+
- rbx-18mode
|
6
|
+
- rbx-19mode
|
7
|
+
- jruby-18mode
|
5
8
|
- 1.8.7
|
6
9
|
- 1.9.2
|
7
10
|
- 1.9.3
|
8
|
-
-
|
9
|
-
- jruby-19mode
|
10
|
-
- rbx-18mode
|
11
|
-
- rbx-19mode
|
11
|
+
- ruby-head
|
data/README.md
CHANGED
@@ -57,7 +57,7 @@ The following fields are provided in the migration:
|
|
57
57
|
t.string "referrer" # request.referer
|
58
58
|
t.string "message" # custom message you can add
|
59
59
|
t.datetime "created_at" # I am not sure what this is.... Any clue?
|
60
|
-
t.datetime "updated_at" # never seen this one before either.... Your guess is as good as mine??
|
60
|
+
t.datetime "updated_at" # never seen this one before either.... Your guess is as good as mine?? ;-)
|
61
61
|
|
62
62
|
Usage
|
63
63
|
-----
|
data/Rakefile
CHANGED
@@ -41,10 +41,7 @@ module ImpressionistController
|
|
41
41
|
private
|
42
42
|
|
43
43
|
def bypass
|
44
|
-
Impressionist::Bots
|
45
|
-
return true if request.user_agent and request.user_agent.downcase.include? wild_card
|
46
|
-
end
|
47
|
-
Impressionist::Bots::LIST.include? request.user_agent
|
44
|
+
Impressionist::Bots.bot?(request.user_agent)
|
48
45
|
end
|
49
46
|
|
50
47
|
def unique_instance?(impressionable, unique_opts)
|
data/app/models/impression.rb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
module Impressionist
|
2
2
|
module Bots
|
3
|
+
|
4
|
+
def self.bot?(user_agent = nil)
|
5
|
+
return false if user_agent.nil?
|
6
|
+
WILD_CARDS.any? { |wc| user_agent.downcase.include?(wc) } || LIST.include?(user_agent)
|
7
|
+
end
|
8
|
+
|
3
9
|
WILD_CARDS = ["bot","yahoo","slurp","google","msn","crawler"]
|
4
10
|
|
5
11
|
LIST = ["<a href='http://www.unchaos.com/'> UnChaos </a> From Chaos To Order Hybrid Web Search Engine.(vadim_gonchar@unchaos.com)",
|
@@ -3,19 +3,24 @@ module Impressionist
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
module ClassMethods
|
6
|
-
attr_accessor :
|
7
|
-
@
|
6
|
+
attr_accessor :impressionist_cache_options
|
7
|
+
@impressionist_cache_options = nil
|
8
8
|
|
9
|
-
def
|
10
|
-
if @
|
9
|
+
def impressionist_counter_cache_options
|
10
|
+
if @impressionist_cache_options
|
11
11
|
options = { :column_name => :impressions_count, :unique => false }
|
12
|
-
options.merge!(@
|
12
|
+
options.merge!(@impressionist_cache_options) if @impressionist_cache_options.is_a?(Hash)
|
13
13
|
options
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
+
def impressionist_counter_caching?
|
18
|
+
impressionist_counter_cache_options.present?
|
19
|
+
end
|
20
|
+
|
17
21
|
def counter_caching?
|
18
|
-
|
22
|
+
::ActiveSupport::Deprecation.warn("#counter_caching? is deprecated; please use #impressionist_counter_caching? instead")
|
23
|
+
impressionist_counter_caching?
|
19
24
|
end
|
20
25
|
end
|
21
26
|
|
@@ -26,17 +31,15 @@ module Impressionist
|
|
26
31
|
def impressionist_count(options={})
|
27
32
|
options.reverse_merge!(:filter=>:request_hash, :start_date=>nil, :end_date=>Time.now)
|
28
33
|
imps = options[:start_date].blank? ? impressions : impressions.where("created_at>=? and created_at<=?",options[:start_date],options[:end_date])
|
29
|
-
|
30
|
-
imps = imps.select(options[:filter]).group(options[:filter])
|
31
|
-
end
|
32
|
-
imps.all.size
|
34
|
+
options[:filter] == :all ? imps.count : imps.count(options[:filter], :distinct => true)
|
33
35
|
end
|
34
36
|
|
35
|
-
def
|
36
|
-
cache_options = self.class.
|
37
|
+
def update_impressionist_counter_cache
|
38
|
+
cache_options = self.class.impressionist_counter_cache_options
|
37
39
|
column_name = cache_options[:column_name].to_sym
|
38
40
|
count = cache_options[:unique] ? impressionist_count(:filter => :ip_address) : impressionist_count
|
39
|
-
|
41
|
+
old_count = send(column_name) || 0
|
42
|
+
self.class.update_counters(id, column_name => (count - old_count))
|
40
43
|
end
|
41
44
|
|
42
45
|
# OLD METHODS - DEPRECATE IN V0.5
|
@@ -14,6 +14,7 @@ class CreateImpressionsTable < ActiveRecord::Migration
|
|
14
14
|
t.text :referrer
|
15
15
|
t.timestamps
|
16
16
|
end
|
17
|
+
add_index :impressions, [:impressionable_type, :message, :impressionable_id], :name => "impressionable_type_message_index", :unique => false
|
17
18
|
add_index :impressions, [:impressionable_type, :impressionable_id, :request_hash], :name => "poly_request_index", :unique => false
|
18
19
|
add_index :impressions, [:impressionable_type, :impressionable_id, :ip_address], :name => "poly_ip_index", :unique => false
|
19
20
|
add_index :impressions, [:impressionable_type, :impressionable_id, :session_hash], :name => "poly_session_index", :unique => false
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Use this hook to configure impressionist parameters
|
2
2
|
Impressionist.setup do |config|
|
3
|
-
# Define ORM. Could be :active_record (default)
|
3
|
+
# Define ORM. Could be :active_record (default), :mongo_mapper or :mongoid
|
4
4
|
# config.orm = :active_record
|
5
5
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
ImpressionistController::InstanceMethods.send(:define_method, :direct_create_statement) do |query_params={}|
|
2
|
+
# creates a statment hash that contains default values for creating an impression.
|
3
|
+
# if :impressionable_id is a valid ObjectId then convert it into one
|
4
|
+
base = (defined? Moped) ? Moped::BSON : BSON
|
5
|
+
query_params.reverse_merge!(
|
6
|
+
:impressionable_type => controller_name.singularize.camelize,
|
7
|
+
:impressionable_id=> !base::ObjectId.legal?(params[:id]) ? params[:id] : base::ObjectId.from_string(params[:id])
|
8
|
+
)
|
9
|
+
associative_create_statement(query_params)
|
10
|
+
end
|
data/lib/impressionist/engine.rb
CHANGED
@@ -5,7 +5,7 @@ module Impressionist
|
|
5
5
|
class Engine < Rails::Engine
|
6
6
|
initializer 'impressionist.model' do |app|
|
7
7
|
require "#{root}/app/models/impressionist/impressionable.rb"
|
8
|
-
if Impressionist.orm == :active_record
|
8
|
+
if Impressionist.orm == :active_record && defined? ActiveRecord
|
9
9
|
require "impressionist/models/active_record/impression.rb"
|
10
10
|
require "impressionist/models/active_record/impressionist/impressionable.rb"
|
11
11
|
ActiveRecord::Base.send(:include, Impressionist::Impressionable)
|
@@ -13,10 +13,17 @@ module Impressionist
|
|
13
13
|
require "impressionist/models/mongo_mapper/impression.rb"
|
14
14
|
require "impressionist/models/mongo_mapper/impressionist/impressionable.rb"
|
15
15
|
MongoMapper::Document.plugin Impressionist::Impressionable
|
16
|
+
elsif Impressionist.orm == :mongoid
|
17
|
+
require 'impressionist/models/mongoid/impression.rb'
|
18
|
+
require 'impressionist/models/mongoid/impressionist/impressionable.rb'
|
19
|
+
Mongoid::Document.send(:include, Impressionist::Impressionable)
|
16
20
|
end
|
17
21
|
end
|
18
22
|
|
19
23
|
initializer 'impressionist.controller' do
|
24
|
+
if Impressionist.orm == :mongoid
|
25
|
+
require 'impressionist/controllers/mongoid/impressionist_controller.rb'
|
26
|
+
end
|
20
27
|
ActiveSupport.on_load(:action_controller) do
|
21
28
|
include ImpressionistController::InstanceMethods
|
22
29
|
extend ImpressionistController::ClassMethods
|
@@ -3,6 +3,8 @@ class Impression < ActiveRecord::Base
|
|
3
3
|
:controller_name, :action_name, :view_name, :request_hash, :ip_address,
|
4
4
|
:session_hash, :message, :referrer
|
5
5
|
|
6
|
+
belongs_to :impressionable, :polymorphic=>true
|
7
|
+
|
6
8
|
after_save :update_impressions_counter_cache
|
7
9
|
|
8
10
|
private
|
@@ -10,9 +12,9 @@ class Impression < ActiveRecord::Base
|
|
10
12
|
def update_impressions_counter_cache
|
11
13
|
impressionable_class = self.impressionable_type.constantize
|
12
14
|
|
13
|
-
if impressionable_class.
|
15
|
+
if impressionable_class.impressionist_counter_cache_options
|
14
16
|
resouce = impressionable_class.find(self.impressionable_id)
|
15
|
-
resouce.try(:
|
17
|
+
resouce.try(:update_impressionist_counter_cache)
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
@@ -5,7 +5,7 @@ module Impressionist
|
|
5
5
|
module ClassMethods
|
6
6
|
def is_impressionable(options={})
|
7
7
|
has_many :impressions, :as => :impressionable, :dependent => :destroy
|
8
|
-
@
|
8
|
+
@impressionist_cache_options = options[:counter_cache]
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
class Impression
|
2
|
+
include Mongoid::Document
|
3
|
+
include Mongoid::Timestamps
|
4
|
+
|
5
|
+
attr_accessible :impressionable_type, :impressionable_field, :impressionable_id, :user_id,
|
6
|
+
:controller_name, :action_name, :view_name, :request_hash, :ip_address,
|
7
|
+
:session_hash, :message, :referrer
|
8
|
+
|
9
|
+
belongs_to :impressionable, polymorphic: true
|
10
|
+
|
11
|
+
field :user_id
|
12
|
+
field :controller_name
|
13
|
+
field :action_name
|
14
|
+
field :view_name
|
15
|
+
field :request_hash
|
16
|
+
field :ip_address
|
17
|
+
field :session_hash
|
18
|
+
field :message
|
19
|
+
field :referrer
|
20
|
+
|
21
|
+
set_callback(:create, :after) do |doc|
|
22
|
+
unless impressionable_id.nil?
|
23
|
+
impressionable_class = doc.impressionable_type.constantize
|
24
|
+
|
25
|
+
if impressionable_class.impressionist_counter_cache_options
|
26
|
+
resource = impressionable_class.find(doc.impressionable_id)
|
27
|
+
resource.try(:update_impressionist_counter_cache)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module Impressionist
|
2
|
+
module Impressionable
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
module ClassMethods
|
6
|
+
def is_impressionable(options={})
|
7
|
+
has_many :impressions, as: :impressionable, dependent: :destroy
|
8
|
+
@impressionist_cache_options = options[:counter_cache]
|
9
|
+
if !@impressionist_cache_options.nil?
|
10
|
+
opts = impressionist_counter_cache_options
|
11
|
+
field opts[:column_name], type: Integer
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def impressionist_counter_cache_options
|
16
|
+
if @impressionist_cache_options
|
17
|
+
options = { :column_name => :impressions_count, :unique => false }
|
18
|
+
options.merge!(@impressionist_cache_options) if @impressionist_cache_options.is_a?(Hash)
|
19
|
+
options
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def impressionist_counter_caching?
|
24
|
+
impressionist_counter_cache_options.present?
|
25
|
+
end
|
26
|
+
|
27
|
+
def counter_caching?
|
28
|
+
::ActiveSupport::Deprecation.warn("#counter_caching? is deprecated; please use #impressionist_counter_caching? instead")
|
29
|
+
impressionist_counter_caching?
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def impressionable?
|
34
|
+
true
|
35
|
+
end
|
36
|
+
|
37
|
+
def impressionist_count(options={})
|
38
|
+
options.reverse_merge!(:filter=>:request_hash, :start_date=>nil, :end_date=>Time.now)
|
39
|
+
imps = options[:start_date].blank? ? impressions : impressions.between(created_at: options[:start_date]..options[:end_date])
|
40
|
+
options[:filter] == :all ? imps.count : imps.where(options[:filter].ne => nil).count
|
41
|
+
end
|
42
|
+
|
43
|
+
def update_impressionist_counter_cache
|
44
|
+
cache_options = self.class.impressionist_counter_cache_options
|
45
|
+
column_name = cache_options[:column_name].to_sym
|
46
|
+
count = cache_options[:unique] ? impressionist_count(:filter => :ip_address) : impressionist_count
|
47
|
+
old_count = send(column_name) || 0
|
48
|
+
self.inc(column_name, (count - old_count))
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
File without changes
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Impressionist::Bots do
|
4
|
+
|
5
|
+
describe "self.bot?" do
|
6
|
+
it "is true if user_agent is matches wild card" do
|
7
|
+
Impressionist::Bots.bot?("google.com bot").should be_true
|
8
|
+
end
|
9
|
+
|
10
|
+
it "is true if user_agent is on bot list" do
|
11
|
+
Impressionist::Bots.bot?("A-Online Search").should be_true
|
12
|
+
end
|
13
|
+
|
14
|
+
it "is false if user_agent is blank" do
|
15
|
+
Impressionist::Bots.bot?("").should be_false
|
16
|
+
Impressionist::Bots.bot?(nil).should be_false
|
17
|
+
end
|
18
|
+
|
19
|
+
it "is false if user_agent is safe" do
|
20
|
+
Impressionist::Bots.bot?('127.0.0.1').should be_false
|
21
|
+
end
|
22
|
+
|
23
|
+
it "is false if user_agent not given" do
|
24
|
+
Impressionist::Bots.bot?.should be_false
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -8,23 +8,43 @@ describe Impression do
|
|
8
8
|
Impression.destroy_all
|
9
9
|
end
|
10
10
|
|
11
|
+
describe "self#impressionist_counter_caching?" do
|
12
|
+
it "should know when counter caching is enabled" do
|
13
|
+
Widget.should be_impressionist_counter_caching
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should know when counter caching is disabled" do
|
17
|
+
Article.should_not be_impressionist_counter_caching
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
11
21
|
describe "self#counter_caching?" do
|
12
22
|
it "should know when counter caching is enabled" do
|
23
|
+
ActiveSupport::Deprecation.should_receive(:warn)
|
13
24
|
Widget.should be_counter_caching
|
14
25
|
end
|
15
26
|
|
16
27
|
it "should know when counter caching is disabled" do
|
28
|
+
ActiveSupport::Deprecation.should_receive(:warn)
|
17
29
|
Article.should_not be_counter_caching
|
18
30
|
end
|
31
|
+
|
19
32
|
end
|
20
33
|
|
21
|
-
describe "#
|
34
|
+
describe "#update_impressionist_counter_cache" do
|
22
35
|
it "should update the counter cache column to reflect the correct number of impressions" do
|
23
36
|
lambda {
|
24
|
-
|
37
|
+
@widget.impressions.create(:request_hash => 'abcd1234')
|
25
38
|
@widget.reload
|
26
39
|
}.should change(@widget, :impressions_count).from(0).to(1)
|
27
40
|
end
|
41
|
+
|
42
|
+
it "should not update the timestamp on the impressable" do
|
43
|
+
lambda {
|
44
|
+
@widget.impressions.create(:request_hash => 'abcd1234')
|
45
|
+
@widget.reload
|
46
|
+
}.should_not change(@widget, :updated_at)
|
47
|
+
end
|
28
48
|
end
|
29
49
|
|
30
50
|
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class Version04UpdateImpressionsTable < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_index :impressions, [:impressionable_type, :message, :impressionable_id], :name => "impressionable_type_message_index", :unique => false
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.down
|
7
|
+
remove_index :impressions, :impressionable_type_message_index
|
8
|
+
end
|
9
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: impressionist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httpclient
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '2.2'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '2.2'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: nokogiri
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ~>
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: '1.5'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.5'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: capybara
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: '0'
|
44
54
|
type: :development
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: rake
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -54,10 +69,15 @@ dependencies:
|
|
54
69
|
version: '0.9'
|
55
70
|
type: :development
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0.9'
|
58
78
|
- !ruby/object:Gem::Dependency
|
59
79
|
name: rails
|
60
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
61
81
|
none: false
|
62
82
|
requirements:
|
63
83
|
- - ~>
|
@@ -65,10 +85,15 @@ dependencies:
|
|
65
85
|
version: '3.1'
|
66
86
|
type: :development
|
67
87
|
prerelease: false
|
68
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '3.1'
|
69
94
|
- !ruby/object:Gem::Dependency
|
70
95
|
name: rdoc
|
71
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
72
97
|
none: false
|
73
98
|
requirements:
|
74
99
|
- - ! '>='
|
@@ -76,10 +101,15 @@ dependencies:
|
|
76
101
|
version: 2.4.2
|
77
102
|
type: :development
|
78
103
|
prerelease: false
|
79
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 2.4.2
|
80
110
|
- !ruby/object:Gem::Dependency
|
81
111
|
name: rspec-rails
|
82
|
-
requirement:
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
83
113
|
none: false
|
84
114
|
requirements:
|
85
115
|
- - ! '>='
|
@@ -87,10 +117,15 @@ dependencies:
|
|
87
117
|
version: '0'
|
88
118
|
type: :development
|
89
119
|
prerelease: false
|
90
|
-
version_requirements:
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
91
126
|
- !ruby/object:Gem::Dependency
|
92
127
|
name: simplecov
|
93
|
-
requirement:
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
94
129
|
none: false
|
95
130
|
requirements:
|
96
131
|
- - ! '>='
|
@@ -98,10 +133,15 @@ dependencies:
|
|
98
133
|
version: '0'
|
99
134
|
type: :development
|
100
135
|
prerelease: false
|
101
|
-
version_requirements:
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
102
142
|
- !ruby/object:Gem::Dependency
|
103
143
|
name: sqlite3
|
104
|
-
requirement:
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
105
145
|
none: false
|
106
146
|
requirements:
|
107
147
|
- - ! '>='
|
@@ -109,10 +149,15 @@ dependencies:
|
|
109
149
|
version: '0'
|
110
150
|
type: :development
|
111
151
|
prerelease: false
|
112
|
-
version_requirements:
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
113
158
|
- !ruby/object:Gem::Dependency
|
114
159
|
name: systemu
|
115
|
-
requirement:
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
116
161
|
none: false
|
117
162
|
requirements:
|
118
163
|
- - ! '>='
|
@@ -120,7 +165,12 @@ dependencies:
|
|
120
165
|
version: '0'
|
121
166
|
type: :development
|
122
167
|
prerelease: false
|
123
|
-
version_requirements:
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ! '>='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
124
174
|
description: Log impressions from controller actions or from a model
|
125
175
|
email: john.mcaliley@gmail.com
|
126
176
|
executables: []
|
@@ -144,14 +194,18 @@ files:
|
|
144
194
|
- lib/generators/active_record/templates/create_impressions_table.rb
|
145
195
|
- lib/generators/impressionist_generator.rb
|
146
196
|
- lib/generators/mongo_mapper/impressionist_generator.rb
|
197
|
+
- lib/generators/mongoid/impressionist_generator.rb
|
147
198
|
- lib/generators/templates/impression.rb
|
148
199
|
- lib/impressionist.rb
|
149
200
|
- lib/impressionist/bots.rb
|
201
|
+
- lib/impressionist/controllers/mongoid/impressionist_controller.rb
|
150
202
|
- lib/impressionist/engine.rb
|
151
203
|
- lib/impressionist/models/active_record/impression.rb
|
152
204
|
- lib/impressionist/models/active_record/impressionist/impressionable.rb
|
153
205
|
- lib/impressionist/models/mongo_mapper/impression.rb
|
154
206
|
- lib/impressionist/models/mongo_mapper/impressionist/impressionable.rb
|
207
|
+
- lib/impressionist/models/mongoid/impression.rb
|
208
|
+
- lib/impressionist/models/mongoid/impressionist/impressionable.rb
|
155
209
|
- lib/impressionist/version.rb
|
156
210
|
- logo.png
|
157
211
|
- test_app/.gitignore
|
@@ -234,13 +288,15 @@ files:
|
|
234
288
|
- test_app/spec/fixtures/impressions.yml
|
235
289
|
- test_app/spec/fixtures/posts.yml
|
236
290
|
- test_app/spec/fixtures/widgets.yml
|
237
|
-
- test_app/spec/
|
291
|
+
- test_app/spec/initializers/initializers_spec.rb
|
292
|
+
- test_app/spec/models/bots_spec.rb
|
238
293
|
- test_app/spec/models/counter_caching_spec.rb
|
239
294
|
- test_app/spec/models/model_spec.rb
|
240
295
|
- test_app/spec/rails_generators/rails_generators_spec.rb
|
241
296
|
- test_app/spec/spec_helper.rb
|
242
297
|
- upgrade_migrations/version_0_3_0.rb
|
243
298
|
- upgrade_migrations/version_0_4_0.rb
|
299
|
+
- upgrade_migrations/version_1_1_2.rb
|
244
300
|
homepage: https://github.com/charlotte-ruby/impressionist
|
245
301
|
licenses:
|
246
302
|
- MIT
|
@@ -256,7 +312,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
256
312
|
version: '0'
|
257
313
|
segments:
|
258
314
|
- 0
|
259
|
-
hash:
|
315
|
+
hash: 2760039112118904693
|
260
316
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
261
317
|
none: false
|
262
318
|
requirements:
|
@@ -265,7 +321,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
265
321
|
version: 1.3.6
|
266
322
|
requirements: []
|
267
323
|
rubyforge_project:
|
268
|
-
rubygems_version: 1.8.
|
324
|
+
rubygems_version: 1.8.24
|
269
325
|
signing_key:
|
270
326
|
specification_version: 3
|
271
327
|
summary: Easy way to log impressions
|
@@ -348,7 +404,8 @@ test_files:
|
|
348
404
|
- test_app/spec/fixtures/impressions.yml
|
349
405
|
- test_app/spec/fixtures/posts.yml
|
350
406
|
- test_app/spec/fixtures/widgets.yml
|
351
|
-
- test_app/spec/
|
407
|
+
- test_app/spec/initializers/initializers_spec.rb
|
408
|
+
- test_app/spec/models/bots_spec.rb
|
352
409
|
- test_app/spec/models/counter_caching_spec.rb
|
353
410
|
- test_app/spec/models/model_spec.rb
|
354
411
|
- test_app/spec/rails_generators/rails_generators_spec.rb
|