Sha256: 061787f2b6c11a6d131d1fb7590e3e4b5029cf394d1b011044bec1bfb25b5cf0

Contents?: true

Size: 1.04 KB

Versions: 12

Compression:

Stored size: 1.04 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

12 entries across 12 versions & 1 rubygems

Version Path
dev_tasks-1.0.37 lib/htmllog.rb
dev_tasks-1.0.35 lib/htmllog.rb
dev_tasks-1.0.34 lib/htmllog.rb
dev_tasks-1.0.33 lib/htmllog.rb
dev_tasks-1.0.31 lib/htmllog.rb
dev_tasks-1.0.30 lib/htmllog.rb
dev_tasks-1.0.29 lib/htmllog.rb
dev_tasks-1.0.28 lib/htmllog.rb
dev_tasks-1.0.12 lib/htmllog.rb
dev_tasks-1.0.11 lib/htmllog.rb
dev_tasks-1.0.10 lib/htmllog.rb
dev_tasks-1.0.9 lib/htmllog.rb