dohruby 0.1.33 → 0.1.34
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.
- data/CHANGELOG +3 -0
- data/bin/create_database.rb +4 -0
- data/lib/doh/mysql/database_creator.rb +4 -1
- data/lib/doh/mysql/load_sql.rb +1 -0
- metadata +2 -2
data/CHANGELOG
CHANGED
@@ -102,3 +102,6 @@
|
|
102
102
|
* add default values for host_files_directory config entry
|
103
103
|
*0.1.33* (Jun 13th, 2008)
|
104
104
|
* added new app_no_stdio where console logging is disabled
|
105
|
+
*0.1.34* (Jun 14th, 2008)
|
106
|
+
* added traces to help debug problems when creating a database with bad sql
|
107
|
+
|
data/bin/create_database.rb
CHANGED
@@ -8,6 +8,10 @@ opts = DohApp::Options.new(
|
|
8
8
|
,'all' => [false, "-a", "--all", "create all databases"] \
|
9
9
|
})
|
10
10
|
|
11
|
+
if opts.database.to_s.empty?
|
12
|
+
puts "You must specify a database (either here with -d or in your config)"
|
13
|
+
exit 1
|
14
|
+
end
|
11
15
|
db_creator = DohDb::DatabaseCreator.new
|
12
16
|
if opts.all
|
13
17
|
db_creator.create_all_databases(opts.drop_first)
|
@@ -78,7 +78,10 @@ private
|
|
78
78
|
|
79
79
|
files = find_files(source_db, 'tables') + find_files(source_db, 'insert_sql') + view_files(source_db)
|
80
80
|
DohDb::load_sql_connector(files, @connector, dest_db)
|
81
|
-
find_files(source_db, 'insert_scripts', '.rb').each
|
81
|
+
find_files(source_db, 'insert_scripts', '.rb').each do |filename|
|
82
|
+
Doh::log.info("loading file: #{filname}")
|
83
|
+
load(filename)
|
84
|
+
end
|
82
85
|
end
|
83
86
|
end
|
84
87
|
|
data/lib/doh/mysql/load_sql.rb
CHANGED
@@ -9,6 +9,7 @@ def self.load_sql(filenames, host, username, password, database)
|
|
9
9
|
mysqlcmd = 'mysql' + mysql_arg(host, 'h') + mysql_arg(username, 'u') + mysql_arg(password, 'p') + ' ' + database
|
10
10
|
io = IO::popen(mysqlcmd, 'r+')
|
11
11
|
filenames.each do |elem|
|
12
|
+
Doh::log.debug("loading file: #{elem}")
|
12
13
|
open(elem) {|file| io << file.read}
|
13
14
|
end
|
14
15
|
io.close
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dohruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.34
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Makani & Kem Mason
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-06-
|
12
|
+
date: 2008-06-14 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|