class Cucumber::Cli::Configuration
def build_formatter_broadcaster(step_mother)
def build_formatter_broadcaster(step_mother) return Formatter::Pretty.new(step_mother, nil, @options) if @options[:autoformat] formatters = @options[:formats].map do |format, out| if String === out # file name out = File.open(out, Cucumber.file_mode('w')) at_exit do out.flush out.close end end begin formatter_class = formatter_class(format) formatter_class.new(step_mother, out, @options) rescue Exception => e exit_with_error("Error creating formatter: #{format}", e) end end broadcaster = Broadcaster.new(formatters) broadcaster.options = @options return broadcaster end