lib/heroku_pull.rb in heroku_pull-0.0.2 vs lib/heroku_pull.rb in heroku_pull-0.0.3
- old
+ new
@@ -8,28 +8,28 @@
def capture
cmd = "heroku pgbackups:capture --expire"
puts "Capture the database..."
puts cmd
- system_with_app_name cmd
+ system cmd_with_app_name(cmd)
end
def download
- cmd = "wget -O #{filename} `heroku pgbackups:url`"
+ cmd = "wget -O #{filename} `#{cmd_with_app_name("heroku pgbackups:url")}`"
puts "Download backup file..."
puts cmd
- system_with_app_name cmd
+ system cmd
end
def restore
cmd = "pg_restore --verbose --clean --no-acl --no-owner -h localhost -d #{database} #{filename}"
puts "Restore local database..."
puts cmd
- system_with_app_name cmd
+ system cmd
end
- def system_with_app_name(cmd)
- system(HerokuPull.app_name ? "#{cmd} --app #{HerokuPull.app_name}" : cmd)
+ def cmd_with_app_name(cmd)
+ (HerokuPull.app_name ? "#{cmd} --app #{HerokuPull.app_name}" : cmd)
end
def filename
"./tmp/heroku_pull.sql"
end