ridgepole 0.6.5.beta4 → 0.6.5.beta5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ridgepole/external_sql_executer.rb +27 -7
- data/lib/ridgepole/version.rb +1 -1
- 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: 21fa98bc837610d82369574a6b91ba5a15d166f9
|
4
|
+
data.tar.gz: 09fda9b7559d215577b5d3bb4f88752430ca6f06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d36ce28a343c134734b381ad56872c6e98c193cf46f5588a608902f302da995a14c260e7853acffdd635ba9b1aa4a132625d87b0ae88735055e7c28baf87bb8
|
7
|
+
data.tar.gz: 6eb7adbec627ea39c793e588e8dc2703e21d1879f147ce7cc881b7bb134dd1307b5b8635f8b1c5547907d6262bd227566f4c3de48b579eda563e9fdb56ca2d1b
|
@@ -7,16 +7,36 @@ class Ridgepole::ExternalSqlExecuter
|
|
7
7
|
def execute(sql)
|
8
8
|
cmd = Shellwords.join([@script, sql, JSON.dump(ActiveRecord::Base.connection_config)])
|
9
9
|
@logger.info("Execute #{@script}")
|
10
|
+
script_basename = File.basename(@script)
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
err.strip!
|
12
|
+
Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
|
13
|
+
stdin.close_write
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
begin
|
16
|
+
loop do
|
17
|
+
IO.select([stdout, stderr]).flatten.compact.each do |io|
|
18
|
+
io.each do |line|
|
19
|
+
next if line.nil?
|
20
|
+
line.strip!
|
17
21
|
|
18
|
-
|
19
|
-
|
22
|
+
if io == stderr
|
23
|
+
@logger.warn("[WARNING] #{script_basename}: #{line}")
|
24
|
+
else
|
25
|
+
@logger.info("#{script_basename}: #{line}")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
if stdout.eof? and stderr.eof?
|
31
|
+
break
|
32
|
+
end
|
33
|
+
end
|
34
|
+
rescue EOFError
|
35
|
+
end
|
36
|
+
|
37
|
+
unless wait_thr.value.success?
|
38
|
+
raise "`#{@script}` execution failed"
|
39
|
+
end
|
20
40
|
end
|
21
41
|
end
|
22
42
|
end
|
data/lib/ridgepole/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ridgepole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.5.
|
4
|
+
version: 0.6.5.beta5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|