braze_ruby 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -4
- data/braze_ruby.gemspec +9 -2
- data/lib/braze_ruby/http.rb +5 -3
- data/lib/braze_ruby/version.rb +1 -1
- data/spec/fixtures/responses/email_sync/hard_bounces/responds_with_empty_array_when_no_hard_bounces.yml +15 -13
- data/spec/fixtures/responses/email_sync/unsubscribes/responds_with_empty_array_when_no_unsubscribes.yml +15 -13
- data/spec/fixtures/responses/email_sync/unsubscribes/responds_with_unsubscribed_emails.yml +15 -13
- metadata +6 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d764aef365cc62df6c6b78c7df64e302e5e662b23d602acaec830f98159e3605
|
4
|
+
data.tar.gz: b5b2affefe873659ef00624c004309b095454479e2324f9923f613e06366212b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 818b213e16dcd5665c9b0029e0d683a9b0631ff49732362fc904ea176e4ff4aa639ebec8b1467e5cf40b313d57b9377fca1074a2f2d47dedc894a93377ae6630
|
7
|
+
data.tar.gz: 149b620b3a6e27b39e4ab34a6f7826e866015a04ba170bdc38e0d66407a0c6518503108edfb60100e4f9a0642591cc1d170fdb609ff678e53f328e1c7a0cbd56
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
braze_ruby (0.
|
4
|
+
braze_ruby (0.2.0)
|
5
5
|
faraday
|
6
|
-
faraday_middleware
|
7
6
|
|
8
7
|
GEM
|
9
8
|
remote: https://rubygems.org/
|
@@ -25,8 +24,6 @@ GEM
|
|
25
24
|
activesupport (>= 4.2.0)
|
26
25
|
faraday (0.15.4)
|
27
26
|
multipart-post (>= 1.2, < 3)
|
28
|
-
faraday_middleware (0.13.1)
|
29
|
-
faraday (>= 0.7.4, < 1.0)
|
30
27
|
hashdiff (0.3.8)
|
31
28
|
i18n (1.6.0)
|
32
29
|
concurrent-ruby (~> 1.0)
|
data/braze_ruby.gemspec
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
lib = File.expand_path('../lib', __FILE__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'braze_ruby/version'
|
@@ -13,13 +12,21 @@ Gem::Specification.new do |spec|
|
|
13
12
|
spec.homepage = 'https://www.braze.com/'
|
14
13
|
spec.license = 'MIT'
|
15
14
|
|
15
|
+
if spec.respond_to?(:metadata)
|
16
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
17
|
+
spec.metadata["source_code_uri"] = "https://github.com/jboltz88/braze_ruby"
|
18
|
+
else
|
19
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
20
|
+
end
|
21
|
+
|
16
22
|
spec.files = `git ls-files`.split($/)
|
17
23
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
24
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
25
|
spec.require_paths = ['lib']
|
26
|
+
spec.required_ruby_version = '>= 2.0'
|
20
27
|
|
21
28
|
spec.add_dependency 'faraday'
|
22
|
-
|
29
|
+
|
23
30
|
spec.add_development_dependency 'bundler', '>= 1.3'
|
24
31
|
spec.add_development_dependency 'rake'
|
25
32
|
spec.add_development_dependency 'rspec'
|
data/lib/braze_ruby/http.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
+
require 'json'
|
1
2
|
require 'faraday'
|
2
|
-
require 'faraday_middleware'
|
3
3
|
|
4
4
|
module BrazeRuby
|
5
5
|
class HTTP
|
@@ -9,7 +9,7 @@ module BrazeRuby
|
|
9
9
|
|
10
10
|
def post(path, payload)
|
11
11
|
connection.post path do |request|
|
12
|
-
request.body = payload
|
12
|
+
request.body = JSON.dump(payload)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -19,7 +19,9 @@ module BrazeRuby
|
|
19
19
|
|
20
20
|
def connection
|
21
21
|
@connection ||= Faraday.new(url: @braze_url) do |connection|
|
22
|
-
connection.
|
22
|
+
connection.headers['Content-Type'] = 'application/json'
|
23
|
+
connection.headers['Accept'] = 'application/json'
|
24
|
+
connection.headers['User-Agent'] = "Braze Ruby gem v#{BrazeRuby::VERSION}"
|
23
25
|
|
24
26
|
connection.response :logger if ENV['BRAZE_RUBY_DEBUG']
|
25
27
|
|
data/lib/braze_ruby/version.rb
CHANGED
@@ -7,12 +7,14 @@ http_interactions:
|
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Accept:
|
13
|
+
- application/json
|
10
14
|
User-Agent:
|
11
|
-
-
|
15
|
+
- Braze Ruby gem v0.1.0
|
12
16
|
Accept-Encoding:
|
13
17
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
-
Accept:
|
15
|
-
- "*/*"
|
16
18
|
response:
|
17
19
|
status:
|
18
20
|
code: 200
|
@@ -32,40 +34,40 @@ http_interactions:
|
|
32
34
|
X-Ratelimit-Limit:
|
33
35
|
- '250000'
|
34
36
|
X-Ratelimit-Remaining:
|
35
|
-
- '
|
37
|
+
- '249997'
|
36
38
|
X-Ratelimit-Reset:
|
37
|
-
- '
|
39
|
+
- '1554469200'
|
38
40
|
X-Request-Id:
|
39
|
-
-
|
41
|
+
- c558e8fa-6297-4781-ae01-e3578c6cf5cc
|
40
42
|
X-Runtime:
|
41
|
-
- '0.
|
43
|
+
- '0.036732'
|
42
44
|
Accept-Ranges:
|
43
45
|
- bytes
|
44
46
|
- bytes
|
45
47
|
Age:
|
46
48
|
- '0'
|
47
49
|
- '0'
|
48
|
-
|
49
|
-
-
|
50
|
+
Transfer-Encoding:
|
51
|
+
- chunked
|
50
52
|
Date:
|
51
|
-
-
|
53
|
+
- Fri, 05 Apr 2019 12:42:30 GMT
|
52
54
|
Via:
|
53
55
|
- 1.1 varnish
|
54
56
|
Connection:
|
55
57
|
- keep-alive
|
56
58
|
X-Served-By:
|
57
|
-
- cache-
|
59
|
+
- cache-ams21022-AMS
|
58
60
|
X-Cache:
|
59
61
|
- MISS
|
60
62
|
X-Cache-Hits:
|
61
63
|
- '0'
|
62
64
|
X-Timer:
|
63
|
-
-
|
65
|
+
- S1554468150.427045,VS0,VE47
|
64
66
|
Vary:
|
65
67
|
- Accept-Encoding
|
66
68
|
body:
|
67
69
|
encoding: ASCII-8BIT
|
68
70
|
string: '{"emails":[],"message":"success"}'
|
69
71
|
http_version:
|
70
|
-
recorded_at:
|
72
|
+
recorded_at: Fri, 05 Apr 2019 12:42:30 GMT
|
71
73
|
recorded_with: VCR 4.0.0
|
@@ -7,12 +7,14 @@ http_interactions:
|
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Accept:
|
13
|
+
- application/json
|
10
14
|
User-Agent:
|
11
|
-
-
|
15
|
+
- Braze Ruby gem v0.1.0
|
12
16
|
Accept-Encoding:
|
13
17
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
-
Accept:
|
15
|
-
- "*/*"
|
16
18
|
response:
|
17
19
|
status:
|
18
20
|
code: 200
|
@@ -32,40 +34,40 @@ http_interactions:
|
|
32
34
|
X-Ratelimit-Limit:
|
33
35
|
- '250000'
|
34
36
|
X-Ratelimit-Remaining:
|
35
|
-
- '
|
37
|
+
- '249995'
|
36
38
|
X-Ratelimit-Reset:
|
37
|
-
- '
|
39
|
+
- '1554469200'
|
38
40
|
X-Request-Id:
|
39
|
-
-
|
41
|
+
- 789be9aa-f170-4720-8e99-69225027766a
|
40
42
|
X-Runtime:
|
41
|
-
- '0.
|
43
|
+
- '0.090793'
|
42
44
|
Accept-Ranges:
|
43
45
|
- bytes
|
44
46
|
- bytes
|
45
47
|
Age:
|
46
48
|
- '0'
|
47
49
|
- '0'
|
48
|
-
|
49
|
-
-
|
50
|
+
Transfer-Encoding:
|
51
|
+
- chunked
|
50
52
|
Date:
|
51
|
-
-
|
53
|
+
- Fri, 05 Apr 2019 12:44:12 GMT
|
52
54
|
Via:
|
53
55
|
- 1.1 varnish
|
54
56
|
Connection:
|
55
57
|
- keep-alive
|
56
58
|
X-Served-By:
|
57
|
-
- cache-
|
59
|
+
- cache-ams21050-AMS
|
58
60
|
X-Cache:
|
59
61
|
- MISS
|
60
62
|
X-Cache-Hits:
|
61
63
|
- '0'
|
62
64
|
X-Timer:
|
63
|
-
-
|
65
|
+
- S1554468252.044685,VS0,VE101
|
64
66
|
Vary:
|
65
67
|
- Accept-Encoding
|
66
68
|
body:
|
67
69
|
encoding: ASCII-8BIT
|
68
70
|
string: '{"emails":[],"message":"success"}'
|
69
71
|
http_version:
|
70
|
-
recorded_at:
|
72
|
+
recorded_at: Fri, 05 Apr 2019 12:44:12 GMT
|
71
73
|
recorded_with: VCR 4.0.0
|
@@ -7,12 +7,14 @@ http_interactions:
|
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Accept:
|
13
|
+
- application/json
|
10
14
|
User-Agent:
|
11
|
-
-
|
15
|
+
- Braze Ruby gem v0.1.0
|
12
16
|
Accept-Encoding:
|
13
17
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
-
Accept:
|
15
|
-
- "*/*"
|
16
18
|
response:
|
17
19
|
status:
|
18
20
|
code: 200
|
@@ -32,35 +34,35 @@ http_interactions:
|
|
32
34
|
X-Ratelimit-Limit:
|
33
35
|
- '250000'
|
34
36
|
X-Ratelimit-Remaining:
|
35
|
-
- '
|
37
|
+
- '249996'
|
36
38
|
X-Ratelimit-Reset:
|
37
|
-
- '
|
39
|
+
- '1554469200'
|
38
40
|
X-Request-Id:
|
39
|
-
-
|
41
|
+
- fa9392d1-098a-406c-9957-9f8f504b3263
|
40
42
|
X-Runtime:
|
41
|
-
- '0.
|
43
|
+
- '0.118162'
|
42
44
|
Accept-Ranges:
|
43
45
|
- bytes
|
44
46
|
- bytes
|
45
47
|
Age:
|
46
48
|
- '0'
|
47
49
|
- '0'
|
48
|
-
|
49
|
-
-
|
50
|
+
Transfer-Encoding:
|
51
|
+
- chunked
|
50
52
|
Date:
|
51
|
-
-
|
53
|
+
- Fri, 05 Apr 2019 12:44:11 GMT
|
52
54
|
Via:
|
53
55
|
- 1.1 varnish
|
54
56
|
Connection:
|
55
57
|
- keep-alive
|
56
58
|
X-Served-By:
|
57
|
-
- cache-
|
59
|
+
- cache-ams21026-AMS
|
58
60
|
X-Cache:
|
59
61
|
- MISS
|
60
62
|
X-Cache-Hits:
|
61
63
|
- '0'
|
62
64
|
X-Timer:
|
63
|
-
-
|
65
|
+
- S1554468252.696233,VS0,VE128
|
64
66
|
Vary:
|
65
67
|
- Accept-Encoding
|
66
68
|
body:
|
@@ -68,5 +70,5 @@ http_interactions:
|
|
68
70
|
string: '{"emails":[{"email":"wojtek@test.com","unsubscribed_at":"2019-03-21
|
69
71
|
16:31:31 +0000"}],"message":"success"}'
|
70
72
|
http_version:
|
71
|
-
recorded_at:
|
73
|
+
recorded_at: Fri, 05 Apr 2019 12:44:11 GMT
|
72
74
|
recorded_with: VCR 4.0.0
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: braze_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Nussbaum
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-04-
|
13
|
+
date: 2019-04-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|
@@ -26,20 +26,6 @@ dependencies:
|
|
26
26
|
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '0'
|
29
|
-
- !ruby/object:Gem::Dependency
|
30
|
-
name: faraday_middleware
|
31
|
-
requirement: !ruby/object:Gem::Requirement
|
32
|
-
requirements:
|
33
|
-
- - ">="
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version: '0'
|
36
|
-
type: :runtime
|
37
|
-
prerelease: false
|
38
|
-
version_requirements: !ruby/object:Gem::Requirement
|
39
|
-
requirements:
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: '0'
|
43
29
|
- !ruby/object:Gem::Dependency
|
44
30
|
name: bundler
|
45
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -240,7 +226,9 @@ files:
|
|
240
226
|
homepage: https://www.braze.com/
|
241
227
|
licenses:
|
242
228
|
- MIT
|
243
|
-
metadata:
|
229
|
+
metadata:
|
230
|
+
homepage_uri: https://www.braze.com/
|
231
|
+
source_code_uri: https://github.com/jboltz88/braze_ruby
|
244
232
|
post_install_message:
|
245
233
|
rdoc_options: []
|
246
234
|
require_paths:
|
@@ -249,7 +237,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
249
237
|
requirements:
|
250
238
|
- - ">="
|
251
239
|
- !ruby/object:Gem::Version
|
252
|
-
version: '0'
|
240
|
+
version: '2.0'
|
253
241
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
254
242
|
requirements:
|
255
243
|
- - ">="
|