Skip to content

Commit

Permalink
Standard rb
Browse files Browse the repository at this point in the history
  • Loading branch information
leonvogt committed Dec 3, 2022
1 parent 005cc92 commit d77bedc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lib/remote_database_importer/colorize.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
end
6 changes: 3 additions & 3 deletions lib/remote_database_importer/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions lib/remote_database_importer/operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d77bedc

Please sign in to comment.