embulk-output-mailchimp 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/embulk-output-mailchimp.gemspec +1 -1
- data/lib/embulk/output/mailchimp.rb +0 -2
- data/test/embulk/output/test_mailchimp.rb +41 -0
- 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: c5e90ff1e0d73bd9d852c2bb0cc53e954a8cf1ea
|
4
|
+
data.tar.gz: 27cf142a0398730ef50bf36e0076802984133148
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0582347cfa8550e37f5323a651b8d2f68760eb84dd27ba6bc1b08cce6dfd81aa205198d01b0e18749b027161162b477d06290e64281c8ec6bcd9f736c528de2
|
7
|
+
data.tar.gz: 0b01f3c6a644537afde7b95da97b2f8c7dd966ab54738cab16f5c32cc85c0377bd9d8cd37459adb73dbdfa4c35433d732b847fb72c2f5db5ea087b088738d54f
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 0.2.3 - 2016-03-24
|
2
|
+
|
3
|
+
- Retry when Mailchimp server return Internal Server Error [#11](https://github.com/treasure-data/embulk-output-mailchimp/pull/11)
|
4
|
+
|
1
5
|
## 0.2.2 - 2016-01-21
|
2
6
|
|
3
7
|
- Changed the threshold of batch size for uploading emails as a request [#9](https://github.com/treasure-data/embulk-output-mailchimp/pull/9)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
Gem::Specification.new do |spec|
|
3
3
|
spec.name = "embulk-output-mailchimp"
|
4
|
-
spec.version = "0.2.
|
4
|
+
spec.version = "0.2.3"
|
5
5
|
spec.authors = ["uu59", "takkanm"]
|
6
6
|
spec.summary = "Mailchimp output plugin for Embulk"
|
7
7
|
spec.description = "Dumps records to Mailchimp."
|
@@ -65,6 +65,47 @@ module Embulk
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
+
class TestFinish < self
|
69
|
+
setup do
|
70
|
+
stub(::Mailchimp::API).new(apikey) { }
|
71
|
+
|
72
|
+
@plugin = Mailchimp.new(
|
73
|
+
{
|
74
|
+
apikey: apikey,
|
75
|
+
list_id: list_id,
|
76
|
+
email_column: 'email',
|
77
|
+
retry_limit: retry_limit,
|
78
|
+
retry_initial_wait_sec: 0,
|
79
|
+
},
|
80
|
+
create_schema([
|
81
|
+
{name: 'email', type: :string},
|
82
|
+
]),
|
83
|
+
1
|
84
|
+
)
|
85
|
+
end
|
86
|
+
|
87
|
+
def retry_limit
|
88
|
+
3
|
89
|
+
end
|
90
|
+
|
91
|
+
def test_retry_on_mailchimp_error
|
92
|
+
client = @plugin.instance_variable_get(:@client)
|
93
|
+
stub(client).batch_subscribe_list(list_id, anything, anything, anything, anything) {
|
94
|
+
# https://bitbucket.org/mailchimp/mailchimp-api-ruby/src/37dbe82057b96e135881c9379c0a3d5f8f32bf1f/lib/mailchimp.rb?at=master&fileviewer=file-view-default#mailchimp.rb-164
|
95
|
+
raise ::Mailchimp::Error, "We received an unexpected error: <!doctype html>"
|
96
|
+
}
|
97
|
+
stub(Embulk.logger).info(anything)
|
98
|
+
mock(Embulk.logger).warn(anything).at_least(retry_limit)
|
99
|
+
|
100
|
+
@plugin.add([
|
101
|
+
["foo@example.com"]
|
102
|
+
])
|
103
|
+
assert_raise(PerfectRetry::TooManyRetry) do
|
104
|
+
@plugin.finish
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
68
109
|
class TestAdd < self
|
69
110
|
setup do
|
70
111
|
stub(::Mailchimp::API).new(apikey) { }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-output-mailchimp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- uu59
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-03-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|