diff options
Diffstat (limited to 'lib/backup/database.rb')
-rw-r--r-- | lib/backup/database.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/backup/database.rb b/lib/backup/database.rb index c4fb2e2e159..7af7140246a 100644 --- a/lib/backup/database.rb +++ b/lib/backup/database.rb @@ -13,20 +13,20 @@ module Backup def dump case config["adapter"] when /^mysql/ then - system("mysqldump #{mysql_args} #{config['database']} > #{db_file_name}") + system('mysqldump', *mysql_args, config['database'], out: db_file_name) when "postgresql" then pg_env - system("pg_dump #{config['database']} > #{db_file_name}") + system('pg_dump', config['database'], out: db_file_name) end end def restore case config["adapter"] when /^mysql/ then - system("mysql #{mysql_args} #{config['database']} < #{db_file_name}") + system('mysql', *mysql_args, config['database'], in: db_file_name) when "postgresql" then pg_env - system("psql #{config['database']} -f #{db_file_name}") + system('psql', config['database'], '-f', db_file_name) end end @@ -45,7 +45,7 @@ module Backup 'encoding' => '--default-character-set', 'password' => '--password' } - args.map { |opt, arg| "#{arg}='#{config[opt]}'" if config[opt] }.compact.join(' ') + args.map { |opt, arg| "#{arg}=#{config[opt]}" if config[opt] }.compact end def pg_env |