class Astrails::Safe::Pgdump
Public Instance Methods
command()
click to toggle source
# File lib/astrails/safe/pgdump.rb, line 5 def command if @config["password"] ENV['PGPASSWORD'] = @config["password"] else ENV['PGPASSWORD'] = nil end "pg_dump #{postgres_options} #{postgres_username} #{postgres_host} #{postgres_port} #{@id}" end
extension()
click to toggle source
# File lib/astrails/safe/pgdump.rb, line 14 def extension; '.sql'; end
Protected Instance Methods
postgres_host()
click to toggle source
# File lib/astrails/safe/pgdump.rb, line 22 def postgres_host @config["host"] && "--host='#{@config["host"]}'" end
postgres_options()
click to toggle source
# File lib/astrails/safe/pgdump.rb, line 18 def postgres_options @config[:options] end
postgres_port()
click to toggle source
# File lib/astrails/safe/pgdump.rb, line 26 def postgres_port @config["port"] && "--port='#{@config["port"]}'" end
postgres_username()
click to toggle source
# File lib/astrails/safe/pgdump.rb, line 30 def postgres_username @config["user"] && "--username='#{@config["user"]}'" end