bin/dumple in geordi-1.4.1 vs bin/dumple in geordi-1.4.2

- old
+ new

@@ -51,11 +51,11 @@ dump_dir = "#{ENV['HOME']}/dumps" unless File.directory?(dump_dir) Dir.mkdir(dump_dir) system("chmod 700 #{dump_dir}") end - + if ARGV.find{ |arg| arg == '--for_download'} dump_path = "#{dump_dir}/dump_for_download.dump" else dump_path = "#{dump_dir}/#{config['database']}_#{Time.now.strftime("%Y%m%d_%H%M%S")}.dump" end @@ -64,10 +64,16 @@ host = config['host'] case config['adapter'] when /mysql/ - system "mysqldump -u\"#{config['username']}\" -p\"#{config['password']}\" #{config['database']} -r #{dump_path} -h#{host || 'localhost'}" + command = "mysqldump -u\"#{config['username']}\" -p\"#{config['password']}\" #{config['database']} -r #{dump_path}" + if port = config['port'] + command << " -h#{host || '127.0.0.1'} -P#{port}" + else + command << " -h#{host || 'localhost'}" + end + system(command) when /postgres/ command = "PGPASSWORD=\"#{config['password']}\" pg_dump -U\"#{config['username']}\" #{config['database']} -Fc -f #{dump_path}" if host command << " -h#{host}" end