class Cucumber::Formatter::Pdf
def initialize(step_mother, path_or_io, options)
def initialize(step_mother, path_or_io, options) @step_mother = step_mother @file = ensure_file(path_or_io, "pdf") if(options[:dry_run]) @status_colors = { :passed => BLACK, :skipped => BLACK, :undefined => BLACK, :failed => BLACK, :putsd => GREY} else @status_colors = { :passed => '055902', :skipped => GREY, :undefined => 'F27405', :failed => '730202', :putsd => GREY} end @pdf = Prawn::Document.new @scrap = Prawn::Document.new @doc = @scrap @options = options @exceptions = [] @indent = 0 @buffer = [] load_cover_page_image @pdf.text "\n\n\nCucumber features", :align => :center, :size => 32 @pdf.draw_text "Generated: #{Time.now.strftime("%Y-%m-%d %H:%M")}", :size => 10, :at => [0, 24] @pdf.draw_text "$ cucumber #{ARGV.join(" ")}", :size => 10, :at => [0,10] unless options[:dry_run] @pdf.bounding_box [450,100] , :width => 100 do @pdf.text 'Legend', :size => 10 @status_colors.each do |k,v| @pdf.fill_color v @pdf.text k.to_s, :size => 10 @pdf.fill_color BLACK end end end end