koko-ai-ruby 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6c9f7847f52c86060024c1a7bec1db9f8b39a49
4
- data.tar.gz: fad4787b80d50b0f36732fd71a71b4f7d4cc2f7c
3
+ metadata.gz: 7718b43091569d38e26692700e0b3dddfb6a9e1d
4
+ data.tar.gz: b2e48ee20b1f5e83c8c994f00103f239783d8e4a
5
5
  SHA512:
6
- metadata.gz: 56e286ac11ca9a577d53ad7db99993449208e49e3a6829b6a80f8f8a899fc71e5fb2e70e8f33795e0123c563d47d7a923e412be6f8e886e75842afad5a8be089
7
- data.tar.gz: 6ec716712c6c44c5699fe89b867529d909bfb9a320ddf9ee766c5200c54b45e03b2d958416a24ca2498cf5d02b2847ab39a89b5c0c2493c12518f8497b7d1877
6
+ metadata.gz: 6f304d49508b43648afea8b7e9050e8adee18de2a0b8b7329e6c7123c910194de1e50351c282cee9ba6c6c8ac39c70ee8566a4d0c97367894ad7d011f0c6d1dd
7
+ data.tar.gz: b8f11cae45d881d64c86fc489b877d1d3b3f65634707806f7deaca922a2e23b9f1498dc99bbf0a3d81624c182504f78d6422f4d1412b3df8f322be72a3e3305b
data/History.md CHANGED
@@ -23,3 +23,8 @@
23
23
  ==================
24
24
 
25
25
  * Return body directly instead of using block
26
+
27
+ 0.0.6 / 2017-07-10
28
+ ==================
29
+
30
+ * Use iso8601 serialization for created_at time
@@ -30,7 +30,7 @@ module Koko
30
30
 
31
31
  timestamp = attrs[:created_at] || Time.now
32
32
  check_timestamp! timestamp
33
- attrs[:created_at] = timestamp
33
+ attrs[:created_at] = timestamp.iso8601
34
34
 
35
35
  handle_response(Request.new(path: '/track/content').post(@auth, attrs)).body
36
36
  end
@@ -43,7 +43,7 @@ module Koko
43
43
 
44
44
  timestamp = attrs[:created_at] || Time.now
45
45
  check_timestamp! timestamp
46
- attrs[:created_at] = timestamp
46
+ attrs[:created_at] = timestamp.iso8601
47
47
 
48
48
  handle_response(Request.new(path: '/track/flag').post(@auth, attrs)).body
49
49
  end
@@ -56,7 +56,7 @@ module Koko
56
56
 
57
57
  timestamp = attrs[:created_at] || Time.now
58
58
  check_timestamp! timestamp
59
- attrs[:created_at] = timestamp
59
+ attrs[:created_at] = timestamp.iso8601
60
60
 
61
61
  handle_response(Request.new(path: '/track/moderation').post(@auth, attrs)).body
62
62
  end
@@ -1,5 +1,5 @@
1
1
  module Koko
2
2
  class Tracker
3
- VERSION = '0.0.5'
3
+ VERSION = '0.0.6'
4
4
  end
5
5
  end
@@ -52,14 +52,14 @@ module Koko
52
52
  it 'uses the current time if no timestamp is given' do
53
53
  client.track_content(Factory.content.merge("created_at" => nil))
54
54
 
55
- expected_body = JSON.generate(Factory.content.merge("created_at" => Time.now))
55
+ expected_body = JSON.generate(Factory.content.merge("created_at" => Time.now.iso8601))
56
56
  expect(WebMock).to have_requested(:post, "https://#{Defaults::Request.host}/track/content").with(body: expected_body)
57
57
  end
58
58
 
59
59
  it 'makes the correct request converting created_at time to iso8601 string' do
60
60
  client.track_content Factory.content
61
61
 
62
- expected_body = JSON.generate(Factory.content.merge("created_at" => Factory.content["created_at"]))
62
+ expected_body = JSON.generate(Factory.content.merge("created_at" => Factory.content["created_at"].iso8601))
63
63
  expect(WebMock).to have_requested(:post, "https://#{Defaults::Request.host}/track/content").with(body: expected_body)
64
64
  end
65
65
 
@@ -90,7 +90,7 @@ module Koko
90
90
  it 'makes the correct request converting created_at time to float' do
91
91
  client.track_flag Factory.flag
92
92
 
93
- expected_body = JSON.generate(Factory.flag.merge("created_at" => Factory.flag["created_at"]))
93
+ expected_body = JSON.generate(Factory.flag.merge("created_at" => Factory.flag["created_at"].iso8601))
94
94
  expect(WebMock).to have_requested(:post, "https://#{Defaults::Request.host}/track/flag").with(body: expected_body)
95
95
  end
96
96
  end
@@ -115,7 +115,7 @@ module Koko
115
115
  it 'makes the correct request converting created_at time to float' do
116
116
  client.track_moderation Factory.moderation
117
117
 
118
- expected_body = JSON.generate(Factory.moderation.merge("created_at" => Factory.moderation["created_at"]))
118
+ expected_body = JSON.generate(Factory.moderation.merge("created_at" => Factory.moderation["created_at"].iso8601))
119
119
  expect(WebMock).to have_requested(:post, "https://#{Defaults::Request.host}/track/moderation").with(body: expected_body)
120
120
  end
121
121
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: koko-ai-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koko