customerio 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/CHANGELOG.markdown +4 -0
- data/lib/customerio/client.rb +16 -0
- data/lib/customerio/version.rb +1 -1
- data/spec/client_spec.rb +18 -0
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NTk1ODZkN2MwMDY0ZjI5ZDI4MTk3ZjlmZjI3MDdhZGVlYTdjYTJiNg==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 142c5aa6d5043fbf69018fc678fc335552c46d65
|
4
|
+
data.tar.gz: 15c5da49d590ac52cbc500d24e9a31b243937092
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
YjAxMjYwOTI3ZGZiNDhmZjgwNGNmYzNlMmIwY2Y2ODg3ODQ0NjA3ZGNjODVl
|
11
|
-
OTg5YzU1NWJlYzJjNDAwZWM5OWM3MWE0ZDk5NzY5NmUzMzgyNTU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YmU2NzM4N2ZiNDI0MmU1MTA5MmQ1N2U1ZDc5OGM3OGY3NTg2ODExY2Y0YzAz
|
14
|
-
YmI2Y2YyOTBkMDVkOGYzMDg0ZWZjMDZhMGI2YjgyMjNjNTBkYWNiMjc1Zjhk
|
15
|
-
YjA5MWZjODg4ZGU1NGFiMWMwNzQxN2VmZTRkNzg4MGUzYTk1MGI=
|
6
|
+
metadata.gz: c612f66e9ba819f88f04659b7ea243d98c4c57e6f6733bee94ca71e85dcd7d2d5b4ecd8458623d4ad3cafa857587e47b17e74977dee302fccb2a3c879d5a53db
|
7
|
+
data.tar.gz: db90752181238ad8626b2a723ae1f74230abbc6a458f39802ee25b21ac2933c653bddf2138b261e7e65b8ecb17d341d7a8234093497421a8c0b30dc811a9c0b2
|
data/CHANGELOG.markdown
CHANGED
data/lib/customerio/client.rb
CHANGED
@@ -34,6 +34,14 @@ module Customerio
|
|
34
34
|
verify_response(request(:delete, customer_path(customer_id)))
|
35
35
|
end
|
36
36
|
|
37
|
+
def suppress(customer_id)
|
38
|
+
verify_response(request(:post, suppress_path(customer_id)))
|
39
|
+
end
|
40
|
+
|
41
|
+
def unsuppress(customer_id)
|
42
|
+
verify_response(request(:post, unsuppress_path(customer_id)))
|
43
|
+
end
|
44
|
+
|
37
45
|
def track(*args)
|
38
46
|
attributes = extract_attributes(args)
|
39
47
|
|
@@ -118,6 +126,14 @@ module Customerio
|
|
118
126
|
"/api/v1/customers/#{id}"
|
119
127
|
end
|
120
128
|
|
129
|
+
def suppress_path(customer_id)
|
130
|
+
"/api/v1/customers/#{customer_id}/suppress"
|
131
|
+
end
|
132
|
+
|
133
|
+
def unsuppress_path(customer_id)
|
134
|
+
"/api/v1/customers/#{customer_id}/unsuppress"
|
135
|
+
end
|
136
|
+
|
121
137
|
def valid_timestamp?(timestamp)
|
122
138
|
timestamp && timestamp.is_a?(Integer) && timestamp > 999999999 && timestamp < 100000000000
|
123
139
|
end
|
data/lib/customerio/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -125,6 +125,24 @@ describe Customerio::Client do
|
|
125
125
|
end
|
126
126
|
end
|
127
127
|
|
128
|
+
describe "#suppress" do
|
129
|
+
it "sends a POST request to the customer.io's suppress API" do
|
130
|
+
stub_request(:post, api_uri('/api/v1/customers/5/suppress')).
|
131
|
+
to_return(:status => 200, :body => "", :headers => {})
|
132
|
+
|
133
|
+
client.suppress(5)
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
describe "#unsuppress" do
|
138
|
+
it "sends a POST request to the customer.io's unsuppress API" do
|
139
|
+
stub_request(:post, api_uri('/api/v1/customers/5/unsuppress')).
|
140
|
+
to_return(:status => 200, :body => "", :headers => {})
|
141
|
+
|
142
|
+
client.unsuppress(5)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
128
146
|
describe "#track" do
|
129
147
|
it "raises an error if POST doesn't return a 2xx response code" do
|
130
148
|
stub_request(:post, api_uri('/api/v1/customers/5/events')).
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: customerio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Allison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.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
26
|
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.5'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.5'
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -70,28 +70,28 @@ dependencies:
|
|
70
70
|
name: addressable
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 2.3.6
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 2.3.6
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: json
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
description: A ruby client for the Customer.io event API.
|
@@ -101,8 +101,8 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
-
- .gitignore
|
105
|
-
- .travis.yml
|
104
|
+
- ".gitignore"
|
105
|
+
- ".travis.yml"
|
106
106
|
- CHANGELOG.markdown
|
107
107
|
- Gemfile
|
108
108
|
- LICENSE
|
@@ -124,17 +124,17 @@ require_paths:
|
|
124
124
|
- lib
|
125
125
|
required_ruby_version: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
|
-
- -
|
127
|
+
- - ">="
|
128
128
|
- !ruby/object:Gem::Version
|
129
129
|
version: '0'
|
130
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
131
|
requirements:
|
132
|
-
- -
|
132
|
+
- - ">="
|
133
133
|
- !ruby/object:Gem::Version
|
134
134
|
version: '0'
|
135
135
|
requirements: []
|
136
136
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.
|
137
|
+
rubygems_version: 2.5.1
|
138
138
|
signing_key:
|
139
139
|
specification_version: 4
|
140
140
|
summary: A ruby client for the Customer.io event API.
|