Sha256: a1b90871af21f5e4b50933805fbb1737513ec49c132b84aff08d149745964df1

Contents?: true

Size: 993 Bytes

Versions: 12

Compression:

Stored size: 993 Bytes

Contents

class HtmlLog
	def initialize
		FileUtils.mkdir('log') if !File.exists?('log')
		@file=File.open('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.8 lib/htmllog.rb
dev_tasks-1.0.7 lib/htmllog.rb
dev_tasks-1.0.6 lib/htmllog.rb
dev_tasks-1.0.5 lib/htmllog.rb
dev_tasks-1.0.4 lib/htmllog.rb
dev_tasks-1.0.3 lib/htmllog.rb
dev_tasks-1.0.2 lib/htmllog.rb
dev_tasks-1.0.1 lib/htmllog.rb
dev_tasks-0.0.167 lib/htmllog.rb
dev_tasks-1.0.0 lib/htmllog.rb
dev_tasks-0.0.166 lib/htmllog.rb
dev_tasks-0.0.164 lib/htmllog.rb