attune 1.0.18 → 1.0.19
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 +4 -4
- data/lib/attune/api/anonymous.rb +15 -7
- data/lib/attune/api/entities.rb +5 -0
- data/lib/attune/client.rb +1 -0
- data/lib/attune/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b26a5ce9488e71f446ba80b2b94789feb09aab2
|
4
|
+
data.tar.gz: 215c0dcda038d104fcf18cdfbab70da29a90917e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bfd7de5fdb268f6e936e2a9f37faa09a294182637568a254add24cb93efbfed62dfb86166c745b0afd8c621b30d61f6d370d5cc15e45e2b925f3eb49bef04d5
|
7
|
+
data.tar.gz: 48c0c3099e0e7c306bdde4a6da577ce798a2ea41622e0bd8423945d07ddb8db4c14b0994c20b01b30afb9a73584909b14235ea609fcb184ba61de47f030316ef
|
data/lib/attune/api/anonymous.rb
CHANGED
@@ -33,10 +33,10 @@ module Attune
|
|
33
33
|
|
34
34
|
headers = nil
|
35
35
|
post_body = nil
|
36
|
-
response = @client.request(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body })
|
37
|
-
if response
|
38
|
-
|
39
|
-
else
|
36
|
+
#response = @client.request(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body })
|
37
|
+
#if response
|
38
|
+
# Attune::Model::AnonymousResult.new(JSON.parse(response.body))
|
39
|
+
#else
|
40
40
|
mockProc = MOCKS['Anonymous.create']
|
41
41
|
if mockProc
|
42
42
|
mockResponse = mockProc.call()
|
@@ -44,7 +44,7 @@ module Attune
|
|
44
44
|
else
|
45
45
|
nil
|
46
46
|
end
|
47
|
-
end
|
47
|
+
#end
|
48
48
|
|
49
49
|
end
|
50
50
|
|
@@ -59,7 +59,11 @@ module Attune
|
|
59
59
|
query_param_keys = []
|
60
60
|
|
61
61
|
# verify existence of params
|
62
|
-
raise ArgumentError, "anonymous is required" if anonymous.nil?
|
62
|
+
#raise ArgumentError, "anonymous is required" if anonymous.nil?
|
63
|
+
if anonymous == nil
|
64
|
+
anonymous = SecureRandom.uuid
|
65
|
+
end
|
66
|
+
|
63
67
|
raise ArgumentError, "body is required" if body.nil?
|
64
68
|
# set default values and merge with input
|
65
69
|
options = {
|
@@ -112,7 +116,11 @@ module Attune
|
|
112
116
|
query_param_keys = []
|
113
117
|
|
114
118
|
# verify existence of params
|
115
|
-
raise ArgumentError, "anonymous is required" if anonymous.nil?
|
119
|
+
# raise ArgumentError, "anonymous is required" if anonymous.nil?
|
120
|
+
if anonymous == nil
|
121
|
+
anonymous = SecureRandom.uuid
|
122
|
+
end
|
123
|
+
|
116
124
|
# set default values and merge with input
|
117
125
|
options = {
|
118
126
|
:anonymous => anonymous}
|
data/lib/attune/api/entities.rb
CHANGED
@@ -301,6 +301,11 @@ module Attune
|
|
301
301
|
end
|
302
302
|
end
|
303
303
|
end
|
304
|
+
|
305
|
+
if !post_body.has_key?("anonymous".to_sym)
|
306
|
+
post_body['anonymous'] = SecureRandom.uuid
|
307
|
+
end
|
308
|
+
|
304
309
|
response = @client.request(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body })
|
305
310
|
if response
|
306
311
|
Attune::Model::RankedEntities.new(JSON.parse(response.body))
|
data/lib/attune/client.rb
CHANGED
@@ -70,6 +70,7 @@ module Attune
|
|
70
70
|
adapter_method.call do |req|
|
71
71
|
req.url path
|
72
72
|
req.headers['Content-Type'] = 'application/json'
|
73
|
+
req.headers['User-Agent'] = 'Attune RClient ' + Attune::VERSION
|
73
74
|
req.headers.merge! opts[:headers] if opts[:headers]
|
74
75
|
req.params = opts[:params] if opts[:params]
|
75
76
|
req.body = ::JSON.dump(opts[:body]) if opts[:body]
|
data/lib/attune/version.rb
CHANGED