diff --git a/lib/remote_database_importer/colorize.rb b/lib/remote_database_importer/colorize.rb index 3c10668..3902f54 100644 --- a/lib/remote_database_importer/colorize.rb +++ b/lib/remote_database_importer/colorize.rb @@ -4,10 +4,10 @@ def self.red(text) end def self.green(text) - "\e[32m#{text}\e[0m" + "\e[32m#{text}\e[0m" end def self.blue(text) "\e[94m#{text}\e[0m" end -end \ No newline at end of file +end diff --git a/lib/remote_database_importer/config.rb b/lib/remote_database_importer/config.rb index 7457a45..432d3d9 100644 --- a/lib/remote_database_importer/config.rb +++ b/lib/remote_database_importer/config.rb @@ -4,10 +4,10 @@ class Config require_relative "colorize" attr_accessor :config - + def initialize @config = TTY::Config.new - + config.filename = "remote_database_importer" config.extname = ".yml" config.append_path Dir.pwd @@ -63,7 +63,7 @@ def create_default_config else postgres_port = ask("Enter the database port for the pg_dump command:", default: "5432") end - + puts Colorize.green("Define custom commands that run after successful import:") custom_commands = ask("Enter semicolon separated commands that should run after importing the DB:", default: "rake db:migrate; echo 'All Done'") puts diff --git a/lib/remote_database_importer/operation.rb b/lib/remote_database_importer/operation.rb index 8b5e474..bec5eb9 100644 --- a/lib/remote_database_importer/operation.rb +++ b/lib/remote_database_importer/operation.rb @@ -72,12 +72,12 @@ def terminate_current_db_sessions end def dump_remote_db - host = current_environment["connection"]["host"] - db_name = current_environment["database"]["name"] - db_user = current_environment["database"]["user"] - dump_type = current_environment["connection"]["dump_type"] - ssh_user = current_environment["connection"]["ssh_user"] - ssh_port = current_environment["connection"]["ssh_port"] + host = current_environment["connection"]["host"] + db_name = current_environment["database"]["name"] + db_user = current_environment["database"]["user"] + dump_type = current_environment["connection"]["dump_type"] + ssh_user = current_environment["connection"]["ssh_user"] + ssh_port = current_environment["connection"]["ssh_port"] postgres_port = current_environment["connection"]["postgres_port"] if dump_type == "ssh_tunnel"