forklift_etl 1.0.12 → 1.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +9 -7
- data/lib/forklift/transports/mysql.rb +3 -3
- data/lib/forklift/version.rb +1 -1
- data/spec/integration/mysql_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
|
+
MjQ1MzQwOGNlOWMxNWExZTc2OTBjODAyNzhlMzQyNjU2N2EyNzE0ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Nzk0NDM0MWJlODQ0YmIwYjdkNDgyNWU3ZGU1ZWYyOWI0ZWM3YTg2Ng==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDZjNzhhMDQ0NzkwOGFiNDUyMzIwYWFmNjdiMWUzNGRjOTdiMWQyMjEzMTBk
|
10
|
+
MmQ4OWEwYjhjZWMwZGE2ZTk5ZDA4YTBjOGIxMTAxOTYxYTQ1ODQzZWIyOTgx
|
11
|
+
Y2NiM2MzNWU5ZWQ4MzQ5NzEyOGYxMGJhZmY2YmZiMjkyMDQ5ZmY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWNmZjk4NWRjYzlhMTEyMWIzNTk1YWE2NGVlYWViYjA0NGNiNmIyMzJhOWY2
|
14
|
+
MmFhMDY2MjMwMWYzYzQyNjA2M2NmY2EwOTcyOTM0MTRlMzc2OTcxODk0M2I5
|
15
|
+
NDAyZmVjYmEzNjhiYzIzMWJhYzVjMjNjYmRiYTAwMjk1MjlhNzI=
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
forklift_etl (1.0.
|
4
|
+
forklift_etl (1.0.14)
|
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,12 +11,12 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
activesupport (4.0
|
14
|
+
activesupport (4.1.0)
|
15
15
|
i18n (~> 0.6, >= 0.6.9)
|
16
|
-
|
17
|
-
|
16
|
+
json (~> 1.7, >= 1.7.7)
|
17
|
+
minitest (~> 5.1)
|
18
18
|
thread_safe (~> 0.1)
|
19
|
-
tzinfo (~>
|
19
|
+
tzinfo (~> 1.1)
|
20
20
|
addressable (2.3.6)
|
21
21
|
awesome_print (1.2.0)
|
22
22
|
diff-lcs (1.2.5)
|
@@ -34,6 +34,7 @@ GEM
|
|
34
34
|
faraday (0.9.0)
|
35
35
|
multipart-post (>= 1.2, < 3)
|
36
36
|
i18n (0.6.9)
|
37
|
+
json (1.8.1)
|
37
38
|
launchy (2.4.2)
|
38
39
|
addressable (~> 2.3)
|
39
40
|
lumberjack (1.0.5)
|
@@ -41,7 +42,7 @@ GEM
|
|
41
42
|
mime-types (~> 1.16)
|
42
43
|
treetop (~> 1.4.8)
|
43
44
|
mime-types (1.25.1)
|
44
|
-
minitest (
|
45
|
+
minitest (5.3.3)
|
45
46
|
multi_json (1.9.2)
|
46
47
|
multipart-post (2.0.0)
|
47
48
|
mysql2 (0.3.15)
|
@@ -61,7 +62,8 @@ GEM
|
|
61
62
|
treetop (1.4.15)
|
62
63
|
polyglot
|
63
64
|
polyglot (>= 0.3.1)
|
64
|
-
tzinfo (
|
65
|
+
tzinfo (1.1.0)
|
66
|
+
thread_safe (~> 0.1)
|
65
67
|
|
66
68
|
PLATFORMS
|
67
69
|
ruby
|
@@ -99,7 +99,7 @@ module Forklift
|
|
99
99
|
end
|
100
100
|
|
101
101
|
def sql_type(v)
|
102
|
-
return "
|
102
|
+
return "bigint(20)" if v.class == Fixnum
|
103
103
|
return "float" if v.class == Float
|
104
104
|
return "date" if v.class == Date
|
105
105
|
return "datetime" if v.class == Time
|
@@ -128,7 +128,7 @@ module Forklift
|
|
128
128
|
if ( last_copied_row.nil? || last_copied_row[matcher.to_sym].nil? )
|
129
129
|
latest_timestamp = '1970-01-01 00:00'
|
130
130
|
else
|
131
|
-
return last_copied_row[matcher.to_sym].to_s
|
131
|
+
return last_copied_row[matcher.to_sym].to_s(:db)
|
132
132
|
end
|
133
133
|
end
|
134
134
|
|
@@ -222,7 +222,7 @@ module Forklift
|
|
222
222
|
v.gsub!('\"', '\/"')
|
223
223
|
v.gsub!('"', '\"')
|
224
224
|
part = "\"#{v}\""
|
225
|
-
elsif( [::Date, ::Time].include?(v.class) )
|
225
|
+
elsif( [::Date, ::Time, ::DateTime].include?(v.class) )
|
226
226
|
s = v.to_s(:db)
|
227
227
|
part = "\"#{s}\""
|
228
228
|
elsif( [::Fixnum].include?(v.class) )
|
data/lib/forklift/version.rb
CHANGED
@@ -37,7 +37,7 @@ describe 'mysql' do
|
|
37
37
|
it "can write new data" do
|
38
38
|
table = "users"
|
39
39
|
data = [
|
40
|
-
{:email => 'other@example.com', :first_name => 'other', :last_name => 'n', :created_at => Time.new.to_s(:
|
40
|
+
{:email => 'other@example.com', :first_name => 'other', :last_name => 'n', :created_at => Time.new.to_s(:db), :updated_at => Time.new.to_s(:db)}
|
41
41
|
]
|
42
42
|
plan = SpecPlan.new
|
43
43
|
plan.do! {
|
@@ -53,7 +53,7 @@ describe 'mysql' do
|
|
53
53
|
it "can update existing data" do
|
54
54
|
table = "users"
|
55
55
|
data = [
|
56
|
-
{:id => 1, :email => 'evan@example.com', :first_name => 'New Name', :last_name => 'T', :created_at => Time.new.to_s(:
|
56
|
+
{:id => 1, :email => 'evan@example.com', :first_name => 'New Name', :last_name => 'T', :created_at => Time.new.to_s(:db), :updated_at => Time.new.to_s(:db)}
|
57
57
|
]
|
58
58
|
plan = SpecPlan.new
|
59
59
|
plan.do! {
|
@@ -94,7 +94,7 @@ describe 'mysql' do
|
|
94
94
|
cols << row["Field"]
|
95
95
|
case row["Field"]
|
96
96
|
when "id"
|
97
|
-
expect(row["Type"]).to eql "
|
97
|
+
expect(row["Type"]).to eql "bigint(20)"
|
98
98
|
when "thing"
|
99
99
|
expect(row["Type"]).to eql "text"
|
100
100
|
when "updated_at"
|
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.0.
|
4
|
+
version: 1.0.14
|
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-04-
|
11
|
+
date: 2014-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|