From f8994b84c54f21c9fd382396b377dddc8d687105 Mon Sep 17 00:00:00 2001 From: Anton Parkhomenko Date: Mon, 26 Dec 2016 15:00:15 +0700 Subject: [PATCH 1/2] Update payload_data schema to 1-0-4 (close #102) --- lib/snowplow-tracker/emitters.rb | 4 ++-- spec/unit/emitters_spec.rb | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/snowplow-tracker/emitters.rb b/lib/snowplow-tracker/emitters.rb index f806ebd..09c75d1 100644 --- a/lib/snowplow-tracker/emitters.rb +++ b/lib/snowplow-tracker/emitters.rb @@ -114,14 +114,14 @@ def send_requests(evts) LOGGER.info("Attempting to send #{evts.size} request#{evts.size == 1 ? '' : 's'}") evts.each do |event| - event['stm'] = (Time.now.to_f * 1000).to_i # add the sent timestamp, overwrite if already exists + event['stm'] = (Time.now.to_f * 1000).to_i.to_s # add the sent timestamp, overwrite if already exists end if @method == 'post' post_succeeded = false begin request = http_post(SelfDescribingJson.new( - 'iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-2', + 'iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4', evts ).to_json) post_succeeded = is_good_status_code(request.code) diff --git a/spec/unit/emitters_spec.rb b/spec/unit/emitters_spec.rb index 838afeb..c0ac448 100644 --- a/spec/unit/emitters_spec.rb +++ b/spec/unit/emitters_spec.rb @@ -1,4 +1,4 @@ -# Copyright (c) 2013-2014 Snowplow Analytics Ltd. All rights reserved. +# Copyright (c) 2013-2016 Snowplow Analytics Ltd. All rights reserved. # # This program is licensed to you under the Apache License Version 2.0, # and you may not use this file except in compliance with the Apache License Version 2.0. @@ -10,7 +10,7 @@ # See the Apache License Version 2.0 for the specific language governing permissions and limitations there under. # Author:: Alex Dean, Fred Blundun (mailto:support@snowplowanalytics.com) -# Copyright:: Copyright (c) 2013-2014 Snowplow Analytics Ltd +# Copyright:: Copyright (c) 2013-2016 Snowplow Analytics Ltd # License:: Apache License Version 2.0 #require 'spec_helper' @@ -100,16 +100,16 @@ class Emitter sent = JSON.parse(emitter.get_last_body(1)) puts sent - expect(sent['schema']).to eq("iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-2") + expect(sent['schema']).to eq("iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4") expect(sent['data'][0]['key1']).to eq("value1") - expect(sent['data'][0]['stm'].round(-4)).to eq((Time.now.to_f * 1000).to_i.round(-4)) + expect(sent['data'][0]['stm'].to_i.round(-4)).to eq((Time.now.to_f * 1000).to_i.round(-4)) expect(sent['data'][1]['key2']).to eq("value2") - expect(sent['data'][1]['stm'].round(-4)).to eq((Time.now.to_f * 1000).to_i.round(-4)) + expect(sent['data'][1]['stm'].to_i.round(-4)).to eq((Time.now.to_f * 1000).to_i.round(-4)) expect(sent['data'][2]['key3']).to eq("value3") - expect(sent['data'][2]['stm'].round(-4)).to eq((Time.now.to_f * 1000).to_i.round(-4)) + expect(sent['data'][2]['stm'].to_i.round(-4)).to eq((Time.now.to_f * 1000).to_i.round(-4)) end end From f2a4919f311e3e5e4cd744c6f2d0556d18a93ce0 Mon Sep 17 00:00:00 2001 From: Anton Parkhomenko Date: Mon, 26 Dec 2016 15:03:22 +0700 Subject: [PATCH 2/2] Prepared for release --- CHANGELOG | 4 ++++ README.md | 2 +- lib/snowplow-tracker/version.rb | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e491914..7c5c353 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +Version 0.6.1 (2016-12-26) +-------------------------- +Update payload_data schema to 1-0-4 (#102) + Version 0.6.0 (2016-08-18) -------------------------- Support Ruby 2.2.5 and 2.3.1 (#100) diff --git a/README.md b/README.md index 16d7906..dac689f 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ guest$ rspec ## Copyright and license -The Snowplow Ruby Tracker is copyright 2013-2014 Snowplow Analytics Ltd. +The Snowplow Ruby Tracker is copyright 2013-2016 Snowplow Analytics Ltd. Licensed under the **[Apache License, Version 2.0] [license]** (the "License"); you may not use this software except in compliance with the License. diff --git a/lib/snowplow-tracker/version.rb b/lib/snowplow-tracker/version.rb index 67f077e..18bde7b 100644 --- a/lib/snowplow-tracker/version.rb +++ b/lib/snowplow-tracker/version.rb @@ -14,6 +14,6 @@ # License:: Apache License Version 2.0 module SnowplowTracker - VERSION = '0.6.0' + VERSION = '0.6.1' TRACKER_VERSION = "rb-#{VERSION}" end