kmts 3.0.3 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.travis.yml +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +7 -3
- data/doc/README_rdoc.html +22 -22
- data/kmts.gemspec +1 -1
- data/lib/kmts.rb +1 -1
- data/lib/kmts/version.rb +1 -1
- data/spec/km_saas_spec.rb +3 -3
- data/spec/km_spec.rb +1 -1
- metadata +16 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 63f20f75c5fb43e2daf45c420ef3eef9c3dd9b8d8cf69c40fe85d1be139d51fb
|
4
|
+
data.tar.gz: ef06b72bb06e217c103c6323670b77795a876e625225fbce8b7b8e39d828c000
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d3e134e167ea89b741083b0a3c974922cc9ee7dd227ec07b97ea8aceaadc1d04138ee271c6c90f2f9482427047671651044960e64a1ab7e23332315e9712ef7
|
7
|
+
data.tar.gz: c5df65fef48f3ddf437e4c6703734b800aff1b6c8348ef5a2a1a2b517a2485e4f2799dabb3aeb39a413c8d2b56371e1ced7d7508a7406c79376cb16b6e1138fd
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -6,6 +6,10 @@ This gem is a threadsafe fork of the original `km` gem.
|
|
6
6
|
|
7
7
|
Version 1.0.2 of the `kmts` gem had an issue where it was found to not actually be thread safe. If you were using version 1.0.2 of the `kmts` gem, you were likely using non thread-safe code. In this case, you will want to either switch to using the non thread-safe [`km`](https://github.com/kissmetrics/km) gem, or update your code to use the thread-safe `kmts` gem version >= 2.0.0.
|
8
8
|
|
9
|
+
## `kmts` version 3.1.0
|
10
|
+
|
11
|
+
Uses the `trk.kissmetrics.io` tracking domain.
|
12
|
+
|
9
13
|
## Setup
|
10
14
|
|
11
15
|
The best way to install the gem is using `gem install kmts` or by adding it to your `Gemfile`:
|
@@ -18,7 +22,7 @@ Otherwise, the gem is available on GitHub:
|
|
18
22
|
|
19
23
|
https://github.com/kissmetrics/kmts
|
20
24
|
|
21
|
-
You will need your API key which you can find in your [site settings](
|
25
|
+
You will need your API key which you can find in your [site settings](https://support.kissmetrics.io/docs/product-settings).
|
22
26
|
|
23
27
|
## Usage
|
24
28
|
|
@@ -30,7 +34,7 @@ KMTS.init('KM_KEY' [, options])
|
|
30
34
|
|
31
35
|
The available options are:
|
32
36
|
|
33
|
-
* `log_dir`: sets the logging directory. Default is `'/tmp'`. Please make sure that the directory exists, and that whatever web process is writing to the log has permission to write to that directory. The log file will contain a list of the URLs that would be requested (`trk.kissmetrics.
|
37
|
+
* `log_dir`: sets the logging directory. Default is `'/tmp'`. Please make sure that the directory exists, and that whatever web process is writing to the log has permission to write to that directory. The log file will contain a list of the URLs that would be requested (`trk.kissmetrics.io` URLs - please refer to [API Specifications](https://support.kissmetrics.io/reference#api-specifications-1).
|
34
38
|
* `use_cron`: toggles whether to send data directly to Kissmetrics, or log to a file and send in the background via cron (see [Sending Data with Cron](http://support.kissmetrics.com/apis/cron) for more information). As of version 3.0, the default is `true`, which means data is saved to a local log file. Using cron is optional, but **recommended**.
|
35
39
|
* `to_stderr`: allows toggling of printing output to `stderr`. Default is `true`.
|
36
40
|
* `dryrun`: New option as of November 25, 2012. Toggles whether to send data to Kissmetrics, or just log it to a file to review for debugging. Default is `false`, which means data is sent to Kissmetrics, regardless of whether you're working in a production or development environment.
|
@@ -57,7 +61,7 @@ KMTS.alias('bob', 'bob@bob.com')
|
|
57
61
|
|
58
62
|
## Troubleshooting
|
59
63
|
|
60
|
-
If you were watching for the events in [Kissmetrics Live](
|
64
|
+
If you were watching for the events in [Kissmetrics Live](https://support.kissmetrics.io/docs/live-1) and did not see them, it helps to review what our library logged. In the log directory, you may see these files:
|
61
65
|
|
62
66
|
* `kissmetrics_production_sent.log`
|
63
67
|
* `kissmetrics_production_query.log`
|
data/doc/README_rdoc.html
CHANGED
@@ -33,21 +33,21 @@
|
|
33
33
|
</div>
|
34
34
|
|
35
35
|
<div id="project-metadata">
|
36
|
-
|
37
|
-
|
36
|
+
|
37
|
+
|
38
38
|
<div id="fileindex-section" class="section project-section">
|
39
39
|
<h3 class="section-header">Files</h3>
|
40
40
|
<ul>
|
41
|
-
|
41
|
+
|
42
42
|
<li class="file"><a href="./Gemfile.html">Gemfile</a></li>
|
43
|
-
|
43
|
+
|
44
44
|
<li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
|
45
|
-
|
45
|
+
|
46
46
|
<li class="file"><a href="./Rakefile.html">Rakefile</a></li>
|
47
|
-
|
47
|
+
|
48
48
|
</ul>
|
49
49
|
</div>
|
50
|
-
|
50
|
+
|
51
51
|
|
52
52
|
<div id="classindex-section" class="section project-section">
|
53
53
|
<h3 class="section-header">Class Index
|
@@ -63,46 +63,46 @@
|
|
63
63
|
</form>
|
64
64
|
|
65
65
|
<ul class="link-list">
|
66
|
-
|
66
|
+
|
67
67
|
<li><a href="./KMTS.html">KMTS</a></li>
|
68
|
-
|
68
|
+
|
69
69
|
<li><a href="./KMTS/IdentError.html">KMTS::IdentError</a></li>
|
70
|
-
|
70
|
+
|
71
71
|
<li><a href="./KMTS/InitError.html">KMTS::InitError</a></li>
|
72
|
-
|
72
|
+
|
73
73
|
<li><a href="./KMTS/SaaS.html">KMTS::SaaS</a></li>
|
74
|
-
|
74
|
+
|
75
75
|
<li><a href="./Accept.html">Accept</a></li>
|
76
|
-
|
76
|
+
|
77
77
|
<li><a href="./Hash.html">Hash</a></li>
|
78
|
-
|
78
|
+
|
79
79
|
<li><a href="./Helper.html">Helper</a></li>
|
80
|
-
|
80
|
+
|
81
81
|
<li><a href="./KMError.html">KMError</a></li>
|
82
|
-
|
82
|
+
|
83
83
|
<li><a href="./Object.html">Object</a></li>
|
84
|
-
|
84
|
+
|
85
85
|
<li><a href="./String.html">String</a></li>
|
86
|
-
|
86
|
+
|
87
87
|
</ul>
|
88
88
|
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
89
89
|
</div>
|
90
90
|
|
91
|
-
|
91
|
+
|
92
92
|
</div>
|
93
93
|
</div>
|
94
94
|
|
95
95
|
<div id="documentation">
|
96
|
-
|
96
|
+
|
97
97
|
<h1>Documentation</h1>
|
98
98
|
|
99
99
|
<p>We are hosting our documentation for our Ruby API here: <a
|
100
|
-
href="
|
100
|
+
href="https://support.kissmetrics.io/reference#ruby">https://support.kissmetrics.io/reference#ruby</a></p>
|
101
101
|
|
102
102
|
<h1>SaaS</h1>
|
103
103
|
|
104
104
|
<p>This gem includes SaaS calls. For more information please refer to: <a
|
105
|
-
href="
|
105
|
+
href="https://support.kissmetrics.io/docs/saas-essentials">https://support.kissmetrics.io/docs/saas-essentials</a></p>
|
106
106
|
|
107
107
|
<p>In order to get the API for SaaS, be sure to:</p>
|
108
108
|
|
data/kmts.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.license = "Apache-2.0"
|
9
9
|
s.authors = ["Kissmetrics"]
|
10
|
-
s.email = ["support@kissmetrics.
|
10
|
+
s.email = ["support@kissmetrics.io"]
|
11
11
|
s.homepage = "https://github.com/kissmetrics/kmts"
|
12
12
|
s.summary = "Threadsafe Ruby gem for Kissmetrics tracking API"
|
13
13
|
s.description = "A threadsafe Ruby gem that can be used to interact with the Kissmetrics tracking API."
|
data/lib/kmts.rb
CHANGED
data/lib/kmts/version.rb
CHANGED
data/spec/km_saas_spec.rb
CHANGED
@@ -54,13 +54,13 @@ describe KMTS do
|
|
54
54
|
res[:query]['_n'].first.should == 'Canceled'
|
55
55
|
end
|
56
56
|
it "records a visited site event" do
|
57
|
-
KMTS.visited_site 'bob', 'http://duckduckgo.com', 'http://kissmetrics.
|
57
|
+
KMTS.visited_site 'bob', 'http://duckduckgo.com', 'http://kissmetrics.io'
|
58
58
|
sleep 0.1
|
59
59
|
res = Helper.accept(:history).first.indifferent
|
60
60
|
res[:path].should == '/e'
|
61
61
|
res[:query]['_n'].first.should == 'Visited Site'
|
62
62
|
res[:query]['URL'].first.should == 'http://duckduckgo.com'
|
63
|
-
res[:query]['Referrer'].first.should == 'http://kissmetrics.
|
63
|
+
res[:query]['Referrer'].first.should == 'http://kissmetrics.io'
|
64
64
|
end
|
65
65
|
end
|
66
66
|
context "usage with props" do
|
@@ -95,7 +95,7 @@ describe KMTS do
|
|
95
95
|
res[:query]['foo'].first.should == 'bar'
|
96
96
|
end
|
97
97
|
it "records a visited site event" do
|
98
|
-
KMTS.visited_site 'bob', 'http://duckduckgo.com', 'http://kissmetrics.
|
98
|
+
KMTS.visited_site 'bob', 'http://duckduckgo.com', 'http://kissmetrics.io', :foo => 'bar'
|
99
99
|
sleep 0.1
|
100
100
|
res = Helper.accept(:history).first.indifferent
|
101
101
|
res[:query]['foo'].first.should == 'bar'
|
data/spec/km_spec.rb
CHANGED
@@ -43,7 +43,7 @@ describe KMTS do
|
|
43
43
|
it "should allow sending to https endpoints" do
|
44
44
|
lambda do
|
45
45
|
allow(KMTS).to receive(:log_error).and_raise('Error')
|
46
|
-
KMTS::init 'KM_OTHER', :log_dir => __('log'), :host => 'https://trk.kissmetrics.
|
46
|
+
KMTS::init 'KM_OTHER', :log_dir => __('log'), :host => 'https://trk.kissmetrics.io/'
|
47
47
|
KMTS::record 'bob', 'My Action'
|
48
48
|
end.should_not raise_error
|
49
49
|
end
|
metadata
CHANGED
@@ -1,82 +1,82 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kmts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kissmetrics
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.13'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.13'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '3.5'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '3.5'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '12.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '12.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: json
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '2.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '2.0'
|
69
69
|
description: A threadsafe Ruby gem that can be used to interact with the Kissmetrics
|
70
70
|
tracking API.
|
71
71
|
email:
|
72
|
-
- support@kissmetrics.
|
72
|
+
- support@kissmetrics.io
|
73
73
|
executables:
|
74
74
|
- km_send
|
75
75
|
extensions: []
|
76
76
|
extra_rdoc_files: []
|
77
77
|
files:
|
78
|
-
- .gitignore
|
79
|
-
- .travis.yml
|
78
|
+
- ".gitignore"
|
79
|
+
- ".travis.yml"
|
80
80
|
- CHANGELOG
|
81
81
|
- Gemfile
|
82
82
|
- Gemfile.lock
|
@@ -157,17 +157,16 @@ require_paths:
|
|
157
157
|
- lib
|
158
158
|
required_ruby_version: !ruby/object:Gem::Requirement
|
159
159
|
requirements:
|
160
|
-
- -
|
160
|
+
- - ">="
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: '0'
|
163
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
164
|
requirements:
|
165
|
-
- -
|
165
|
+
- - ">="
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: 1.3.6
|
168
168
|
requirements: []
|
169
|
-
|
170
|
-
rubygems_version: 2.0.14.1
|
169
|
+
rubygems_version: 3.0.3
|
171
170
|
signing_key:
|
172
171
|
specification_version: 4
|
173
172
|
summary: Threadsafe Ruby gem for Kissmetrics tracking API
|