require 'jasmine/files_list' require 'multi_json' 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, files_list.spec_file_line_numbers) } end output.collect(&:first) end private def template_for(files, spec_lines) <<-HTML