embulk-output-mailchimp 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +6 -0
- data/.ruby-version +1 -0
- data/.travis.yml +9 -0
- data/Gemfile +2 -0
- data/LICENSE.txt +21 -0
- data/README.md +45 -0
- data/Rakefile +29 -0
- data/embulk-output-mailchimp.gemspec +27 -0
- data/lib/embulk/output/mailchimp.rb +142 -0
- data/test/embulk/output/test_mailchimp.rb +165 -0
- data/test/override_assert_raise.rb +18 -0
- data/test/run-test.rb +32 -0
- metadata +186 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 45060c5aec8200c9d1806d466414c014834dec45
|
4
|
+
data.tar.gz: 975cf885d3d90f9de70c7b9a119a96a4753ecfe9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ca60d58b8698b777e14df5ced2e3ff82543d4a42979c8a9ac2fff606852e6249131956d0b3c6f8f7b3c51d37c0b7a22da68de6cfd2be746f24c3b0cd04c0eb4b
|
7
|
+
data.tar.gz: 940b9ce3f294f45e3d5797b64df87a6003c8ff413c3441122a66f447dfd64869d5d066daef91e5a047425b1ee171de7577c1683d1acecae08699f9cae5789429
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.gitignore
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
jruby-9.0.0.0
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
MIT License
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
a copy of this software and associated documentation files (the
|
6
|
+
"Software"), to deal in the Software without restriction, including
|
7
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be
|
13
|
+
included in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Mailchimp output plugin for Embulk
|
2
|
+
[![Coverage Status](https://coveralls.io/repos/treasure-data/embulk-output-mailchimp/badge.svg?branch=master&service=github)](https://coveralls.io/github/treasure-data/embulk-output-mailchimp?branch=master)
|
3
|
+
[![Build Status](https://travis-ci.org/treasure-data/embulk-output-mailchimp.svg)](https://travis-ci.org/treasure-data/embulk-output-mailchimp?branch=master)
|
4
|
+
|
5
|
+
add e-mail to List in MailChimp.
|
6
|
+
|
7
|
+
## Overview
|
8
|
+
|
9
|
+
* **Plugin type**: output
|
10
|
+
* **Load all or nothing**: no
|
11
|
+
* **Resume supported**: no
|
12
|
+
* **Cleanup supported**: no
|
13
|
+
|
14
|
+
## Configuration
|
15
|
+
|
16
|
+
- **apikey**: Mailchimp API key (string, required)
|
17
|
+
- **list_id**: Mailchimp List id (string, required)
|
18
|
+
- **double_optin**: control whether to send an opt-in confirmation email (boolean, default: true)
|
19
|
+
- **update_existing**: control whether to update members that are already subscribed to the list or to return an error (boolean, default: false)
|
20
|
+
- **replace_interests**: determine whether we replace the interest groups with the updated groups provided, or we add the provided groups to the member's interest groups (boolean, default: true)
|
21
|
+
- **email_column**: column name for email (string, default: 'email')
|
22
|
+
- **fname_column**: column name for first name (string, default: 'fname')
|
23
|
+
- **lname_column**: column name for last name(string, default: 'lname')
|
24
|
+
|
25
|
+
## Example
|
26
|
+
|
27
|
+
```yaml
|
28
|
+
out:
|
29
|
+
type: mailchimp
|
30
|
+
apikey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-XXX'
|
31
|
+
list_id: 'XXXXXXXXXX'
|
32
|
+
double_optin: false
|
33
|
+
update_existing: false
|
34
|
+
replace_interests: true
|
35
|
+
email_column: 'e-mail'
|
36
|
+
fname_column: 'first name'
|
37
|
+
lname_column: 'lname'
|
38
|
+
```
|
39
|
+
|
40
|
+
|
41
|
+
## Build
|
42
|
+
|
43
|
+
```
|
44
|
+
$ rake
|
45
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
|
3
|
+
task default: :build
|
4
|
+
|
5
|
+
task 'clean' do
|
6
|
+
Dir.glob("pkg/*.gem").each do |name|
|
7
|
+
sh "rm #{name}"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
task 'reload' do
|
12
|
+
spec = Bundler::GemHelper.gemspec
|
13
|
+
|
14
|
+
sh "embulk gem uninstall #{spec.name}"
|
15
|
+
Rake::Task['clean'].execute
|
16
|
+
Rake::Task['build'].execute
|
17
|
+
sh "embulk gem install pkg/#{spec.name}-#{spec.version}.gem"
|
18
|
+
end
|
19
|
+
|
20
|
+
desc 'Run tests'
|
21
|
+
task :test do
|
22
|
+
ruby("test/run-test.rb", "--use-color=yes", "--collector=dir")
|
23
|
+
end
|
24
|
+
|
25
|
+
desc "Run tests with coverage"
|
26
|
+
task :cov do
|
27
|
+
ENV["COVERAGE"] = "1"
|
28
|
+
ruby("--debug", "test/run-test.rb", "--use-color=yes", "--collector=dir")
|
29
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
|
2
|
+
Gem::Specification.new do |spec|
|
3
|
+
spec.name = "embulk-output-mailchimp"
|
4
|
+
spec.version = "0.1.0"
|
5
|
+
spec.authors = ["takkanm"]
|
6
|
+
spec.summary = "Mailchimp output plugin for Embulk"
|
7
|
+
spec.description = "Dumps records to Mailchimp."
|
8
|
+
spec.email = ["takkanm@gmail.com"]
|
9
|
+
spec.licenses = ["MIT"]
|
10
|
+
# TODO set this: spec.homepage = "https://github.com/takkanm/embulk-output-mailchimp"
|
11
|
+
|
12
|
+
spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
|
13
|
+
spec.test_files = spec.files.grep(%r{^(test|spec)/})
|
14
|
+
spec.require_paths = ["lib"]
|
15
|
+
|
16
|
+
#spec.add_dependency 'YOUR_GEM_DEPENDENCY', ['~> YOUR_GEM_DEPENDENCY_VERSION']
|
17
|
+
spec.add_dependency 'mailchimp-api', ['~> 2.0.6']
|
18
|
+
spec.add_dependency 'perfect_retry', "~> 0.3"
|
19
|
+
|
20
|
+
spec.add_development_dependency 'embulk', ['~> 0.7.9']
|
21
|
+
spec.add_development_dependency 'bundler', ['~> 1.0']
|
22
|
+
spec.add_development_dependency 'rake', ['>= 10.0']
|
23
|
+
spec.add_development_dependency 'test-unit'
|
24
|
+
spec.add_development_dependency 'test-unit-rr'
|
25
|
+
spec.add_development_dependency 'simplecov', ['>= 0.9']
|
26
|
+
spec.add_development_dependency 'coveralls'
|
27
|
+
end
|
@@ -0,0 +1,142 @@
|
|
1
|
+
require 'mailchimp'
|
2
|
+
require 'perfect_retry'
|
3
|
+
|
4
|
+
module Embulk
|
5
|
+
module Output
|
6
|
+
|
7
|
+
class Mailchimp < OutputPlugin
|
8
|
+
Plugin.register_output("mailchimp", self)
|
9
|
+
|
10
|
+
class Client
|
11
|
+
def initialize(apikey)
|
12
|
+
@client = ::Mailchimp::API.new(apikey)
|
13
|
+
rescue ::Mailchimp::InvalidApiKeyError => e
|
14
|
+
raise Embulk::ConfigError.new(e.message)
|
15
|
+
end
|
16
|
+
|
17
|
+
def batch_subscribe_list(list_id, subscribers, double_optin, update_existing, replace_interests)
|
18
|
+
@client.lists.batch_subscribe(list_id, subscribers, double_optin, update_existing, replace_interests)
|
19
|
+
rescue ::Mailchimp::UserUnderMaintenanceError, ::Mailchimp::TooManyConnectionsError => e
|
20
|
+
Embulk.logger.warn e.message
|
21
|
+
raise e
|
22
|
+
rescue ::Mailchimp::Error => e
|
23
|
+
raise Embulk::DataError.new(e.message)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
MAX_EMAIL_COUNT = 1_000_000
|
28
|
+
|
29
|
+
def self.transaction(config, schema, count, &control)
|
30
|
+
task = {
|
31
|
+
apikey: config.param("apikey", :string),
|
32
|
+
list_id: config.param("list_id", :string),
|
33
|
+
double_optin: config.param("double_optin", :bool, default: true),
|
34
|
+
update_existing: config.param("update_existing", :bool, default: false),
|
35
|
+
replace_interests: config.param("replace_interests", :bool, default: true),
|
36
|
+
email_column: config.param("email_column", :string, default: "email"),
|
37
|
+
fname_column: config.param("fname_column", :string, default: "fname"),
|
38
|
+
lname_column: config.param("lname_column", :string, default: "lname"),
|
39
|
+
retry_limit: config.param("retry_limit", :integer, default: 5),
|
40
|
+
retry_initial_wait_sec: config.param("retry_initial_wait_sec", :integer, default: 1),
|
41
|
+
stop_on_invalid_record: config.param("stop_on_invalid_record", :bool, default: true),
|
42
|
+
}
|
43
|
+
|
44
|
+
Client.new(task[:apikey]) # NOTE for validate apikey
|
45
|
+
raise Embulk::ConfigError.new("schema has no '#{task[:email_column]}' column") if schema.none? {|s| s.name == task[:email_column] }
|
46
|
+
|
47
|
+
task_reports = yield(task)
|
48
|
+
next_config_diff = {}
|
49
|
+
return next_config_diff
|
50
|
+
end
|
51
|
+
|
52
|
+
def init
|
53
|
+
@client = Client.new(task[:apikey])
|
54
|
+
@list_id = task[:list_id]
|
55
|
+
@double_optin = task[:double_optin]
|
56
|
+
@update_existing = task[:update_existing]
|
57
|
+
@replace_interests = task[:replace_interests]
|
58
|
+
@email_column = task[:email_column]
|
59
|
+
@fname_column = task[:fname_column]
|
60
|
+
@lname_column = task[:lname_column]
|
61
|
+
@subscribers = []
|
62
|
+
|
63
|
+
@retry_manager = PerfectRetry.new do |config|
|
64
|
+
config.limit = task[:retry_limit]
|
65
|
+
config.sleep = lambda{|n| task[:retry_initial_wait_sec] * (2 ** (n - 1)) }
|
66
|
+
config.logger = Embulk.logger
|
67
|
+
config.log_level = nil
|
68
|
+
config.dont_rescues = [Embulk::ConfigError, Embulk::DataError]
|
69
|
+
end
|
70
|
+
@stop_on_invalid_record = task[:stop_on_invalid_record]
|
71
|
+
end
|
72
|
+
|
73
|
+
def close
|
74
|
+
end
|
75
|
+
|
76
|
+
def add(page)
|
77
|
+
# output code:
|
78
|
+
page.each do |record|
|
79
|
+
row = Hash[schema.names.zip(record)]
|
80
|
+
if row[@email_column]
|
81
|
+
add_subscriber row
|
82
|
+
|
83
|
+
flush_subscribers! unless @subscribers.size < MAX_EMAIL_COUNT
|
84
|
+
else
|
85
|
+
raise Embulk::DataError.new("#{@email_column} is empty") if @stop_on_invalid_record
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def finish
|
91
|
+
flush_subscribers!
|
92
|
+
end
|
93
|
+
|
94
|
+
def abort
|
95
|
+
end
|
96
|
+
|
97
|
+
def commit
|
98
|
+
task_report = {}
|
99
|
+
return task_report
|
100
|
+
end
|
101
|
+
|
102
|
+
private
|
103
|
+
|
104
|
+
def add_subscriber(row)
|
105
|
+
return unless row[@email_column]
|
106
|
+
|
107
|
+
merge_columns = {fname: @fname_column, lname: @lname_column}
|
108
|
+
|
109
|
+
merge_vars = merge_columns.each_with_object({}) do |(key, col_name), m|
|
110
|
+
m[key] = row[col_name] if row[col_name]
|
111
|
+
end
|
112
|
+
|
113
|
+
@subscribers << {
|
114
|
+
EMAIL: {
|
115
|
+
email: row[@email_column]
|
116
|
+
},
|
117
|
+
merge_vars: merge_vars,
|
118
|
+
}
|
119
|
+
end
|
120
|
+
|
121
|
+
def flush_subscribers!
|
122
|
+
return if @subscribers.empty?
|
123
|
+
|
124
|
+
send_subscribers!
|
125
|
+
@subscribers = []
|
126
|
+
end
|
127
|
+
|
128
|
+
def send_subscribers!
|
129
|
+
@retry_manager.with_retry do
|
130
|
+
@client.batch_subscribe_list(
|
131
|
+
@list_id,
|
132
|
+
@subscribers,
|
133
|
+
@double_optin,
|
134
|
+
@update_existing,
|
135
|
+
@replace_interests
|
136
|
+
)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
end
|
142
|
+
end
|
@@ -0,0 +1,165 @@
|
|
1
|
+
require "embulk"
|
2
|
+
Embulk.setup
|
3
|
+
|
4
|
+
require "embulk/output/mailchimp"
|
5
|
+
require "override_assert_raise"
|
6
|
+
|
7
|
+
|
8
|
+
module Embulk
|
9
|
+
module Output
|
10
|
+
class TestMailchimp < Test::Unit::TestCase
|
11
|
+
include OverrideAssertRaise
|
12
|
+
|
13
|
+
def apikey
|
14
|
+
'XXXXXXXXXXXXXXXXXXXXXX'
|
15
|
+
end
|
16
|
+
|
17
|
+
def list_id
|
18
|
+
'listlist'
|
19
|
+
end
|
20
|
+
|
21
|
+
class TestTransaction < self
|
22
|
+
def base_config
|
23
|
+
{
|
24
|
+
type: 'mailchimp',
|
25
|
+
apikey: apikey,
|
26
|
+
list_id: list_id,
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
class MailchimpAPIKeyIsValid < self
|
31
|
+
def setup
|
32
|
+
stub(Embulk::Output::Mailchimp::Client).new(apikey) { }
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_call_finish_without_error
|
36
|
+
source = create_config(base_config)
|
37
|
+
schema = create_schema([{name: 'email', type: :string}])
|
38
|
+
|
39
|
+
Embulk::Output::Mailchimp.transaction(source, schema, 1) {}
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_schema_has_no_email_column
|
43
|
+
source = create_config(base_config.merge(email_column: 'e_mail'))
|
44
|
+
schema = create_schema([{name: 'email', type: :string}])
|
45
|
+
|
46
|
+
assert_raise(Embulk::ConfigError) do
|
47
|
+
Embulk::Output::Mailchimp.transaction(source, schema, 1) {}
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
class MailchimpAPIKeyIsInvalid < self
|
53
|
+
def setup
|
54
|
+
stub(::Mailchimp::API).new(apikey) { raise ::Mailchimp::InvalidApiKeyError }
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_call_finish_without_error
|
58
|
+
source = create_config(base_config)
|
59
|
+
schema = create_schema([{name: 'email', type: :string}])
|
60
|
+
|
61
|
+
assert_raise(Embulk::ConfigError) do
|
62
|
+
Embulk::Output::Mailchimp.transaction(source, schema, 1) {}
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
class TestAdd < self
|
69
|
+
setup do
|
70
|
+
stub(::Mailchimp::API).new(apikey) { }
|
71
|
+
end
|
72
|
+
|
73
|
+
def create_mailchimp(optional_task = {})
|
74
|
+
Mailchimp.new(
|
75
|
+
{apikey: apikey, list_id: list_id, email_column: 'email'}.merge(optional_task),
|
76
|
+
create_schema([
|
77
|
+
{name: 'email', type: :string},
|
78
|
+
{name: 'fname', type: :string},
|
79
|
+
{name: 'lname', type: :string},
|
80
|
+
]),
|
81
|
+
1
|
82
|
+
)
|
83
|
+
end
|
84
|
+
|
85
|
+
class MergeVars < self
|
86
|
+
def page
|
87
|
+
[['a@example.com', 'first', 'last']]
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_stop_on_invalid_record_is_false
|
91
|
+
mailchimp = create_mailchimp(
|
92
|
+
lname_column: 'lname',
|
93
|
+
fname_column: 'fname'
|
94
|
+
)
|
95
|
+
|
96
|
+
mailchimp.add(page)
|
97
|
+
subscriber = mailchimp.instance_variable_get(:@subscribers)[0]
|
98
|
+
|
99
|
+
assert_equal(subscriber[:EMAIL][:email], 'a@example.com')
|
100
|
+
assert_equal(subscriber[:merge_vars][:fname], 'first')
|
101
|
+
assert_equal(subscriber[:merge_vars][:lname], 'last')
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
# NOTE skip until const mocking
|
106
|
+
class RecordeOverMaxEmailCount# < self
|
107
|
+
def page
|
108
|
+
[['@example.com']] * Mailchimp::MAX_EMAIL_COUNT
|
109
|
+
end
|
110
|
+
|
111
|
+
def test_flush_if_over_max_email_count
|
112
|
+
mailchimp = create_mailchimp
|
113
|
+
mock(mailchimp).send_subscribers!
|
114
|
+
|
115
|
+
mailchimp.add(page)
|
116
|
+
assert_equal(mailchimp.instance_variable_get(:@subscribers).size, 1)
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
class EmailColumnValueIsEmpty < self
|
121
|
+
def page
|
122
|
+
[
|
123
|
+
['a@example.com'], [], ['c@example.com']
|
124
|
+
]
|
125
|
+
end
|
126
|
+
|
127
|
+
def test_stop_on_invalid_record_is_false
|
128
|
+
mailchimp = create_mailchimp(stop_on_invalid_record: false)
|
129
|
+
|
130
|
+
mailchimp.add(page)
|
131
|
+
assert_equal(mailchimp.instance_variable_get(:@subscribers).size, 2)
|
132
|
+
end
|
133
|
+
|
134
|
+
def test_stop_on_invalid_record_is_true
|
135
|
+
mailchimp = create_mailchimp(stop_on_invalid_record: true)
|
136
|
+
|
137
|
+
assert_raise(Embulk::DataError) do
|
138
|
+
mailchimp.add(page)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
private
|
145
|
+
|
146
|
+
def create_config(config)
|
147
|
+
Embulk::DataSource[*config.to_a.flatten(1)]
|
148
|
+
end
|
149
|
+
|
150
|
+
def create_schema(columns)
|
151
|
+
Embulk::Schema.new(columns.map {|c| Embulk::Column.new(c) })
|
152
|
+
end
|
153
|
+
|
154
|
+
def mute_logger
|
155
|
+
stub(Embulk).logger { Logger.new(File::NULL) }
|
156
|
+
end
|
157
|
+
|
158
|
+
def setup_plugin(specific_task = nil, specific_schema = nil)
|
159
|
+
@plugin = Mailchimp.new(specific_task || task, specific_schema || schema, 1)
|
160
|
+
stub(@plugin).task { specific_task || task }
|
161
|
+
@plugin.init
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module OverrideAssertRaise
|
2
|
+
# NOTE: Embulk 0.7.1+ required to raise ConfigError to do as `ConfigError.new("message")`,
|
3
|
+
# original `assert_raise` method can't catch that, but `begin .. rescue` can.
|
4
|
+
# So we override assert_raise as below.
|
5
|
+
def assert_raise(expected_class = StandardError, &block)
|
6
|
+
begin
|
7
|
+
block.call
|
8
|
+
assert_equal expected_class, nil
|
9
|
+
rescue ::Test::Unit::AssertionFailedError => e
|
10
|
+
# failed assert raises this Error and that extends StandardError, so rescue it first
|
11
|
+
raise e
|
12
|
+
rescue expected_class
|
13
|
+
assert true # passed
|
14
|
+
rescue => e
|
15
|
+
assert_equal(expected_class, e.class) # not expected one raised
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/test/run-test.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
base_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
|
2
|
+
lib_dir = File.join(base_dir, "lib")
|
3
|
+
test_dir = File.join(base_dir, "test")
|
4
|
+
|
5
|
+
require "test-unit"
|
6
|
+
require "test/unit/rr"
|
7
|
+
|
8
|
+
$LOAD_PATH.unshift(lib_dir)
|
9
|
+
$LOAD_PATH.unshift(test_dir)
|
10
|
+
|
11
|
+
ENV["TEST_UNIT_MAX_DIFF_TARGET_STRING_SIZE"] ||= "5000"
|
12
|
+
|
13
|
+
if ENV['CI']
|
14
|
+
require 'simplecov'
|
15
|
+
require 'coveralls'
|
16
|
+
Coveralls.wear!
|
17
|
+
|
18
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[Coveralls::SimpleCov::Formatter]
|
19
|
+
SimpleCov.start 'test_frameworks'
|
20
|
+
end
|
21
|
+
|
22
|
+
if ENV["COVERAGE"]
|
23
|
+
require 'simplecov'
|
24
|
+
SimpleCov.start 'test_frameworks'
|
25
|
+
|
26
|
+
if ENV['CIRCLE_ARTIFACTS'] # https://circleci.com/docs/code-coverage
|
27
|
+
dir = File.join(ENV['CIRCLE_ARTIFACTS'], "coverage")
|
28
|
+
SimpleCov.coverage_dir(dir)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
exit Test::Unit::AutoRunner.run(true, test_dir)
|
metadata
ADDED
@@ -0,0 +1,186 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: embulk-output-mailchimp
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- takkanm
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-11-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - "~>"
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: 2.0.6
|
19
|
+
name: mailchimp-api
|
20
|
+
prerelease: false
|
21
|
+
type: :runtime
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.0.6
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - "~>"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0.3'
|
33
|
+
name: perfect_retry
|
34
|
+
prerelease: false
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.7.9
|
47
|
+
name: embulk
|
48
|
+
prerelease: false
|
49
|
+
type: :development
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.7.9
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '1.0'
|
61
|
+
name: bundler
|
62
|
+
prerelease: false
|
63
|
+
type: :development
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '10.0'
|
75
|
+
name: rake
|
76
|
+
prerelease: false
|
77
|
+
type: :development
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '10.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
name: test-unit
|
90
|
+
prerelease: false
|
91
|
+
type: :development
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
name: test-unit-rr
|
104
|
+
prerelease: false
|
105
|
+
type: :development
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0.9'
|
117
|
+
name: simplecov
|
118
|
+
prerelease: false
|
119
|
+
type: :development
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0.9'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
requirement: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
131
|
+
name: coveralls
|
132
|
+
prerelease: false
|
133
|
+
type: :development
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
description: Dumps records to Mailchimp.
|
140
|
+
email:
|
141
|
+
- takkanm@gmail.com
|
142
|
+
executables: []
|
143
|
+
extensions: []
|
144
|
+
extra_rdoc_files: []
|
145
|
+
files:
|
146
|
+
- ".coveralls.yml"
|
147
|
+
- ".gitignore"
|
148
|
+
- ".ruby-version"
|
149
|
+
- ".travis.yml"
|
150
|
+
- Gemfile
|
151
|
+
- LICENSE.txt
|
152
|
+
- README.md
|
153
|
+
- Rakefile
|
154
|
+
- embulk-output-mailchimp.gemspec
|
155
|
+
- lib/embulk/output/mailchimp.rb
|
156
|
+
- test/embulk/output/test_mailchimp.rb
|
157
|
+
- test/override_assert_raise.rb
|
158
|
+
- test/run-test.rb
|
159
|
+
homepage:
|
160
|
+
licenses:
|
161
|
+
- MIT
|
162
|
+
metadata: {}
|
163
|
+
post_install_message:
|
164
|
+
rdoc_options: []
|
165
|
+
require_paths:
|
166
|
+
- lib
|
167
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
168
|
+
requirements:
|
169
|
+
- - ">="
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
version: '0'
|
172
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
|
+
requirements:
|
174
|
+
- - ">="
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: '0'
|
177
|
+
requirements: []
|
178
|
+
rubyforge_project:
|
179
|
+
rubygems_version: 2.4.8
|
180
|
+
signing_key:
|
181
|
+
specification_version: 4
|
182
|
+
summary: Mailchimp output plugin for Embulk
|
183
|
+
test_files:
|
184
|
+
- test/embulk/output/test_mailchimp.rb
|
185
|
+
- test/override_assert_raise.rb
|
186
|
+
- test/run-test.rb
|