lib/webtranslateit/safe/pgdump.rb in webtranslateit-safe-0.4.0 vs lib/webtranslateit/safe/pgdump.rb in webtranslateit-safe-0.4.1

- old
+ new

@@ -1,36 +1,36 @@ module WebTranslateIt - module Safe - class Pgdump < Source def command - ENV['PGPASSWORD'] = (config['password'] || nil) + if config['password'] + ENV['PGPASSWORD'] = config['password'] + else + ENV['PGPASSWORD'] = nil + end "pg_dump #{postgres_options} #{postgres_username} #{postgres_host} #{postgres_port} #{@id}" end - def extension = '.sql' + def extension; '.sql'; end protected def postgres_options config[:options] end def postgres_host - config['host'] && "--host='#{config['host']}'" + config['host'] && "--host='#{config["host"]}'" end def postgres_port - config['port'] && "--port='#{config['port']}'" + config['port'] && "--port='#{config["port"]}'" end def postgres_username - config['user'] && "--username='#{config['user']}'" + config['user'] && "--username='#{config["user"]}'" end end - end - end