Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix to allow string keys in YAML configuration file

  • Loading branch information...
commit 76a3b0c218e6d117c0192b936b153722172e395c 1 parent 32039df
@tadman tadman authored
View
2  VERSION.yml
@@ -1,4 +1,4 @@
---
:major: 0
:minor: 2
-:patch: 0
+:patch: 1
View
2  bin/replication-helper
@@ -20,6 +20,6 @@ daemon_script_path = File.expand_path('../lib/mysql_replication_helper/daemon_la
if (!File.exist?(daemon_script_path))
daemon_script_path = Gem.required_location('mysql_replication_helper','mysql_replication_helper/daemon_launcher.rb')
-end
+end
Daemons.run(daemon_script_path)
View
9 lib/mysql_replication_helper/daemon_launcher.rb
@@ -37,22 +37,23 @@
op.on("--slave-data=s") { |dir| options[:slave_data] = dir }
op.on("--slave-user=s") { |name| options[:slave_user] = name }
-op.on("-c", "--config=s") { |path| config_file = path }
+op.on("-c", "--config=s") { |path| config_file = nil }
op.on("-v", "--verbose") { options[:verbose] = true }
-op.on("-d", "--daemon") { options[:daemon] = true }
op.on("-h", "--help") { show_help }
args = op.parse(*ARGV)
# == Configuration ==========================================================
-if (config_file)
+[ CONFIG_FILE_LOCATIONS, config_file ].flatten.each do |config_file|
if (File.exist?(config_file))
config = YAML.load(open(config_file))
+ break
end
end
-config = DEFAULT_CONFIG.merge(config).merge(options)
+config = DEFAULT_CONFIG.merge(config.inject({ }) { |h,(k,v)| h[k.to_sym] = v; h }).merge(options)
+
# == Main ===================================================================
Please sign in to comment.
Something went wrong with that request. Please try again.