require 'jasmine/files_list' module Jasmine class TemplateWriter class << self def write!(files_list) output = [ [ "specrunner.#{$$}.html", files_list.files_to_html ] ] output.unshift([ "specrunner.#{$$}.filter.html", files_list.filtered_files_to_html ]) if files_list.filtered? output.each do |name, files| File.open(name, 'w') { |fh| fh.print template_for(files) } end output.collect(&:first) end private def template_for(files) <<-HTML