require 'hpricot' APPLICATION = "Saleboard" APPLICATION_NUMBER="068" LEAD_DEVELOPER="Kevin Gisi" PRIMARY_CLIENT="Deb Klossner" desc "Generate a full report" task :report => :environment do puts "=== Deployment Report Generator ===" puts "Building environment report..." report = %Q{ Deployment Checklist

LTS Deployment Checklist


Application: #{APPLICATION}
Application Number: #{APPLICATION_NUMBER}
Lead Developer: #{LEAD_DEVELOPER}
Primary Client: #{PRIMARY_CLIENT}

Ruby Version: #{RUBY_VERSION}
Rails Version: #{Rails.version}
Report Generated: #{Time.now.strftime('%B%e, %Y')}


} Rake::Task['rcov:full'].invoke unit_tests = open("coverage/units/index.html"){|f| Hpricot(f)} report += "

Unit Tests

" report += "" unit_tests.search("body/table[@class='report']/tbody/tr").each do |row| report += "" title = row.at("td") report += "" report += "" report += "" report += "" report += "" end report += "
Total LinesLines of CodeCoverage
#{(link=title.at("a")) ? link.inner_html : title.inner_html}#{row.at("td[@class='lines_total']/tt").inner_html}#{row.at("td[@class='lines_code']/tt").inner_html}#{row.at("tt[@class='coverage_code']").inner_html}

" functional_tests = open("coverage/functionals/index.html"){|f| Hpricot(f)} report += "

Functional Tests

" report += "" functional_tests.search("body/table[@class='report']/tbody/tr").each do |row| report += "" title = row.at("td") report += "" report += "" report += "" report += "" report += "" end report += "
Total LinesLines of CodeCoverage
#{(link=title.at("a")) ? link.inner_html : title.inner_html}#{row.at("td[@class='lines_total']/tt").inner_html}#{row.at("td[@class='lines_code']/tt").inner_html}#{row.at("tt[@class='coverage_code']").inner_html}

" doc = Hpricot(`cucumber features --format html`) doc.search("//div[@class='scenario']").each do |scenario| scenario.after %q{
Automated Check
Developer Check
Client Check
} end report += doc.search("//div[@class='cucumber']").to_html report += %Q{

Comments

Developer Comments

Client Comments

Deployment

Once this application is deployed, LTS-Web Development will provide bug-fixes for requests submitted within two weeks of deployment. Any issues with the application beyond the two-week window may either be immediately fixed - at the discretion of LTS-Web Development - or added as features to a new project request. Any additional features required after deployment will be added as requirements for a new project request, so as to ensure fair distribution of resources to application requests.

I understand the deployment policies, and request this application be deployed at the earliest possible time.

                                                     Date:                     

} report += %q{
} File.open('report.html','w'){|f| f.write(report)} puts "Final report written to report.html" end