attune 1.0.18 → 1.0.19

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: b82bbe147e7a55657adf794d2bc4eb8674f83df8
4
- data.tar.gz: 9f65ceb0b571d5ff090133f94dfb9b95b10b2f10
3
+ metadata.gz: 5b26a5ce9488e71f446ba80b2b94789feb09aab2
4
+ data.tar.gz: 215c0dcda038d104fcf18cdfbab70da29a90917e
5
5
  SHA512:
6
- metadata.gz: 6a69cc215591ced45b1734d538ea381281dcdc9e506b37a2a180e26048449bb8b1a788f2e87bfa807a53b1c51ee623796350ce1161ebea8400f3f79aa9eb3bd3
7
- data.tar.gz: 3dd50cb6a319c97f33ecf1b3116da189fe2d2f64c502b3bd14a203012007f483d76e37ab39436164e8ce8300bd5e989c64c221a048130182c8971b84619ddbe0
6
+ metadata.gz: 0bfd7de5fdb268f6e936e2a9f37faa09a294182637568a254add24cb93efbfed62dfb86166c745b0afd8c621b30d61f6d370d5cc15e45e2b925f3eb49bef04d5
7
+ data.tar.gz: 48c0c3099e0e7c306bdde4a6da577ce798a2ea41622e0bd8423945d07ddb8db4c14b0994c20b01b30afb9a73584909b14235ea609fcb184ba61de47f030316ef
@@ -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
- Attune::Model::AnonymousResult.new(JSON.parse(response.body))
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}
@@ -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))
@@ -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]
@@ -1,4 +1,4 @@
1
1
  module Attune
2
- VERSION = "1.0.18"
2
+ VERSION = "1.0.19"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attune
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.18
4
+ version: 1.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Hawthorn