dohruby 0.1.35 → 0.1.36

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 CHANGED
@@ -106,4 +106,5 @@
106
106
  * added traces to help debug problems when creating a database with bad sql
107
107
  *0.1.35* (Jun 16th, 2008)
108
108
  * fixed trace bug
109
-
109
+ *0.1.36* (Jun 16th, 2008)
110
+ * added reconfigure_connector utility
@@ -14,4 +14,13 @@ def self.drop_create_and_connect(connector, new_default_database = nil)
14
14
  create_and_connect(connector, new_default_database, true)
15
15
  end
16
16
 
17
+ def self.reconfigure_connector(cfg, connector = nil)
18
+ connector ||= DohDb::connector_instance
19
+ connector.reset
20
+ connector.host = cfg['host'] if cfg.key?('host')
21
+ connector.username = cfg['username'] if cfg.key?('username')
22
+ connector.password = cfg['password'] if cfg.key?('password')
23
+ connector.database = cfg['database'] if cfg.key?('database')
24
+ end
25
+
17
26
  end
@@ -1,3 +1,5 @@
1
+ require 'doh/mysql/connector_instance'
2
+
1
3
  module DohDb
2
4
 
3
5
  def self.mysql_arg(value, option_specifier)
@@ -15,7 +17,8 @@ def self.load_sql(filenames, host, username, password, database)
15
17
  io.close
16
18
  end
17
19
 
18
- def self.load_sql_connector(filenames, connector, alternate_database = nil)
20
+ def self.load_sql_connector(filenames, connector = nil, alternate_database = nil)
21
+ connector ||= DohDb::connector_instance
19
22
  load_sql(filenames, connector.host, connector.username, connector.password, alternate_database || connector.database)
20
23
  end
21
24
 
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.35
4
+ version: 0.1.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Makani & Kem Mason