forklift_etl 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/Gemfile.lock +22 -23
- data/lib/forklift/transports/elasticsearch.rb +4 -0
- data/lib/forklift/version.rb +1 -1
- data/spec/support/dumps/mysql/forklift_test_source_a.sql +7 -6
- data/spec/unit/connection/mysql_spec.rb +2 -2
- data/spec/unit/misc/email_spec.rb +6 -6
- data/spec/unit/misc/step_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MThmMGU3YjE2YWU5YTNhMmM1NWU4ZjNlNGNjODk0Njk2ZGI2ZmZiMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTA0N2JkYTQ2YTJiOWJjZDNjOTlkNTY2OGU0OTVlOGIwZDg2MWY4ZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzNlODE5ZDNmMzc3NTVhYjBhY2NkN2Q4NDBmMWQ3NmU4YzRlYzc4MzYzM2Fm
|
10
|
+
Nzk1NTA4YmRkOTkyZTViMGU0MzBlMjZjMzZhOGU3ZmUxMWUzNzI4YTAyZjMx
|
11
|
+
YzhmZWVmMmIwMjZjYTA4ODAzYjQ4NTBjOTI5Y2Y2NzY1YzVhM2Y=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzcwZTg5YjZiOGI1ZjYxNzQ1ZjIwMmVkM2JmMDI0YTU1ZTQwYTQxYzRiMGE1
|
14
|
+
OWZhNTNhOTM4N2NhMGM5MGEyNDc0NzZkMTk2MjU3ODhhNDI1OTk5YWI4ODAx
|
15
|
+
MmMyMTdhZGE2YmIwN2FkZDQ0MjllYzlhNDAyNzFiMGJjMzk5NzA=
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
forklift_etl (1.1.
|
4
|
+
forklift_etl (1.1.6)
|
5
5
|
activesupport (~> 4.0, >= 4.0.0)
|
6
6
|
elasticsearch (~> 1.0, >= 1.0.0)
|
7
7
|
lumberjack (~> 1.0, >= 1.0.0)
|
@@ -11,7 +11,7 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
activesupport (4.1.
|
14
|
+
activesupport (4.1.4)
|
15
15
|
i18n (~> 0.6, >= 0.6.9)
|
16
16
|
json (~> 1.7, >= 1.7.7)
|
17
17
|
minitest (~> 5.1)
|
@@ -28,40 +28,39 @@ GEM
|
|
28
28
|
elasticsearch-transport (1.0.4)
|
29
29
|
faraday
|
30
30
|
multi_json
|
31
|
-
email_spec (1.
|
31
|
+
email_spec (1.6.0)
|
32
32
|
launchy (~> 2.1)
|
33
33
|
mail (~> 2.2)
|
34
34
|
faraday (0.9.0)
|
35
35
|
multipart-post (>= 1.2, < 3)
|
36
|
-
i18n (0.6.
|
36
|
+
i18n (0.6.11)
|
37
37
|
json (1.8.1)
|
38
38
|
launchy (2.4.2)
|
39
39
|
addressable (~> 2.3)
|
40
40
|
lumberjack (1.0.9)
|
41
|
-
mail (2.
|
42
|
-
mime-types (
|
43
|
-
|
44
|
-
|
45
|
-
minitest (5.3.5)
|
41
|
+
mail (2.6.1)
|
42
|
+
mime-types (>= 1.16, < 3)
|
43
|
+
mime-types (2.3)
|
44
|
+
minitest (5.4.0)
|
46
45
|
multi_json (1.10.1)
|
47
46
|
multipart-post (2.0.0)
|
48
47
|
mysql2 (0.3.16)
|
49
|
-
|
50
|
-
pony (1.9)
|
48
|
+
pony (1.10)
|
51
49
|
mail (>= 2.0)
|
52
|
-
rake (10.
|
53
|
-
rspec (
|
54
|
-
rspec-core (~>
|
55
|
-
rspec-expectations (~>
|
56
|
-
rspec-mocks (~>
|
57
|
-
rspec-core (
|
58
|
-
|
59
|
-
|
60
|
-
|
50
|
+
rake (10.3.2)
|
51
|
+
rspec (3.0.0)
|
52
|
+
rspec-core (~> 3.0.0)
|
53
|
+
rspec-expectations (~> 3.0.0)
|
54
|
+
rspec-mocks (~> 3.0.0)
|
55
|
+
rspec-core (3.0.2)
|
56
|
+
rspec-support (~> 3.0.0)
|
57
|
+
rspec-expectations (3.0.2)
|
58
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
59
|
+
rspec-support (~> 3.0.0)
|
60
|
+
rspec-mocks (3.0.2)
|
61
|
+
rspec-support (~> 3.0.0)
|
62
|
+
rspec-support (3.0.2)
|
61
63
|
thread_safe (0.3.4)
|
62
|
-
treetop (1.4.15)
|
63
|
-
polyglot
|
64
|
-
polyglot (>= 0.3.1)
|
65
64
|
tzinfo (1.2.1)
|
66
65
|
thread_safe (~> 0.1)
|
67
66
|
|
@@ -28,6 +28,7 @@ module Forklift
|
|
28
28
|
prepared_query[:from] = from + offset
|
29
29
|
prepared_query[:size] = size
|
30
30
|
|
31
|
+
forklift.logger.debug " ELASTICSEARCH: #{query}"
|
31
32
|
results = client.search( { index: index, body: prepared_query } )
|
32
33
|
results["hits"]["hits"].each do |hit|
|
33
34
|
data << hit["_source"]
|
@@ -57,12 +58,15 @@ module Forklift
|
|
57
58
|
type: type,
|
58
59
|
}
|
59
60
|
object[:id] = d[primary_key] if ( !d[primary_key].nil? && update == true )
|
61
|
+
|
62
|
+
forklift.logger.debug " ELASTICSEARCH (store): #{object}"
|
60
63
|
client.index object
|
61
64
|
end
|
62
65
|
client.indices.refresh({ index: index })
|
63
66
|
end
|
64
67
|
|
65
68
|
def delete_index(index)
|
69
|
+
forklift.logger.debug " ELASTICSEARCH (delete index): #{index}"
|
66
70
|
client.indices.delete({ index: index }) if client.indices.exists({ index: index })
|
67
71
|
end
|
68
72
|
|
data/lib/forklift/version.rb
CHANGED
@@ -6,6 +6,7 @@ DROP TABLE IF EXISTS `products`;
|
|
6
6
|
CREATE TABLE `products` (
|
7
7
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
8
8
|
`name` varchar(255) NOT NULL DEFAULT '',
|
9
|
+
`description` text NOT NULL,
|
9
10
|
`inventory` int(11) DEFAULT NULL,
|
10
11
|
`created_at` datetime NOT NULL,
|
11
12
|
`updated_at` datetime NOT NULL,
|
@@ -14,13 +15,13 @@ CREATE TABLE `products` (
|
|
14
15
|
|
15
16
|
LOCK TABLES `products` WRITE;
|
16
17
|
|
17
|
-
INSERT INTO `products` (`id`, `name`, `inventory`, `created_at`, `updated_at`)
|
18
|
+
INSERT INTO `products` (`id`, `name`, `description`, `inventory`, `created_at`, `updated_at`)
|
18
19
|
VALUES
|
19
|
-
(1,'car',10,'2014-04-03 11:45:51','2014-04-03 11:45:51'),
|
20
|
-
(2,'boat',3,'2014-04-03 11:45:52','2014-04-03 11:45:52'),
|
21
|
-
(3,'bus',5,'2014-04-03 11:45:54','2014-04-03 11:45:54'),
|
22
|
-
(4,'motorcycle',23,'2014-04-03 11:45:56','2014-04-03 11:45:56'),
|
23
|
-
(5,'hang_glider',2,'2014-04-03 11:46:19','2014-04-03 11:46:19');
|
20
|
+
(1,'car','a car',10,'2014-04-03 11:45:51','2014-04-03 11:45:51'),
|
21
|
+
(2,'boat','a boat',3,'2014-04-03 11:45:52','2014-04-03 11:45:52'),
|
22
|
+
(3,'bus','a bus',5,'2014-04-03 11:45:54','2014-04-03 11:45:54'),
|
23
|
+
(4,'motorcycle','a motorcycle',23,'2014-04-03 11:45:56','2014-04-03 11:45:56'),
|
24
|
+
(5,'hang_glider','awesome',2,'2014-04-03 11:46:19','2014-04-03 11:46:19');
|
24
25
|
|
25
26
|
UNLOCK TABLES;
|
26
27
|
|
@@ -91,12 +91,12 @@ describe Forklift::Connection::Mysql do
|
|
91
91
|
|
92
92
|
it "escapes one trailing backslash" do
|
93
93
|
values = ["foo\\"]
|
94
|
-
subject.send(:safe_values, values).
|
94
|
+
expect(subject.send(:safe_values, values)).to eq("\"foo\\\\\"")
|
95
95
|
end
|
96
96
|
|
97
97
|
it "escapes two trailing backslashes" do
|
98
98
|
values = ["foo\\\\"]
|
99
|
-
subject.send(:safe_values, values).
|
99
|
+
expect(subject.send(:safe_values, values)).to eq("\"foo\\\\\\\\\"")
|
100
100
|
end
|
101
101
|
end
|
102
102
|
end
|
@@ -22,15 +22,15 @@ describe 'misc forklift core' do
|
|
22
22
|
@email = plan.mailer.send_template(email_args, email_template, email_variables).first
|
23
23
|
}
|
24
24
|
|
25
|
-
@email.
|
26
|
-
@email.
|
27
|
-
@email.
|
28
|
-
@email.
|
29
|
-
@email.
|
25
|
+
expect(@email).to deliver_to("YOU@FAKE.com")
|
26
|
+
expect(@email).to have_subject(/Forklift has moved your database/)
|
27
|
+
expect(@email).to have_body_text(/Your forklift email/) # base
|
28
|
+
expect(@email).to have_body_text(/Total Users: 10/) # template
|
29
|
+
expect(@email).to have_body_text(/New Users: 5/) # template
|
30
30
|
end
|
31
31
|
|
32
32
|
it "can send mail with an attachment" do
|
33
|
-
|
33
|
+
skip("how to test email attachments?")
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
data/spec/unit/misc/step_spec.rb
CHANGED
@@ -13,7 +13,7 @@ describe 'misc forklift core' do
|
|
13
13
|
|
14
14
|
it "will run all steps with no extra ARGV" do
|
15
15
|
plan = SpecPlan.new
|
16
|
-
plan.
|
16
|
+
allow(plan).to receive(:argv){ ['/path/to/plan'] }
|
17
17
|
steps_run = []
|
18
18
|
plan.do! {
|
19
19
|
plan.step("a"){ steps_run << 'a' }
|
@@ -27,7 +27,7 @@ describe 'misc forklift core' do
|
|
27
27
|
|
28
28
|
it "will only run steps named within ARGV" do
|
29
29
|
plan = SpecPlan.new
|
30
|
-
plan.
|
30
|
+
allow(plan).to receive(:argv){ ['/path/to/plan', 'a','c'] }
|
31
31
|
steps_run = []
|
32
32
|
plan.do! {
|
33
33
|
plan.step("a"){ steps_run << 'a' }
|
@@ -41,7 +41,7 @@ describe 'misc forklift core' do
|
|
41
41
|
|
42
42
|
it "won't run on a badly defined step" do
|
43
43
|
plan = SpecPlan.new
|
44
|
-
plan.
|
44
|
+
allow(plan).to receive(:argv){ ['/path/to/plan', 'missing_step'] }
|
45
45
|
expect{
|
46
46
|
plan.do! {
|
47
47
|
plan.step("a"){ raise 'never should get here' }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forklift_etl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Tahler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|