dohmysql 0.2.34 → 0.2.35
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 +4 -4
- data/lib/dohmysql/load_sql.rb +9 -6
- 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: 67233ea9d63a00d86fef0a03eae15851a19bdad5
|
4
|
+
data.tar.gz: 58d2659c41deede9a881d74ffd8c2d3f587f0808
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b59b5b8efa61a7aa8a3e07173a5f6ef98478e3472726831c6b54b499870e88b82443e31f5574683c1551ba673802a7be28f6c7a33f9f0132e116369863aa429
|
7
|
+
data.tar.gz: 2cacdfa41e2e855c7943eb2035d7d7a0bcc61664a4f70c36a9dc0ff3b90923b4a0bf7e21242b7b542056f7b2897bbc0e99fff0dc9eb15f25a06a1175f27bb404
|
data/lib/dohmysql/load_sql.rb
CHANGED
@@ -37,18 +37,21 @@ def self.load_sql(dbconfig, filenames)
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
# trying Open3 now for better error handling; unknown as of yet if this works under JRuby
|
41
40
|
def self.load_sql_using_each_open3(dbconfig, filenames)
|
42
41
|
dohlog.debug("loading sql file: " + filenames.first) if filenames.size == 1
|
43
42
|
|
44
43
|
basecmd = 'mysql' + mysql_arg(dbconfig[:host], 'h') + mysql_arg(dbconfig[:username], 'u') + mysql_arg(dbconfig[:password], 'p') + ' ' + dbconfig[:database] + ' < '
|
45
44
|
filenames.each do |elem|
|
46
45
|
mysqlcmd = "#{basecmd} #{elem}"
|
47
|
-
stdin, stdout, stderr
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
Open3.popen3(mysqlcmd) do |stdin, stdout, stderr, wait_thr|
|
47
|
+
# don't care about any stdout
|
48
|
+
stdout.read
|
49
|
+
errstr = stderr.read.strip
|
50
|
+
errstr = '' if errstr == 'Warning: Using a password on the command line interface can be insecure.'
|
51
|
+
status = wait_thr.value.exitstatus
|
52
|
+
raise "mysql had stderr #{errstr}" unless errstr.empty?
|
53
|
+
raise "mysql command failed with exit code #{status}" unless status == 0
|
54
|
+
end
|
52
55
|
end
|
53
56
|
end
|
54
57
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dohmysql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Makani Mason
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dohroot
|