snowplow-tracker 0.6.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +58 -36
- data/lib/snowplow-tracker/emitters.rb +339 -154
- data/lib/snowplow-tracker/page.rb +55 -0
- data/lib/snowplow-tracker/payload.rb +28 -39
- data/lib/snowplow-tracker/self_describing_json.rb +92 -9
- data/lib/snowplow-tracker/subject.rb +289 -68
- data/lib/snowplow-tracker/timestamp.rb +93 -25
- data/lib/snowplow-tracker/tracker.rb +521 -257
- data/lib/snowplow-tracker/version.rb +26 -4
- data/lib/snowplow-tracker.rb +5 -5
- metadata +11 -33
- 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,33 @@
|
|
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
|
+
# @see https://github.com/snowplow/snowplow-ruby-tracker
|
28
|
+
# Ruby tracker on Github
|
29
|
+
# @see https://github.com/snowplow-incubator/snowplow-ruby-tracker-examples
|
30
|
+
# Snowplow Ruby tracker examples in a demo Rails app
|
31
|
+
# @see https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/ruby-tracker/
|
32
|
+
# Snowplow documentation
|
33
|
+
# @see https://snowplowanalytics.com/ Snowplow homepage
|
34
|
+
# @api public
|
16
35
|
module SnowplowTracker
|
17
|
-
|
36
|
+
# The version of Ruby Snowplow tracker you are using
|
37
|
+
VERSION = '0.8.0'
|
38
|
+
|
39
|
+
# All events from this tracker will have this string
|
18
40
|
TRACKER_VERSION = "rb-#{VERSION}"
|
19
41
|
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,64 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snowplow-tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.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-29 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: contracts
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - "~>"
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '0.7'
|
21
|
-
- - "<="
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: '0.11'
|
24
|
-
type: :runtime
|
25
|
-
prerelease: false
|
26
|
-
version_requirements: !ruby/object:Gem::Requirement
|
27
|
-
requirements:
|
28
|
-
- - "~>"
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
version: '0.7'
|
31
|
-
- - "<="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0.11'
|
34
13
|
- !ruby/object:Gem::Dependency
|
35
14
|
name: rspec
|
36
15
|
requirement: !ruby/object:Gem::Requirement
|
37
16
|
requirements:
|
38
17
|
- - "~>"
|
39
18
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
19
|
+
version: '3.10'
|
41
20
|
type: :development
|
42
21
|
prerelease: false
|
43
22
|
version_requirements: !ruby/object:Gem::Requirement
|
44
23
|
requirements:
|
45
24
|
- - "~>"
|
46
25
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
26
|
+
version: '3.10'
|
48
27
|
- !ruby/object:Gem::Dependency
|
49
28
|
name: webmock
|
50
29
|
requirement: !ruby/object:Gem::Requirement
|
51
30
|
requirements:
|
52
31
|
- - "~>"
|
53
32
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
33
|
+
version: '3.14'
|
55
34
|
type: :development
|
56
35
|
prerelease: false
|
57
36
|
version_requirements: !ruby/object:Gem::Requirement
|
58
37
|
requirements:
|
59
38
|
- - "~>"
|
60
39
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
40
|
+
version: '3.14'
|
62
41
|
description: With this tracker you can collect event data from your Ruby applications,
|
63
42
|
Ruby on Rails web applications and Ruby gems.
|
64
43
|
email: support@snowplowanalytics.com
|
@@ -69,8 +48,8 @@ files:
|
|
69
48
|
- LICENSE-2.0.txt
|
70
49
|
- README.md
|
71
50
|
- lib/snowplow-tracker.rb
|
72
|
-
- lib/snowplow-tracker/contracts.rb
|
73
51
|
- lib/snowplow-tracker/emitters.rb
|
52
|
+
- lib/snowplow-tracker/page.rb
|
74
53
|
- lib/snowplow-tracker/payload.rb
|
75
54
|
- lib/snowplow-tracker/self_describing_json.rb
|
76
55
|
- lib/snowplow-tracker/subject.rb
|
@@ -79,7 +58,7 @@ files:
|
|
79
58
|
- lib/snowplow-tracker/version.rb
|
80
59
|
homepage: http://github.com/snowplow/snowplow-ruby-tracker
|
81
60
|
licenses:
|
82
|
-
- Apache
|
61
|
+
- Apache-2.0
|
83
62
|
metadata: {}
|
84
63
|
post_install_message:
|
85
64
|
rdoc_options: []
|
@@ -89,15 +68,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
68
|
requirements:
|
90
69
|
- - ">="
|
91
70
|
- !ruby/object:Gem::Version
|
92
|
-
version: 2.
|
71
|
+
version: '2.1'
|
93
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
73
|
requirements:
|
95
74
|
- - ">="
|
96
75
|
- !ruby/object:Gem::Version
|
97
76
|
version: '0'
|
98
77
|
requirements: []
|
99
|
-
|
100
|
-
rubygems_version: 2.6.8
|
78
|
+
rubygems_version: 3.0.3.1
|
101
79
|
signing_key:
|
102
80
|
specification_version: 4
|
103
81
|
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
|