Sha256: 944fc0fb75b08bf7ab3e428a57b124f66cb3ba0a5eb2457ff34d1a0e2efebd57
Contents?: true
Size: 1.09 KB
Versions: 16
Compression:
Stored size: 1.09 KB
Contents
class HtmlLog def initialize FileUtils.mkdir("#{Environment.dev_root}/log") if !File.exists?("#{Environment.dev_root}/log") @file=File.open("#{Environment.dev_root}/log/rake.html",'w') @file.write '<html>' @file.write '<body>' @file.write '<h1>' @file.write "rake" ARGV.each do|a| puts " #{a}" end @file.write '</h1>' @file.write '<h2>directory:' + File.dirname(__FILE__) + '</h2>' @file.write '<h2>time:' + Time.now.to_s + '</h2>' @current_task=nil @task_commands=Hash.new end def finalize @file.write('<ul>') @task_commands.each{|k,v| @file.write('<li>') @file.write(k) @file.write('</li>') } @file.write '</ul>' @file.write '</body>' @file.write '</html>' @file.close end def start_task task @current_task=task @task_commands[task]=Hash.new @task_commands[task][:command_results]=Array.new end def end_task task @current_task=nil #@file end def start_command command end def end_command command #@task_commands[@current_task][:command_results] << result end end
Version data entries
16 entries across 16 versions & 1 rubygems