ahoy_matey 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +28 -8
- data/lib/ahoy.rb +13 -6
- data/lib/ahoy/version.rb +1 -1
- data/vendor/assets/javascripts/ahoy.js +6 -3
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b95be84952b86c8d63b829a5f79706212be5c25
|
4
|
+
data.tar.gz: f187b36cf4fceedffea505d542cfcfe967933832
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f91f26c2cd6f80f792b74dfb3364eadd78a35c76f6894da57468ad8d981c05bc97796c9013f49d8a5acfbec1632e3310b4fa391588f6e21ad6d4b9b4c309ce3a
|
7
|
+
data.tar.gz: 18dc372e351d0ca497da3642befb01de577b3e5b426442a006150801a6be70ea8b8ff5c24f7bc52a6c248b7d2f428c7de03317154309d5b0e0982a80746f0925
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Works with any data store so you can easily scale.
|
|
10
10
|
|
11
11
|
:postbox: To track emails, check out [Ahoy Email](https://github.com/ankane/ahoy_email).
|
12
12
|
|
13
|
-
See [upgrade instructions](#
|
13
|
+
See [upgrade instructions](#100) on how to move to 1.0.
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
@@ -31,13 +31,13 @@ And add the javascript file in `app/assets/javascripts/application.js` after jQu
|
|
31
31
|
|
32
32
|
Ahoy supports a number of data stores out of the box. You can start with one of them and customize as needed, or create your own store from scratch.
|
33
33
|
|
34
|
-
- [PostgreSQL](#
|
35
|
-
- [MySQL](#
|
36
|
-
- [SQLite](#
|
37
|
-
- [MongoDB](#
|
38
|
-
- [Fluentd](#
|
39
|
-
- [Logs](#
|
40
|
-
- [Custom](#
|
34
|
+
- [PostgreSQL](#postgresql)
|
35
|
+
- [MySQL](#mysql-or-sqlite)
|
36
|
+
- [SQLite](#mysql-or-sqlite)
|
37
|
+
- [MongoDB](#mongodb)
|
38
|
+
- [Fluentd](#fluentd)
|
39
|
+
- [Logs](#logs)
|
40
|
+
- [Custom](#custom)
|
41
41
|
|
42
42
|
### PostgreSQL
|
43
43
|
|
@@ -508,6 +508,26 @@ Use an array to pass multiple events at once.
|
|
508
508
|
|
509
509
|
## Upgrading
|
510
510
|
|
511
|
+
### PostgreSQL 9.4 + JSONB
|
512
|
+
|
513
|
+
```sh
|
514
|
+
rails g migration change_properties_to_jsonb_on_ahoy_events
|
515
|
+
```
|
516
|
+
|
517
|
+
And add:
|
518
|
+
|
519
|
+
```rb
|
520
|
+
def up
|
521
|
+
change_column :ahoy_events, :properties, :jsonb, using: "properties::jsonb"
|
522
|
+
end
|
523
|
+
|
524
|
+
def down
|
525
|
+
change_column :ahoy_events, :properties, :json
|
526
|
+
end
|
527
|
+
```
|
528
|
+
|
529
|
+
Note: This will lock the table while the migration is running.
|
530
|
+
|
511
531
|
### 1.0.0
|
512
532
|
|
513
533
|
Add the following code to the end of `config/intializers/ahoy.rb`.
|
data/lib/ahoy.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "rails"
|
2
|
+
require "active_support/core_ext"
|
2
3
|
require "addressable/uri"
|
3
4
|
require "browser"
|
4
5
|
require "geocoder"
|
@@ -24,7 +25,6 @@ require "ahoy/stores/active_record_token_store"
|
|
24
25
|
require "ahoy/stores/log_store"
|
25
26
|
require "ahoy/stores/fluentd_store"
|
26
27
|
require "ahoy/stores/mongoid_store"
|
27
|
-
require "ahoy/logger_silencer"
|
28
28
|
require "ahoy/engine"
|
29
29
|
require "ahoy/warden" if defined?(Warden)
|
30
30
|
|
@@ -85,9 +85,16 @@ end
|
|
85
85
|
ActionController::Base.send :include, Ahoy::Controller
|
86
86
|
ActiveRecord::Base.send(:extend, Ahoy::Model) if defined?(ActiveRecord)
|
87
87
|
|
88
|
-
|
89
|
-
|
88
|
+
# ensure logger silence will not be added by activerecord-session_store
|
89
|
+
# otherwise, we get SystemStackError: stack level too deep
|
90
90
|
begin
|
91
|
-
require "
|
92
|
-
|
93
|
-
|
91
|
+
require "active_record/session_store/extension/logger_silencer"
|
92
|
+
rescue LoadError
|
93
|
+
require "ahoy/logger_silencer"
|
94
|
+
Logger.send :include, Ahoy::LoggerSilencer
|
95
|
+
|
96
|
+
begin
|
97
|
+
require "syslog/logger"
|
98
|
+
Syslog::Logger.send :include, Ahoy::LoggerSilencer
|
99
|
+
rescue LoadError; end
|
100
|
+
end
|
data/lib/ahoy/version.rb
CHANGED
@@ -20,7 +20,6 @@
|
|
20
20
|
var queue = [];
|
21
21
|
var canStringify = typeof(JSON) !== "undefined" && typeof(JSON.stringify) !== "undefined";
|
22
22
|
var eventQueue = [];
|
23
|
-
var page = ahoy.page || window.location.pathname;
|
24
23
|
var visitsUrl = ahoy.visitsUrl || "/ahoy/visits"
|
25
24
|
var eventsUrl = ahoy.eventsUrl || "/ahoy/events"
|
26
25
|
|
@@ -123,13 +122,17 @@
|
|
123
122
|
});
|
124
123
|
}
|
125
124
|
|
125
|
+
function page() {
|
126
|
+
return ahoy.page || window.location.pathname;
|
127
|
+
}
|
128
|
+
|
126
129
|
function eventProperties(e) {
|
127
130
|
var $target = $(e.currentTarget);
|
128
131
|
return {
|
129
132
|
tag: $target.get(0).tagName.toLowerCase(),
|
130
133
|
id: $target.attr("id"),
|
131
134
|
"class": $target.attr("class"),
|
132
|
-
page: page,
|
135
|
+
page: page(),
|
133
136
|
section: $target.closest("*[data-section]").data("section")
|
134
137
|
};
|
135
138
|
}
|
@@ -234,7 +237,7 @@
|
|
234
237
|
var properties = {
|
235
238
|
url: window.location.href,
|
236
239
|
title: document.title,
|
237
|
-
page: page
|
240
|
+
page: page()
|
238
241
|
};
|
239
242
|
ahoy.track("$view", properties);
|
240
243
|
};
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ahoy_matey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -269,4 +269,3 @@ summary: Simple, powerful visit tracking for Rails
|
|
269
269
|
test_files:
|
270
270
|
- test/test_helper.rb
|
271
271
|
- test/visit_properties_test.rb
|
272
|
-
has_rdoc:
|