th: consistent dividers

lolsob-rspec
kouhai dev 2022-12-17 19:05:32 -08:00
parent 4f30ab5515
commit 4de0440c46
1 changed files with 12 additions and 7 deletions

View File

@ -10,6 +10,10 @@ POSTGRES_PID_FILE = POSTGRES_DIR / 'postmaster.pid'
REDIS_DIR = DATA_DIR / 'redis' REDIS_DIR = DATA_DIR / 'redis'
REDIS_PID_FILE = REDIS_DIR / 'redis-dev.pid' REDIS_PID_FILE = REDIS_DIR / 'redis-dev.pid'
def divider
puts '=========='
end
def get_pid(pid_file) def get_pid(pid_file)
return false unless File.file?(pid_file) return false unless File.file?(pid_file)
pid = File.read(pid_file).to_i pid = File.read(pid_file).to_i
@ -58,9 +62,9 @@ namespace :deps do
end end
puts 'Starting postgres...' puts 'Starting postgres...'
puts '==========' divider
sh %(pg_ctl -D ./data/postgres start) sh %(pg_ctl -D ./data/postgres start)
puts '==========' divider
end end
task :stop do task :stop do
@ -69,9 +73,9 @@ namespace :deps do
next next
end end
puts "Stopping Postgres (pid #{pid})...\n==========" puts "Stopping Postgres (pid #{pid})..."
sh %(pg_ctl -D ./data/postgres stop) sh %(pg_ctl -D ./data/postgres stop)
puts '==========' divider
end end
end end
@ -86,9 +90,9 @@ namespace :deps do
end end
puts 'Starting redis...' puts 'Starting redis...'
puts '==========' divider
sh %(redis-server redis-dev.conf) sh %(redis-server redis-dev.conf)
puts '==========' divider
end end
task :stop do task :stop do
@ -97,7 +101,8 @@ namespace :deps do
next next
end end
puts "Stopping Redis (pid #{pid})...\n==========" puts "Stopping Redis (pid #{pid})..."
divider
Process.kill(:TERM, pid) Process.kill(:TERM, pid)
end end
end end