gosquared 3.0.5 → 3.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gosquared.rb +2 -0
- data/lib/gosquared/client.rb +2 -2
- data/lib/gosquared/people.rb +0 -1
- data/spec/account_spec.rb +6 -4
- data/spec/tracking_spec.rb +5 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf6aeda0866e2e3072ac4c3821b12c32b350e358
|
4
|
+
data.tar.gz: 2c536fa3596205200f292decfe44da65ee13a069
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90c64d33881ee8132c84c7272a3f1843b54be80317222769e8cb9623dec9984e7dc5e16db992ab8a77cfb90b50bc09fc2b6b4f570f4eb25e5ba4ac0461a1cdea
|
7
|
+
data.tar.gz: 6c71ea20b7604857953c34d8070c47a8a5e03834cb999cceaac2a9bc9293a65d0ba94d7f4d7acbe6619c204730a192197af027fdb856af8d10281dfbd9002e30
|
data/lib/gosquared.rb
CHANGED
data/lib/gosquared/client.rb
CHANGED
@@ -27,8 +27,8 @@ module Gosquared
|
|
27
27
|
begin
|
28
28
|
https = Net::HTTP.new(uri.host, uri.port)
|
29
29
|
https.use_ssl = true
|
30
|
-
request = Net::HTTP::Post.new(uri.request_uri, initheader = {'Content-Type' =>'application/json'})
|
31
|
-
|
30
|
+
request = Net::HTTP::Post.new(uri.request_uri, initheader = {'Content-Type' =>'application/json', 'User-Agent' => 'ruby-client/'+ VERSION})
|
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
|
data/lib/gosquared/people.rb
CHANGED
data/spec/account_spec.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
describe Gosquared::Account do
|
2
2
|
subject(:gs) { described_class.new("demo", "GSN-2194840-F") }
|
3
|
+
VERSION = "3.0.5"
|
4
|
+
|
3
5
|
|
4
6
|
Gosquared::Account::DIMENSIONS.each do |dimension|
|
5
7
|
before do
|
6
8
|
data = '{"a": [{"test": "response"}]}'
|
7
9
|
stub_request(:get, "https://api.gosquared.com/account/v1/#{dimension}?api_key=demo&site_token=GSN-2194840-F" ).
|
8
|
-
with(headers: {'Accept'=>'*/*'
|
10
|
+
with(headers: {'Accept'=>'*/*'}).
|
9
11
|
to_return(status: 200, body: data, headers: {})
|
10
12
|
end
|
11
13
|
end
|
@@ -20,7 +22,7 @@ describe Gosquared::Account do
|
|
20
22
|
before do
|
21
23
|
data = '{"a": [{"test": "response"}]}'
|
22
24
|
stub_request(:get, "https://api.gosquared.com/account/v1/sites/GSN-086224-W?api_key=demo&site_token=GSN-2194840-F").
|
23
|
-
with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'api.gosquared.com'
|
25
|
+
with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'api.gosquared.com'}).
|
24
26
|
to_return(:status => 200, :body => data, :headers => {})
|
25
27
|
end
|
26
28
|
|
@@ -32,11 +34,11 @@ describe Gosquared::Account do
|
|
32
34
|
before do
|
33
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").
|
34
36
|
with(:body => "[ \"\" ]",
|
35
|
-
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json'
|
37
|
+
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json'}).
|
36
38
|
to_return(:status => 200, :body => "", :headers => {})
|
37
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").
|
38
40
|
with(:body => "[ \"\" ]",
|
39
|
-
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json'
|
41
|
+
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json'}).
|
40
42
|
to_return(:status => 200, :body => "", :headers => {})
|
41
43
|
end
|
42
44
|
|
data/spec/tracking_spec.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
describe Gosquared::Tracking do
|
2
2
|
subject(:gs) { described_class.new("demo", "GSN-2194840-F") }
|
3
3
|
|
4
|
+
VERSION = "3.0.6"
|
5
|
+
|
4
6
|
Gosquared::Tracking::DIMENSIONS.each do |dimension|
|
5
7
|
before do
|
6
8
|
stub_request(:post, "https://api.gosquared.com/tracking/v1/#{dimension}?api_key=demo&site_token=GSN-2194840-F").
|
7
9
|
with(:body => "[ {\"person_id\":\"email:test@example.com\",\"properties\":{\"email\":\"test@example.com\"}} ]",
|
8
|
-
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>'
|
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 }).
|
9
11
|
to_return(:status => 200, :body => "", :headers => {response: "success"})
|
10
12
|
end
|
11
13
|
end
|
@@ -22,7 +24,7 @@ describe Gosquared::Tracking do
|
|
22
24
|
before do
|
23
25
|
stub_request(:post, "https://api.gosquared.com/tracking/v1/event?api_key=demo&site_token=GSN-2194840-F").
|
24
26
|
with(:body => "[ {\"event\":{\"name\":\"event\"}} ]",
|
25
|
-
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>'
|
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}).
|
26
28
|
to_return(:status => 200, :body => "", :headers => {})
|
27
29
|
@data = {person_id: nil, event: { name: 'event' } }
|
28
30
|
end
|
@@ -35,7 +37,7 @@ describe Gosquared::Tracking do
|
|
35
37
|
before do
|
36
38
|
stub_request(:post, "https://api.gosquared.com/tracking/v1/event?api_key=demo&site_token=GSN-2194840-F").
|
37
39
|
with(:body => "[ {\"person_id\":\"12345\",\"event\":{\"name\":\"event\"}} ]",
|
38
|
-
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>'
|
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}).
|
39
41
|
to_return(:status => 200, :body => "", :headers => {})
|
40
42
|
@data = {person_id: '12345', event: { name: 'event' } }
|
41
43
|
end
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Russell Vaughan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|