Skip to content

Commit

Permalink
Merge pull request #103 from snowplow/release/0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
chuwy committed Dec 26, 2016
2 parents a250e55 + f2a4919 commit 39fcfa2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions 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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions lib/snowplow-tracker/emitters.rb
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/snowplow-tracker/version.rb
Expand Up @@ -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
12 changes: 6 additions & 6 deletions 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.
Expand All @@ -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'
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 39fcfa2

Please sign in to comment.