data_migrater 0.3.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/README.md +90 -22
- data/lib/data_migrater.rb +1 -0
- data/lib/data_migrater/csv.rb +31 -6
- data/lib/data_migrater/logger.rb +2 -2
- data/lib/data_migrater/s3.rb +46 -0
- data/lib/data_migrater/version.rb +1 -1
- data/spec/csv/csv_spec.rb +42 -20
- data/spec/logger/data_logger_spec.rb +3 -3
- data/spec/migration_spec.rb +3 -3
- data/spec/s3/download_spec.rb +29 -0
- data/spec/s3/initialize_spec.rb +63 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/support/local/dummy.csv +0 -3
- metadata +38 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e763846467f7bf1af5607a89750f416e4addb70
|
4
|
+
data.tar.gz: 666f66ff8908a468b27f4da84fb486c0e0919ffb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3c6a9c17e22316dc01aa1385d62134063ab3801db8528615577dcd8394bc1dc334e6b288912120fac6fdc504f22e0099e3a216d3a778fc03fc2eaccd55a6a76
|
7
|
+
data.tar.gz: c98bf19f3c91c7bde8f9a38a4472504eef266d6e149150d864f984f3fd7ef8faa18a4ed6d02c7d9e387d26065c4c0d00fe83df101eda1d0064f1b0e91aa6b13a
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
|
+
# 0.4.0
|
2
|
+
|
3
|
+
- Add Rails 5 support;
|
4
|
+
- Bump Ruby until 2.4.1.
|
5
|
+
|
1
6
|
# 0.3.0
|
2
7
|
|
3
|
-
- Added support for CSV
|
8
|
+
- Added support for CSV;
|
9
|
+
- Added options `dir` to specify the directory on Logger;
|
10
|
+
- Added options `file` to specify the Logger file name.
|
4
11
|
|
5
12
|
# 0.2.0
|
6
13
|
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Data Migrater
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/getninjas/data_migrater.svg)](https://travis-ci.org/getninjas/data_migrater)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/data_migrater.svg)](https://badge.fury.io/rb/data_migrater)
|
5
|
+
|
3
6
|
Data Migration is like Migrate, but it will changes the data of your tables,
|
4
7
|
not your schema. This gems creates a file where you can write code to make
|
5
8
|
change along you schema changes.
|
@@ -73,7 +76,6 @@ class MyDataMigration
|
|
73
76
|
include DataMigrater::CSV
|
74
77
|
|
75
78
|
def execute
|
76
|
-
# parsed from `db/data_migrate/support/csv/my_data_migration.csv`
|
77
79
|
csv.each do |line|
|
78
80
|
Object.create! line
|
79
81
|
end
|
@@ -87,10 +89,9 @@ By default, the class name is used and the file is parsed from `db/data_migrate/
|
|
87
89
|
class MyDataMigration
|
88
90
|
include DataMigrater::CSV
|
89
91
|
|
90
|
-
data_csv path:
|
92
|
+
data_csv path: '/tmp/objects.csv'
|
91
93
|
|
92
94
|
def execute
|
93
|
-
# parsed from `/tmp/objects.csv`
|
94
95
|
csv.each do |line|
|
95
96
|
Object.create! line
|
96
97
|
end
|
@@ -107,16 +108,11 @@ class MyDataMigration
|
|
107
108
|
data_csv chunk_size: 2
|
108
109
|
|
109
110
|
def execute
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
# { first_name: 'Lucas' , last_name: 'Souza' }
|
116
|
-
# ]
|
117
|
-
|
118
|
-
Object.create! line
|
119
|
-
end
|
111
|
+
# [
|
112
|
+
# { first_name: 'Washington', last_name: 'Botelho' },
|
113
|
+
# { first_name: 'Lucas' , last_name: 'Souza' }
|
114
|
+
# ]
|
115
|
+
csv.each { |line| Object.create line }
|
120
116
|
end
|
121
117
|
end
|
122
118
|
```
|
@@ -138,7 +134,7 @@ end
|
|
138
134
|
```
|
139
135
|
|
140
136
|
#### Options
|
141
|
-
|
137
|
+
dum
|
142
138
|
- `dir`: Directory where CSV is located;
|
143
139
|
- `file`: File name;
|
144
140
|
- `path`: Composition of `dir/file` when you want give a fully qualified path. Default: `db/data_migrate/support/csv/class_name.csv`.
|
@@ -152,18 +148,90 @@ end
|
|
152
148
|
|
153
149
|
For more CSV options, check the project [Smarter CSV](https://github.com/tilo/smarter_csv):
|
154
150
|
|
155
|
-
##
|
151
|
+
## S3
|
156
152
|
|
157
|
-
|
153
|
+
You can download your CSV directly from [Amazon S3](https://aws.amazon.com/s3) using the module `DataMigrater::CSV` with some configs.
|
154
|
+
You *must* keep the path as `:s3` to activate S3 feature.
|
158
155
|
|
159
|
-
```bash
|
160
|
-
rspec spec
|
161
156
|
```
|
157
|
+
class MyDataMigration
|
158
|
+
include DataMigrater::CSV
|
159
|
+
|
160
|
+
data_csv path: :s3
|
162
161
|
|
163
|
-
|
162
|
+
def execute
|
163
|
+
csv.each { |line| Object.create line }
|
164
|
+
end
|
165
|
+
end
|
166
|
+
```
|
164
167
|
|
165
|
-
|
168
|
+
By default, the class name is used as the file name in `underscore` style: `my_data_migration.csv`. You can change it:
|
166
169
|
|
167
|
-
```bash
|
168
|
-
rubocop --debug --display-cop-names
|
169
170
|
```
|
171
|
+
class MyDataMigration
|
172
|
+
include DataMigrater::CSV
|
173
|
+
|
174
|
+
data_csv path: :s3, file: 'custom-name.csv'
|
175
|
+
|
176
|
+
def execute
|
177
|
+
csv.each { |line| Object.create line }
|
178
|
+
end
|
179
|
+
end
|
180
|
+
```
|
181
|
+
|
182
|
+
By default, the bucket name is `data-migrater`, to change it, just declare the `bucket` options:
|
183
|
+
|
184
|
+
```
|
185
|
+
class MyDataMigration
|
186
|
+
include DataMigrater::CSV
|
187
|
+
|
188
|
+
data_csv path: :s3, bucket: 'custom-bucket'
|
189
|
+
|
190
|
+
def execute
|
191
|
+
csv.each { |line| Object.create line }
|
192
|
+
end
|
193
|
+
end
|
194
|
+
```
|
195
|
+
|
196
|
+
When file is downloaded, it is keeped in a temporary (`/tmp`) folder waiting to be parsed, using the options `tmp_dir` you change it:
|
197
|
+
|
198
|
+
```
|
199
|
+
class MyDataMigration
|
200
|
+
include DataMigrater::CSV
|
201
|
+
|
202
|
+
data_csv path: :s3, tmp_dir: '/Users/wbotelhos'
|
203
|
+
|
204
|
+
def execute
|
205
|
+
csv.each { |line| Object.create line }
|
206
|
+
end
|
207
|
+
end
|
208
|
+
```
|
209
|
+
|
210
|
+
#### Credentials
|
211
|
+
|
212
|
+
By default, when you use the S3 feature, the envs `ACCESS_KEY_ID`, `REGION` and `SECRET_ACCESS_KEY` will be used.
|
213
|
+
If you do not want export it globally and need to pass it inside you class, just declare de `credentials` options:
|
214
|
+
|
215
|
+
```
|
216
|
+
class MyDataMigration
|
217
|
+
include DataMigrater::CSV
|
218
|
+
|
219
|
+
data_csv path: :s3, credentials: {
|
220
|
+
access_key_id: 'foo',
|
221
|
+
region: 'us-east-1',
|
222
|
+
secret_access_key: 'bar'
|
223
|
+
}
|
224
|
+
|
225
|
+
def execute
|
226
|
+
csv.each { |line| Object.create line }
|
227
|
+
end
|
228
|
+
end
|
229
|
+
```
|
230
|
+
|
231
|
+
#### Options
|
232
|
+
|
233
|
+
- `bucket`: Bucket name;
|
234
|
+
- `credentials`: AWS credentials: `access_key_id`, `region` and `secret_access_key`;
|
235
|
+
- `file`: File name;
|
236
|
+
- `path`: `:s3` to indicate the S3 support;
|
237
|
+
- `tmp_dir`: Directory where CSV will be keeped after download.
|
data/lib/data_migrater.rb
CHANGED
data/lib/data_migrater/csv.rb
CHANGED
@@ -7,20 +7,24 @@ module DataMigrater
|
|
7
7
|
require 'smarter_csv'
|
8
8
|
|
9
9
|
included do
|
10
|
-
def csv
|
11
|
-
|
10
|
+
def csv(processor: ::SmarterCSV)
|
11
|
+
return s3.download(processor: processor) if csv_s3?
|
12
12
|
|
13
|
-
|
13
|
+
processor.process csv_path, csv_options
|
14
14
|
end
|
15
15
|
|
16
16
|
def csv_path
|
17
17
|
return csv_options[:path] if csv_options[:path].present?
|
18
18
|
|
19
|
-
[csv_dir, csv_file].join
|
19
|
+
@csv_path ||= [csv_dir, csv_file].join('/')
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
23
23
|
|
24
|
+
def csv_bucket
|
25
|
+
csv_options.delete(:bucket) || 'data-migrater'
|
26
|
+
end
|
27
|
+
|
24
28
|
def csv_dir
|
25
29
|
csv_options.delete(:dir) || 'db/data_migrate/support/csv'
|
26
30
|
end
|
@@ -32,15 +36,36 @@ module DataMigrater
|
|
32
36
|
def csv_options
|
33
37
|
self.class.csv_options
|
34
38
|
end
|
39
|
+
|
40
|
+
def csv_s3?
|
41
|
+
csv_path.to_s == 's3'
|
42
|
+
end
|
43
|
+
|
44
|
+
def csv_tmp_dir
|
45
|
+
csv_options.delete(:tmp_dir) || '/tmp'
|
46
|
+
end
|
47
|
+
|
48
|
+
def s3_credentials
|
49
|
+
csv_options.delete(:credentials) || {}
|
50
|
+
end
|
51
|
+
|
52
|
+
def s3
|
53
|
+
DataMigrater::S3.new(
|
54
|
+
credentials: s3_credentials,
|
55
|
+
bucket: csv_bucket,
|
56
|
+
file: csv_file,
|
57
|
+
tmp_dir: csv_tmp_dir
|
58
|
+
)
|
59
|
+
end
|
35
60
|
end
|
36
61
|
|
37
62
|
module ClassMethods
|
38
63
|
def data_csv(options = {})
|
39
|
-
@
|
64
|
+
@csv_options = options
|
40
65
|
end
|
41
66
|
|
42
67
|
def csv_options
|
43
|
-
@
|
68
|
+
@csv_options || {}
|
44
69
|
end
|
45
70
|
end
|
46
71
|
end
|
data/lib/data_migrater/logger.rb
CHANGED
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DataMigrater
|
4
|
+
class S3
|
5
|
+
require 'aws-sdk'
|
6
|
+
|
7
|
+
def initialize(bucket:, credentials: {}, file:, tmp_dir:)
|
8
|
+
@bucket = bucket
|
9
|
+
@credentials = credentials.reverse_merge(default_credentials)
|
10
|
+
@file = file
|
11
|
+
@tmp_dir = tmp_dir
|
12
|
+
|
13
|
+
::Aws.config.update @credentials
|
14
|
+
end
|
15
|
+
|
16
|
+
def download(processor:)
|
17
|
+
File.open(file_path, 'w+') do |file|
|
18
|
+
client.get_object options, target: file
|
19
|
+
|
20
|
+
processor.process file
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def client
|
27
|
+
Aws::S3::Client.new
|
28
|
+
end
|
29
|
+
|
30
|
+
def default_credentials
|
31
|
+
{
|
32
|
+
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
|
33
|
+
region: ENV['AWS_REGION'],
|
34
|
+
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY']
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
def file_path
|
39
|
+
[@tmp_dir, @file].join('/')
|
40
|
+
end
|
41
|
+
|
42
|
+
def options
|
43
|
+
{ bucket: @bucket, key: @file }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/spec/csv/csv_spec.rb
CHANGED
@@ -3,28 +3,50 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
RSpec.describe '#data_csv' do
|
6
|
-
|
7
|
-
|
6
|
+
context 'when path is not about s3' do
|
7
|
+
before do
|
8
|
+
stub_const 'Dummy', Class.new
|
8
9
|
|
9
|
-
|
10
|
-
|
10
|
+
Dummy.class_eval { include DataMigrater::CSV }
|
11
|
+
Dummy.class_eval { data_csv dir: 'spec/support/csv' }
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'returns an array of hash' do
|
15
|
+
expect(Dummy.new.csv).to eq [
|
16
|
+
{
|
17
|
+
first_name: 'Washington',
|
18
|
+
last_name: 'Botelho',
|
19
|
+
username: 'wbotelhos',
|
20
|
+
age: 32,
|
21
|
+
birthday: '23/10/1984'
|
22
|
+
},
|
23
|
+
|
24
|
+
{
|
25
|
+
first_name: 'Lucas',
|
26
|
+
last_name: 'Souza',
|
27
|
+
username: 'lucasas'
|
28
|
+
}
|
29
|
+
]
|
30
|
+
end
|
11
31
|
end
|
12
32
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
33
|
+
context 'when path is about s3' do
|
34
|
+
before do
|
35
|
+
stub_const 'Dummy', Class.new
|
36
|
+
|
37
|
+
Dummy.class_eval { include DataMigrater::CSV }
|
38
|
+
Dummy.class_eval { data_csv path: :s3 }
|
39
|
+
|
40
|
+
allow(DataMigrater::S3).to receive(:new).with(
|
41
|
+
credentials: {},
|
42
|
+
bucket: 'data-migrater',
|
43
|
+
file: 'dummy.csv',
|
44
|
+
tmp_dir: '/tmp'
|
45
|
+
) { double download: :result }
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'reads csv from s3' do
|
49
|
+
expect(Dummy.new.csv).to eq :result
|
50
|
+
end
|
29
51
|
end
|
30
52
|
end
|
@@ -16,7 +16,7 @@ RSpec.describe '#data_logger' do
|
|
16
16
|
it 'logs on the given path file with right content' do
|
17
17
|
subject.logger.info 'done!'
|
18
18
|
|
19
|
-
result = /\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}
|
19
|
+
result = /\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} (-|\+)\d{4}\] INFO Dummy: done!\n/
|
20
20
|
|
21
21
|
expect(File.readlines('custom.log').last).to match result
|
22
22
|
end
|
@@ -35,7 +35,7 @@ RSpec.describe '#data_logger' do
|
|
35
35
|
it 'logs on log folder with class name with right content' do
|
36
36
|
subject.logger.info 'done!'
|
37
37
|
|
38
|
-
result = /\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}
|
38
|
+
result = /\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} (-|\+)\d{4}\] INFO Dummy: done!\n/
|
39
39
|
|
40
40
|
expect(File.readlines('log/dummy.log').last).to match result
|
41
41
|
end
|
@@ -53,7 +53,7 @@ RSpec.describe '#data_logger' do
|
|
53
53
|
it 'logs on log folder with class name with right content' do
|
54
54
|
subject.logger.info 'done!'
|
55
55
|
|
56
|
-
result = /\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}
|
56
|
+
result = /\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} (-|\+)\d{4}\] INFO Dummy: done!\n/
|
57
57
|
|
58
58
|
expect(File.readlines('log/dummy.log').last).to match result
|
59
59
|
end
|
data/spec/migration_spec.rb
CHANGED
@@ -34,7 +34,7 @@ describe DataMigrater::Migration do
|
|
34
34
|
DataMigration.create version: version
|
35
35
|
end
|
36
36
|
|
37
|
-
specify { expect(subject.execute).to
|
37
|
+
specify { expect(subject.execute).to eq false }
|
38
38
|
|
39
39
|
it 'does not executes' do
|
40
40
|
expect(migration).not_to receive :execute
|
@@ -53,7 +53,7 @@ describe DataMigrater::Migration do
|
|
53
53
|
it 'creates a new data_migrations' do
|
54
54
|
subject.execute
|
55
55
|
|
56
|
-
expect(DataMigration.exists?(version: version)).to
|
56
|
+
expect(DataMigration.exists?(version: version)).to eq true
|
57
57
|
end
|
58
58
|
|
59
59
|
context 'and some error is raised' do
|
@@ -67,7 +67,7 @@ describe DataMigrater::Migration do
|
|
67
67
|
begin
|
68
68
|
subject.execute
|
69
69
|
rescue
|
70
|
-
expect(DataMigration.exists?(version: version)).to
|
70
|
+
expect(DataMigration.exists?(version: version)).to eq false
|
71
71
|
end
|
72
72
|
end
|
73
73
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe DataMigrater::S3, '.download' do
|
6
|
+
subject { described_class.new bucket: 'data-migrater', file: 'dummy.csv', tmp_dir: '/tmp' }
|
7
|
+
|
8
|
+
let!(:client) { double(Aws::S3).as_null_object }
|
9
|
+
let!(:file_open) { double(File).as_null_object }
|
10
|
+
let!(:processor) { double.as_null_object }
|
11
|
+
let!(:temp_file) { double(File).as_null_object }
|
12
|
+
|
13
|
+
before do
|
14
|
+
allow(Aws::S3::Client).to receive(:new) { client }
|
15
|
+
allow(File).to receive(:open).with('/tmp/dummy.csv', 'w+').and_yield temp_file
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'downloads the csv file' do
|
19
|
+
expect(client).to receive(:get_object).with({ bucket: 'data-migrater', key: 'dummy.csv' }, target: temp_file)
|
20
|
+
|
21
|
+
subject.download processor: processor
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'process the csv content with given processor' do
|
25
|
+
expect(processor).to receive(:process).with temp_file
|
26
|
+
|
27
|
+
subject.download processor: processor
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe DataMigrater::S3, 'initialize' do
|
6
|
+
before do
|
7
|
+
allow(ENV).to receive(:[]).with('AWS_ACCESS_KEY_ID') { 'AWS_ACCESS_KEY_ID' }
|
8
|
+
allow(ENV).to receive(:[]).with('AWS_REGION') { 'AWS_REGION' }
|
9
|
+
allow(ENV).to receive(:[]).with('AWS_SECRET_ACCESS_KEY') { 'AWS_SECRET_ACCESS_KEY' }
|
10
|
+
end
|
11
|
+
|
12
|
+
context 'when only mandatory params is given' do
|
13
|
+
subject { described_class.new bucket: 'data-migrater', file: 'dummy.csv', tmp_dir: '/tmp' }
|
14
|
+
|
15
|
+
it 'caches default values and uses exported envs' do
|
16
|
+
expect(subject.instance_variable_get(:@bucket)).to eq 'data-migrater'
|
17
|
+
expect(subject.instance_variable_get(:@file)).to eq 'dummy.csv'
|
18
|
+
expect(subject.instance_variable_get(:@tmp_dir)).to eq '/tmp'
|
19
|
+
|
20
|
+
expect(subject.instance_variable_get(:@credentials)).to eq(
|
21
|
+
access_key_id: 'AWS_ACCESS_KEY_ID',
|
22
|
+
region: 'AWS_REGION',
|
23
|
+
secret_access_key: 'AWS_SECRET_ACCESS_KEY'
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'updates the aws config' do
|
28
|
+
expect(::Aws.config).to receive(:update).with(
|
29
|
+
access_key_id: 'AWS_ACCESS_KEY_ID',
|
30
|
+
region: 'AWS_REGION',
|
31
|
+
secret_access_key: 'AWS_SECRET_ACCESS_KEY'
|
32
|
+
)
|
33
|
+
|
34
|
+
subject
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context 'when some credential is given' do
|
39
|
+
subject do
|
40
|
+
described_class.new(
|
41
|
+
bucket: 'data-migrater',
|
42
|
+
file: 'dummy.csv',
|
43
|
+
tmp_dir: '/tmp',
|
44
|
+
|
45
|
+
credentials: {
|
46
|
+
access_key_id: 'access_key_id',
|
47
|
+
region: 'region',
|
48
|
+
secret_access_key: 'secret_access_key'
|
49
|
+
}
|
50
|
+
)
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'is used' do
|
54
|
+
expect(::Aws.config).to receive(:update).with(
|
55
|
+
access_key_id: 'access_key_id',
|
56
|
+
region: 'region',
|
57
|
+
secret_access_key: 'secret_access_key'
|
58
|
+
)
|
59
|
+
|
60
|
+
subject
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,56 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_migrater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Washington Botelho
|
7
8
|
- GetNinjas
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2017-
|
12
|
+
date: 2017-08-04 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: activerecord
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
16
17
|
requirements:
|
17
|
-
- - "
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '4.1'
|
21
|
+
- - "<"
|
18
22
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
23
|
+
version: '6'
|
20
24
|
type: :runtime
|
21
25
|
prerelease: false
|
22
26
|
version_requirements: !ruby/object:Gem::Requirement
|
23
27
|
requirements:
|
24
|
-
- - "
|
28
|
+
- - ">="
|
25
29
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.1
|
30
|
+
version: '4.1'
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '6'
|
27
34
|
- !ruby/object:Gem::Dependency
|
28
35
|
name: railties
|
29
36
|
requirement: !ruby/object:Gem::Requirement
|
30
37
|
requirements:
|
31
|
-
- - "
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '4.1'
|
41
|
+
- - "<"
|
32
42
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
43
|
+
version: '6'
|
34
44
|
type: :runtime
|
35
45
|
prerelease: false
|
36
46
|
version_requirements: !ruby/object:Gem::Requirement
|
37
47
|
requirements:
|
38
|
-
- - "
|
48
|
+
- - ">="
|
39
49
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.1
|
50
|
+
version: '4.1'
|
51
|
+
- - "<"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '6'
|
41
54
|
- !ruby/object:Gem::Dependency
|
42
55
|
name: smarter_csv
|
43
56
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,19 +66,19 @@ dependencies:
|
|
53
66
|
- !ruby/object:Gem::Version
|
54
67
|
version: '1.1'
|
55
68
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
69
|
+
name: aws-sdk
|
57
70
|
requirement: !ruby/object:Gem::Requirement
|
58
71
|
requirements:
|
59
|
-
- - "
|
72
|
+
- - "~>"
|
60
73
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
62
|
-
type: :
|
74
|
+
version: '2.9'
|
75
|
+
type: :runtime
|
63
76
|
prerelease: false
|
64
77
|
version_requirements: !ruby/object:Gem::Requirement
|
65
78
|
requirements:
|
66
|
-
- - "
|
79
|
+
- - "~>"
|
67
80
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
81
|
+
version: '2.9'
|
69
82
|
- !ruby/object:Gem::Dependency
|
70
83
|
name: guard-rspec
|
71
84
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,20 +121,6 @@ dependencies:
|
|
108
121
|
- - ">="
|
109
122
|
- !ruby/object:Gem::Version
|
110
123
|
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rspec
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
124
|
- !ruby/object:Gem::Dependency
|
126
125
|
name: rubocop-rspec
|
127
126
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,7 +164,9 @@ dependencies:
|
|
165
164
|
- !ruby/object:Gem::Version
|
166
165
|
version: '0'
|
167
166
|
description: Generates Data Migrations on Migrate style.
|
168
|
-
email:
|
167
|
+
email:
|
168
|
+
- wbotelhos@gmail.com
|
169
|
+
- tech@getninjas.com.br
|
169
170
|
executables: []
|
170
171
|
extensions: []
|
171
172
|
extra_rdoc_files: []
|
@@ -179,6 +180,7 @@ files:
|
|
179
180
|
- lib/data_migrater/logger.rb
|
180
181
|
- lib/data_migrater/migration.rb
|
181
182
|
- lib/data_migrater/migrator.rb
|
183
|
+
- lib/data_migrater/s3.rb
|
182
184
|
- lib/data_migrater/version.rb
|
183
185
|
- lib/data_migration.rb
|
184
186
|
- lib/generators/data_migrater/create_generator.rb
|
@@ -196,6 +198,8 @@ files:
|
|
196
198
|
- spec/logger/logger_path_spec.rb
|
197
199
|
- spec/migrater_spec.rb
|
198
200
|
- spec/migration_spec.rb
|
201
|
+
- spec/s3/download_spec.rb
|
202
|
+
- spec/s3/initialize_spec.rb
|
199
203
|
- spec/spec_helper.rb
|
200
204
|
- spec/support/common.rb
|
201
205
|
- spec/support/csv/dummy.csv
|
@@ -222,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
226
|
version: '0'
|
223
227
|
requirements: []
|
224
228
|
rubyforge_project:
|
225
|
-
rubygems_version: 2.6.
|
229
|
+
rubygems_version: 2.6.12
|
226
230
|
signing_key:
|
227
231
|
specification_version: 4
|
228
232
|
summary: A Data Migrator gem
|
@@ -237,6 +241,8 @@ test_files:
|
|
237
241
|
- spec/logger/logger_path_spec.rb
|
238
242
|
- spec/migrater_spec.rb
|
239
243
|
- spec/migration_spec.rb
|
244
|
+
- spec/s3/download_spec.rb
|
245
|
+
- spec/s3/initialize_spec.rb
|
240
246
|
- spec/spec_helper.rb
|
241
247
|
- spec/support/common.rb
|
242
248
|
- spec/support/csv/dummy.csv
|