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

Version Path
dev_tasks-1.0.38 lib/htmllog.rb
dev_tasks-1.0.27 lib/htmllog.rb
dev_tasks-1.0.26 lib/htmllog.rb
dev_tasks-1.0.25 lib/htmllog.rb
dev_tasks-1.0.24 lib/htmllog.rb
dev_tasks-1.0.23 lib/htmllog.rb
dev_tasks-1.0.22 lib/htmllog.rb
dev_tasks-1.0.21 lib/htmllog.rb
dev_tasks-1.0.20 lib/htmllog.rb
dev_tasks-1.0.19 lib/htmllog.rb
dev_tasks-1.0.18 lib/htmllog.rb
dev_tasks-1.0.17 lib/htmllog.rb
dev_tasks-1.0.16 lib/htmllog.rb
dev_tasks-1.0.15 lib/htmllog.rb
dev_tasks-1.0.14 lib/htmllog.rb
dev_tasks-1.0.13 lib/htmllog.rb