I instantly refresh my browser after deploying to make sure nothing went
wrong. This gets tiring so I added some code to hit the site and print
results after the deployment task has been run. The Net:HTTP code is taken
verbatim from the pickaxe Net:HTTP reference.
task :after_deploy, :roles => :app do
sanity_check
end
desc "Use Net:HTTP to pull up the live site"
task :sanity_check do
Net::HTTP.start(''www.yoursite.com'') do |http|
response = http.get(''/'')
puts "Code = #{response.code}"
puts "Message = #{response.message}"
response.each do |key,val|
printf "%-14s = %-40.40s\n", key, val
end
p response.body[400,500]
end
end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---