snowplow-tracker 0.6.1 → 0.7.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/README.md +56 -37
- data/lib/snowplow-tracker/emitters.rb +355 -147
- data/lib/snowplow-tracker/page.rb +60 -0
- data/lib/snowplow-tracker/payload.rb +30 -34
- data/lib/snowplow-tracker/self_describing_json.rb +92 -9
- data/lib/snowplow-tracker/subject.rb +282 -59
- data/lib/snowplow-tracker/timestamp.rb +95 -23
- data/lib/snowplow-tracker/tracker.rb +547 -242
- data/lib/snowplow-tracker/version.rb +33 -4
- data/lib/snowplow-tracker.rb +5 -5
- metadata +15 -17
- data/lib/snowplow-tracker/contracts.rb +0 -29
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2013-
|
1
|
+
# Copyright (c) 2013-2021 Snowplow Analytics Ltd. All rights reserved.
|
2
2
|
#
|
3
3
|
# This program is licensed to you under the Apache License Version 2.0,
|
4
4
|
# and you may not use this file except in compliance with the Apache License Version 2.0.
|
@@ -9,11 +9,40 @@
|
|
9
9
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
10
|
# See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
|
11
11
|
|
12
|
-
# Author::
|
13
|
-
# Copyright:: Copyright (c) 2013-
|
12
|
+
# Author:: Snowplow Analytics Ltd
|
13
|
+
# Copyright:: Copyright (c) 2013-2021 Snowplow Analytics Ltd
|
14
14
|
# License:: Apache License Version 2.0
|
15
15
|
|
16
|
+
|
17
|
+
# The Snowplow Ruby Tracker allows you to track Snowplow events in your Ruby
|
18
|
+
# applications and gems and Ruby on Rails web applications.
|
19
|
+
#
|
20
|
+
# It is compatible with Ruby versions 2.1 to 3.0+.
|
21
|
+
#
|
22
|
+
# See the [demo Rails
|
23
|
+
# app](https://github.com/snowplow-incubator/snowplow-ruby-tracker-examples) to
|
24
|
+
# see an example of how to incorporate the Snowplow Ruby tracker in Ruby on
|
25
|
+
# Rails app.
|
26
|
+
#
|
27
|
+
# # Type checking
|
28
|
+
#
|
29
|
+
# This gem uses the [Contracts](https://github.com/egonSchiele/contracts.ruby)
|
30
|
+
# gem for typechecking. This cannot be disabled. The {Tracker} `track_x_event`
|
31
|
+
# methods expect arguments of a certain type. If a check fails, a runtime error
|
32
|
+
# is thrown.
|
33
|
+
#
|
34
|
+
# @see https://github.com/snowplow/snowplow-ruby-tracker
|
35
|
+
# Ruby tracker on Github
|
36
|
+
# @see https://github.com/snowplow-incubator/snowplow-ruby-tracker-examples
|
37
|
+
# Snowplow Ruby tracker examples in a demo Rails app
|
38
|
+
# @see https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/ruby-tracker/
|
39
|
+
# Snowplow documentation
|
40
|
+
# @see https://snowplowanalytics.com/ Snowplow homepage
|
41
|
+
# @api public
|
16
42
|
module SnowplowTracker
|
17
|
-
|
43
|
+
# The version of Ruby Snowplow tracker you are using
|
44
|
+
VERSION = '0.7.0'
|
45
|
+
|
46
|
+
# All events from this tracker will have this string
|
18
47
|
TRACKER_VERSION = "rb-#{VERSION}"
|
19
48
|
end
|
data/lib/snowplow-tracker.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2013-
|
1
|
+
# Copyright (c) 2013-2021 Snowplow Analytics Ltd. All rights reserved.
|
2
2
|
#
|
3
3
|
# This program is licensed to you under the Apache License Version 2.0,
|
4
4
|
# and you may not use this file except in compliance with the Apache License Version 2.0.
|
@@ -9,16 +9,16 @@
|
|
9
9
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
10
|
# See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
|
11
11
|
|
12
|
-
# Author::
|
13
|
-
# Copyright:: Copyright (c) 2013-
|
12
|
+
# Author:: Snowplow Analytics Ltd
|
13
|
+
# Copyright:: Copyright (c) 2013-2021 Snowplow Analytics Ltd
|
14
14
|
# License:: Apache License Version 2.0
|
15
15
|
|
16
|
-
|
16
|
+
|
17
17
|
require 'snowplow-tracker/version.rb'
|
18
18
|
require 'snowplow-tracker/self_describing_json.rb'
|
19
19
|
require 'snowplow-tracker/payload.rb'
|
20
20
|
require 'snowplow-tracker/subject.rb'
|
21
|
+
require 'snowplow-tracker/page.rb'
|
21
22
|
require 'snowplow-tracker/emitters.rb'
|
22
23
|
require 'snowplow-tracker/timestamp.rb'
|
23
24
|
require 'snowplow-tracker/tracker.rb'
|
24
|
-
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snowplow-tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
- Fred Blundun
|
7
|
+
- Snowplow Analytics Ltd
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2021-10-14 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: contracts
|
@@ -18,9 +17,9 @@ dependencies:
|
|
18
17
|
- - "~>"
|
19
18
|
- !ruby/object:Gem::Version
|
20
19
|
version: '0.7'
|
21
|
-
- - "
|
20
|
+
- - "<"
|
22
21
|
- !ruby/object:Gem::Version
|
23
|
-
version: '0.
|
22
|
+
version: '0.17'
|
24
23
|
type: :runtime
|
25
24
|
prerelease: false
|
26
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -28,37 +27,37 @@ dependencies:
|
|
28
27
|
- - "~>"
|
29
28
|
- !ruby/object:Gem::Version
|
30
29
|
version: '0.7'
|
31
|
-
- - "
|
30
|
+
- - "<"
|
32
31
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
32
|
+
version: '0.17'
|
34
33
|
- !ruby/object:Gem::Dependency
|
35
34
|
name: rspec
|
36
35
|
requirement: !ruby/object:Gem::Requirement
|
37
36
|
requirements:
|
38
37
|
- - "~>"
|
39
38
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
39
|
+
version: '3.10'
|
41
40
|
type: :development
|
42
41
|
prerelease: false
|
43
42
|
version_requirements: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
44
|
- - "~>"
|
46
45
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
46
|
+
version: '3.10'
|
48
47
|
- !ruby/object:Gem::Dependency
|
49
48
|
name: webmock
|
50
49
|
requirement: !ruby/object:Gem::Requirement
|
51
50
|
requirements:
|
52
51
|
- - "~>"
|
53
52
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
53
|
+
version: '3.14'
|
55
54
|
type: :development
|
56
55
|
prerelease: false
|
57
56
|
version_requirements: !ruby/object:Gem::Requirement
|
58
57
|
requirements:
|
59
58
|
- - "~>"
|
60
59
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
60
|
+
version: '3.14'
|
62
61
|
description: With this tracker you can collect event data from your Ruby applications,
|
63
62
|
Ruby on Rails web applications and Ruby gems.
|
64
63
|
email: support@snowplowanalytics.com
|
@@ -69,8 +68,8 @@ files:
|
|
69
68
|
- LICENSE-2.0.txt
|
70
69
|
- README.md
|
71
70
|
- lib/snowplow-tracker.rb
|
72
|
-
- lib/snowplow-tracker/contracts.rb
|
73
71
|
- lib/snowplow-tracker/emitters.rb
|
72
|
+
- lib/snowplow-tracker/page.rb
|
74
73
|
- lib/snowplow-tracker/payload.rb
|
75
74
|
- lib/snowplow-tracker/self_describing_json.rb
|
76
75
|
- lib/snowplow-tracker/subject.rb
|
@@ -79,7 +78,7 @@ files:
|
|
79
78
|
- lib/snowplow-tracker/version.rb
|
80
79
|
homepage: http://github.com/snowplow/snowplow-ruby-tracker
|
81
80
|
licenses:
|
82
|
-
- Apache
|
81
|
+
- Apache-2.0
|
83
82
|
metadata: {}
|
84
83
|
post_install_message:
|
85
84
|
rdoc_options: []
|
@@ -89,15 +88,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
88
|
requirements:
|
90
89
|
- - ">="
|
91
90
|
- !ruby/object:Gem::Version
|
92
|
-
version: 2.
|
91
|
+
version: '2.1'
|
93
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
93
|
requirements:
|
95
94
|
- - ">="
|
96
95
|
- !ruby/object:Gem::Version
|
97
96
|
version: '0'
|
98
97
|
requirements: []
|
99
|
-
|
100
|
-
rubygems_version: 2.6.8
|
98
|
+
rubygems_version: 3.0.3.1
|
101
99
|
signing_key:
|
102
100
|
specification_version: 4
|
103
101
|
summary: Ruby Analytics for Snowplow
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# Copyright (c) 2013-2014 Snowplow Analytics Ltd. All rights reserved.
|
2
|
-
#
|
3
|
-
# This program is licensed to you under the Apache License Version 2.0,
|
4
|
-
# and you may not use this file except in compliance with the Apache License Version 2.0.
|
5
|
-
# You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
|
6
|
-
#
|
7
|
-
# Unless required by applicable law or agreed to in writing,
|
8
|
-
# software distributed under the Apache License Version 2.0 is distributed on an
|
9
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
-
# See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
|
11
|
-
|
12
|
-
# Author:: Alex Dean, Fred Blundun (mailto:support@snowplowanalytics.com)
|
13
|
-
# Copyright:: Copyright (c) 2013-2014 Snowplow Analytics Ltd
|
14
|
-
# License:: Apache License Version 2.0
|
15
|
-
|
16
|
-
require 'contracts'
|
17
|
-
|
18
|
-
module SnowplowTracker
|
19
|
-
|
20
|
-
ORIGINAL_FAILURE_CALLBACK = Contract.method(:failure_callback)
|
21
|
-
|
22
|
-
def self.disable_contracts
|
23
|
-
Contract.define_singleton_method(:failure_callback) {|data| true}
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.enable_contracts
|
27
|
-
Contract.define_singleton_method(:failure_callback, ORIGINAL_FAILURE_CALLBACK)
|
28
|
-
end
|
29
|
-
end
|