tealium 1.0.0 → 1.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86f222b3ecfed442dab500f3b9d25b4d2364c606d259ab7ac6e7e3c3cbe06f08
4
- data.tar.gz: 95ddd26ea3ffedcc8e9f79c833acad54a702ab10128eba47da1776f74475e95a
3
+ metadata.gz: 77960e2ff1395cb54b52e1c638559c95fef33d6b472653128a6bcd8a71f130b0
4
+ data.tar.gz: a5e6f98bd8335537477b7599e76aca9b5427113f29eccc897af232a80ede081b
5
5
  SHA512:
6
- metadata.gz: db7698180543c70d65f867091acaf7aa14905718301abeedf6e47658075664bebfdb86527e9f797a5daa98bd553b7b6b44be2929ad41f0715a228819188b3d19
7
- data.tar.gz: c04a834fb37b373ea7ce872cc5835757a87423e4effac3eec260072ac306d971046e188b2cad2b8ab334285b604b6748d32d6eb253633267cf34f8d433de5065
6
+ metadata.gz: 478216433cf6cac8a07330264224c18af2fd066e4f8995c9676c2b252bbe3040f57e40b85104a7e7396eaa92bea80676f8bf9e11503465bb8c5b2de23fc3c984
7
+ data.tar.gz: e2c1ee549d45f07b6c1e169d242a4ad4db3af1e11a7cad9189e7af77afb5c5595ba0224ff28db1440cea7a70055ea2c2acefce7231307c6f0b4fa6f3a98f086d
data/lib/tealium.rb CHANGED
@@ -2,6 +2,7 @@ require 'tealium_collect'
2
2
 
3
3
  class Tealium
4
4
  attr_accessor :account, :profile, :datasource
5
+
5
6
  def initialize(account, profile, datasource = nil)
6
7
  @account = account
7
8
  @profile = profile
@@ -12,12 +13,9 @@ class Tealium
12
13
  data = Hash.new
13
14
  data[:tealium_account] = @account
14
15
  data[:tealium_profile] = @profile
15
-
16
- if (!@datasource.nil?)
17
- data[:tealium_datasource]
18
- end
19
-
16
+ data[:tealium_datasource] = @datasource if @datasource
20
17
  data[:tealium_event] = event_name
18
+
21
19
  payload = data.merge(custom_data)
22
20
  TealiumCollect.collect(payload)
23
21
  end
@@ -4,27 +4,28 @@ require 'json'
4
4
 
5
5
  class TealiumCollect
6
6
  LIBRARY_NAME = "ruby"
7
- LIBRARY_VERSION = "1.0.0"
7
+ LIBRARY_VERSION = "1.0.3"
8
8
 
9
9
  def self.collect(payload)
10
10
  uri = URI.parse("https://collect.tealiumiq.com/event")
11
11
  header = {'Content-type': 'application/json'}
12
- http = Net::HTTP.new(uri.host)
12
+ https = Net::HTTP.new(uri.host, uri.port)
13
+ https.use_ssl = true
13
14
  request = Net::HTTP::Post.new(uri.request_uri, header)
14
15
  payload[:tealium_library_name] = LIBRARY_NAME
15
16
  payload[:tealium_library_version] = LIBRARY_VERSION
16
17
 
17
- request.body = payload.to_json
18
- response = http.request(request)
18
+ request.body = payload.to_json
19
+ response = https.request(request)
19
20
 
20
- #uncomment the line below for debugging
21
- #checkRequestResponse(response)
21
+ #uncomment the line below for debugging
22
+ #checkRequestResponse(response)
22
23
  end
23
24
 
24
25
  def checkRequestResponse(response)
25
26
  case response
26
27
  when Net::HTTPOK
27
- puts "Data sent to Tealum: " + response.message
28
+ puts "Data sent to Tealium: " + response.message
28
29
 
29
30
  else
30
31
  puts "Error sending data: " + response.message
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tealium
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tealium
@@ -10,7 +10,8 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2019-01-31 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Tealium gem sends json payload to Tealium's HTTP API
13
+ description: Add the Tealium gem to track activity and send data using Tealium's HTTP
14
+ API
14
15
  email:
15
16
  executables: []
16
17
  extensions: []
@@ -30,15 +31,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
30
31
  requirements:
31
32
  - - ">="
32
33
  - !ruby/object:Gem::Version
33
- version: '0'
34
+ version: 2.3.4
34
35
  required_rubygems_version: !ruby/object:Gem::Requirement
35
36
  requirements:
36
37
  - - ">="
37
38
  - !ruby/object:Gem::Version
38
39
  version: '0'
39
40
  requirements: []
40
- rubyforge_project:
41
- rubygems_version: 2.7.8
41
+ rubygems_version: 3.0.3.1
42
42
  signing_key:
43
43
  specification_version: 4
44
44
  summary: Tealium Collect for Ruby