14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/tryouts/cli/formatters/factory.rb', line 14
def self.create_formatter(options = {})
if options[:agent]
return AgentFormatter.new(options)
end
format = options[:format]&.to_sym || determine_format_from_flags(options)
base_formatter = case format
when :verbose
if options[:fails_only]
VerboseFailsFormatter.new(options)
else
VerboseFormatter.new(options)
end
when :compact
if options[:fails_only]
CompactFailsFormatter.new(options)
else
CompactFormatter.new(options)
end
when :quiet
if options[:fails_only]
QuietFailsFormatter.new(options)
else
QuietFormatter.new(options)
end
else
CompactFormatter.new(options) end
base_formatter
end
|