gosquared 3.0.6 → 3.0.7
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/gosquared/client.rb +4 -4
- data/spec/account_spec.rb +2 -2
- data/spec/tracking_spec.rb +3 -3
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 591265182e4e5898f3bb73eec0b53bff8473210b
|
4
|
+
data.tar.gz: e42f68999d291a84f02f01cf44eabda722463ce5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 902168134149ddcfc2bf8c525b548f10e879a88c6ab4c2b01481860460862d0fdbe9031114409a48afb0d046d3ce25de0a33b8e8da06e91b33a6deee47aeb0fb
|
7
|
+
data.tar.gz: 26ec10fb9b56191e0afd977b71ce7d4033b1332097ccdce7fcdfdfbf46c46feafb603a570cf8dda4c8c2ecfd63e51e4b820d62a08e4fe2f3152fe6838dc1b875
|
data/lib/gosquared/client.rb
CHANGED
@@ -28,7 +28,7 @@ module Gosquared
|
|
28
28
|
https = Net::HTTP.new(uri.host, uri.port)
|
29
29
|
https.use_ssl = true
|
30
30
|
request = Net::HTTP::Post.new(uri.request_uri, initheader = {'Content-Type' =>'application/json', 'User-Agent' => 'ruby-client/'+ VERSION})
|
31
|
-
request.body = "[
|
31
|
+
request.body = "[#{data.to_json}]"
|
32
32
|
response = https.request(request)
|
33
33
|
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
|
34
34
|
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e
|
@@ -40,7 +40,7 @@ module Gosquared
|
|
40
40
|
response = false
|
41
41
|
end
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
response
|
45
45
|
end
|
46
46
|
|
@@ -50,7 +50,7 @@ module Gosquared
|
|
50
50
|
https = Net::HTTP.new(uri.host, uri.port)
|
51
51
|
https.use_ssl = true
|
52
52
|
request = Net::HTTP::Delete.new(uri.request_uri, initheader = {'Content-Type' =>'application/json'})
|
53
|
-
request.body = "[
|
53
|
+
request.body = "[#{data.to_json}]"
|
54
54
|
response = https.request(request)
|
55
55
|
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
|
56
56
|
Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e
|
@@ -62,7 +62,7 @@ module Gosquared
|
|
62
62
|
response = false
|
63
63
|
end
|
64
64
|
end
|
65
|
-
|
65
|
+
|
66
66
|
response
|
67
67
|
end
|
68
68
|
|
data/spec/account_spec.rb
CHANGED
@@ -33,11 +33,11 @@ describe Gosquared::Account do
|
|
33
33
|
|
34
34
|
before do
|
35
35
|
stub_request(:post, "https://api.gosquared.com/account/v1/blocked/ips?api_key=demo&ip=20.15.33.99&site_token=GSN-2194840-F").
|
36
|
-
with(:body => "[
|
36
|
+
with(:body => "[\"\"]",
|
37
37
|
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json'}).
|
38
38
|
to_return(:status => 200, :body => "", :headers => {})
|
39
39
|
stub_request(:delete, "https://api.gosquared.com/account/v1/blocked/ips?api_key=demo&ip=20.15.33.99&site_token=GSN-2194840-F").
|
40
|
-
with(:body => "[
|
40
|
+
with(:body => "[\"\"]",
|
41
41
|
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json'}).
|
42
42
|
to_return(:status => 200, :body => "", :headers => {})
|
43
43
|
end
|
data/spec/tracking_spec.rb
CHANGED
@@ -6,7 +6,7 @@ describe Gosquared::Tracking do
|
|
6
6
|
Gosquared::Tracking::DIMENSIONS.each do |dimension|
|
7
7
|
before do
|
8
8
|
stub_request(:post, "https://api.gosquared.com/tracking/v1/#{dimension}?api_key=demo&site_token=GSN-2194840-F").
|
9
|
-
with(:body => "[
|
9
|
+
with(:body => "[{\"person_id\":\"email:test@example.com\",\"properties\":{\"email\":\"test@example.com\"}}]",
|
10
10
|
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>'ruby-client/'+VERSION }).
|
11
11
|
to_return(:status => 200, :body => "", :headers => {response: "success"})
|
12
12
|
end
|
@@ -23,7 +23,7 @@ describe Gosquared::Tracking do
|
|
23
23
|
describe "#event" do
|
24
24
|
before do
|
25
25
|
stub_request(:post, "https://api.gosquared.com/tracking/v1/event?api_key=demo&site_token=GSN-2194840-F").
|
26
|
-
with(:body => "[
|
26
|
+
with(:body => "[{\"event\":{\"name\":\"event\"}}]",
|
27
27
|
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>'ruby-client/'+VERSION}).
|
28
28
|
to_return(:status => 200, :body => "", :headers => {})
|
29
29
|
@data = {person_id: nil, event: { name: 'event' } }
|
@@ -36,7 +36,7 @@ describe Gosquared::Tracking do
|
|
36
36
|
|
37
37
|
before do
|
38
38
|
stub_request(:post, "https://api.gosquared.com/tracking/v1/event?api_key=demo&site_token=GSN-2194840-F").
|
39
|
-
with(:body => "[
|
39
|
+
with(:body => "[{\"person_id\":\"12345\",\"event\":{\"name\":\"event\"}}]",
|
40
40
|
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>'ruby-client/'+VERSION}).
|
41
41
|
to_return(:status => 200, :body => "", :headers => {})
|
42
42
|
@data = {person_id: '12345', event: { name: 'event' } }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gosquared
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Russell Vaughan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -89,10 +89,10 @@ signing_key:
|
|
89
89
|
specification_version: 4
|
90
90
|
summary: GoSquared Ruby Library
|
91
91
|
test_files:
|
92
|
-
- spec/account_spec.rb
|
93
|
-
- spec/client_spec.rb
|
94
|
-
- spec/now_spec.rb
|
95
|
-
- spec/people_spec.rb
|
96
92
|
- spec/spec_helper.rb
|
97
93
|
- spec/tracking_spec.rb
|
94
|
+
- spec/account_spec.rb
|
95
|
+
- spec/client_spec.rb
|
98
96
|
- spec/trends_spec.rb
|
97
|
+
- spec/people_spec.rb
|
98
|
+
- spec/now_spec.rb
|