bin/xcpretty in xcpretty-0.0.4 vs bin/xcpretty in xcpretty-0.0.5
- old
+ new
@@ -5,33 +5,31 @@
if RUBY_VERSION < '1.8.7'
abort "error: XCPretty requires Ruby 1.8.7 or higher."
end
-def printer
- @printer ||= XCPretty::Printer::Simple.new
-end
-
OptionParser.new do |opts|
opts.banner = "Usage: xcodebuild [options] | xcpretty"
opts.on('-t', '--test', 'Use RSpec style output') do
- @printer = XCPretty::Printer::RSpec.new
+ @klass = XCPretty::Printer::RSpec
end
opts.on('-s', '--simple', 'Use simple output (default)') do
- @printer = XCPretty::Printer::Simple.new
+ @klass = XCPretty::Printer::Simple
end
opts.on('-c', '--color', 'Use colorized output') do
@colorize = true
end
opts.on('--no-utf', 'Disable unicode characters in output') do
- @unicode = false
+ @no_utf = true
end
opts.on_tail('-h', '--help', 'Show this message') { puts opts; exit }
opts.on_tail("-v", "--version", "Show version") { puts XCPretty::VERSION; exit }
opts.parse!
- printer.colorize = @colorize
- printer.use_unicode = @unicode || true
end
+
+printer = (@klass || XCPretty::Printer::Simple).new
+printer.colorize = @colorize
+printer.use_unicode = !@no_utf
ARGF.each_line do |line|
printer.pretty_print(line)
end