talon_one 0.0.10 → 0.1.0

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: f18f0015fc47df3940ed680ecea31d131be528b8
4
- data.tar.gz: 40b19f136345f6b6b9e46ffe3935025c95312a5b
3
+ metadata.gz: c9f994e537c582f172f740e93602c4e537632845
4
+ data.tar.gz: cf603ff40f4892e100aa0e5bf84b719339578312
5
5
  SHA512:
6
- metadata.gz: fb9274252cd2350a2556835aea585903bf6fb90bca74bbdb11f3d69ecb084c22e3609238860c4bcf385c71cefe817d7cb1f5a718df3ad97c8f38dfa340a2196c
7
- data.tar.gz: 545b4c5400fb59d2c112d8b4cf4633170dea301b15f0e47eb1c08089105d29a6d0f8a47d9fa1b3c4880516352bc3ffdca1652cdf2e714a37fba175ef42a7eba5
6
+ metadata.gz: 3d513e65fb61c2931b5f3f368d6e605858112c83d37a9182f8879b3694d4655b46ad6cdac9c63cb13d2544f5cb0756624efdfcb976bb6d30ab2ac52ef4311474
7
+ data.tar.gz: 0fb1ffb44c1936f7518180ec9d6f104a64f62739b03d3abb921acf1f962572d3d4cf72360538c350d121b1c3ccd5b5653b938d7d22e7933dbf31639194a3dc86
@@ -1,3 +1,7 @@
1
+ # 0.1.0 / 2017-07-25
2
+
3
+ * [BUG] talon_one.rb is now compatible wit Oj version 3 and above (bumped the minimum version to 3.0)
4
+
1
5
  # 0.0.10 / 2017-06-13
2
6
 
3
7
  * [FEATURE] Throw custom errors in stead of general RunTime errors whenever the API returns a 400
@@ -24,7 +24,7 @@ module TalonOne
24
24
 
25
25
  def request(method, path, payload = nil, result = TalonOne::Integration::RuleEngineResult)
26
26
  req = Net::HTTP.const_get(method).new(@endpoint.path + path)
27
- req.body = Oj.dump payload, oj_options(:compat)
27
+ req.body = Oj.dump payload, oj_options(:custom)
28
28
  signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('md5'), @application_key, req.body)
29
29
 
30
30
  req['Content-Type'] = 'application/json'
@@ -81,7 +81,8 @@ module TalonOne
81
81
  :class_cache => false,
82
82
  :escape_mode => :json,
83
83
  :bigdecimal_as_decimal => true,
84
- :bigdecimal_load => :bigdecimal }
84
+ :bigdecimal_load => :bigdecimal,
85
+ :use_as_json => true }
85
86
  end
86
87
  end
87
88
  end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'talon_one'
3
- s.version = '0.0.10'
4
- s.date = '2017-06-13'
3
+ s.version = '0.1.0'
4
+ s.date = '2017-07-25'
5
5
  s.summary = 'Client for the Talon.One API'
6
6
  s.description = 'A simple client for using the Talon.One API'
7
7
  s.authors = ['Talon.One GmbH']
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.require_paths = ['lib']
12
12
  s.homepage = 'https://github.com/talon-one/talon-one.rb'
13
13
  s.license = 'MIT'
14
- s.add_runtime_dependency 'oj', '~> 2.17'
14
+ s.add_runtime_dependency 'oj', '~> 3.0'
15
15
  s.add_development_dependency 'rake', '~> 12.0.0'
16
16
  s.add_development_dependency 'minitest', '~> 5.10.1'
17
17
  end
@@ -53,6 +53,27 @@ class TestIntegrationApiLive < LiveApiTest
53
53
  assert res.event.rejected_coupon?, "invalid coupon code was rejected"
54
54
  end
55
55
 
56
+ def test_oj_calls_as_json
57
+ payload_class = Class.new do
58
+ attr_reader :as_json_was_called
59
+ def as_json
60
+ @as_json_was_called = true
61
+ return { URL: "http://example.com" }
62
+ end
63
+ end
64
+
65
+ payload = payload_class.new
66
+
67
+ res = integration_client.track_event "another-session", @event_type, payload
68
+ assert res.profile
69
+ assert payload.as_json_was_called
70
+ end
71
+
72
+ def test_close_customer_session
73
+ res = integration_client.close_customer_session "new_session"
74
+ assert res.profile
75
+ end
76
+
56
77
  def test_raise_error
57
78
  err = assert_raises TalonOne::Integration::ClientError do
58
79
  integration_client.track_event "a-session", @event_type, { BADURL: "http://example.com" }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: talon_one
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Talon.One GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-13 00:00:00.000000000 Z
11
+ date: 2017-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.17'
19
+ version: '3.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.17'
26
+ version: '3.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement