def run_steps
if @support_dir && @nginx_dir
show_welcome_screen
end
check_dependencies(false) || exit(1)
puts
phase = 1
total_phases = 0
if binary_support_files_should_be_installed?
check_whether_we_can_write_to(@support_dir) || exit(1)
total_phases += 4
end
if ruby_extension_should_be_installed?
check_whether_we_can_write_to(@ruby_dir) || exit(1)
total_phases += 2
end
if nginx_needs_to_be_installed?
check_whether_we_can_write_to(@nginx_dir) || exit(1)
total_phases += 4
end
if binary_support_files_should_be_installed? && should_download_binaries?
download_and_extract_binary_support_files(@support_dir) do |progress, total|
show_progress(progress, total, 1, 1, "Extracting Passenger binaries...")
end
puts
puts
end
if ruby_extension_should_be_installed? && should_download_binaries?
download_and_extract_ruby_extension(@ruby_dir) do |progress, total|
show_progress(progress, total, 1, 1, "Extracting Ruby extension...")
end
puts
puts
end
if nginx_needs_to_be_installed? && should_download_binaries?
download_and_extract_nginx_binaries(@nginx_dir) do |progress, total|
show_progress(progress, total, 1, 1, "Extracting Nginx binaries...")
end
puts
puts
end
if nginx_needs_to_be_installed?
nginx_source_dir = download_and_extract_nginx_sources do |progress, total|
show_progress(progress, total, phase, total_phases, "Extracting...")
end
phase += 1
if nginx_source_dir.nil?
puts
show_possible_solutions_for_download_and_extraction_problems
exit(1)
end
end
if ruby_extension_should_be_installed?
phase += install_ruby_extension do |progress, total, subphase, status_text|
show_progress(progress, total, phase + subphase, total_phases, status_text)
end
end
if binary_support_files_should_be_installed?
install_binary_support_files do |progress, total, subphase, status_text|
if subphase == 0
show_progress(progress, total, phase, total_phases, status_text)
else
show_progress(progress, total, phase + 1 .. phase + 3, total_phases, status_text)
end
end
phase += 4
end
if nginx_needs_to_be_installed?
install_nginx_from_source(nginx_source_dir) do |progress, total, status_text|
show_progress(progress, total, phase .. phase + 2, total_phases, status_text)
end
phase += 3
end
puts
puts "<green><b>All done!</b></green>"
puts
end