class TravisFormatter
Public Class Methods
new(use_unicode, colorize)
click to toggle source
Calls superclass method
# File lib/travis_formatter.rb, line 4 def initialize (use_unicode, colorize) super @currentGroup = nil @errors = [] @seenGroups = {} @travis = ENV['TRAVIS'].to_s == 'true' @warnings = [] at_exit do # Ensure the last opened fold is closed. close_fold() # Print out any warnings. if !@warnings.compact.empty? open_fold("Warnings") STDOUT.puts @warnings.compact.join("\n") close_fold() end # Print out any errors. if !@errors.compact.empty? open_fold("Errors") STDOUT.puts @errors.compact.join("\n") exit(1) end end end
Public Instance Methods
close_fold()
click to toggle source
# File lib/travis_formatter.rb, line 49 def close_fold() return if not @travis or @currentGroup == nil STDOUT.puts "travis_fold:end:#{@currentGroup}\n" @currentGroup = nil end
format_analyze(file_name, file_path)
click to toggle source
Analyze.
Calls superclass method
# File lib/travis_formatter.rb, line 65 def format_analyze(file_name, file_path); open_fold("Analyze"); super; end
format_analyze_target(target, project, configuration)
click to toggle source
Calls superclass method
# File lib/travis_formatter.rb, line 66 def format_analyze_target(target, project, configuration); open_fold("Analyze"); super; end
format_build_target(target, project, configuration)
click to toggle source
Build.
Calls superclass method
# File lib/travis_formatter.rb, line 69 def format_build_target(target, project, configuration); open_fold("Build"); super; end
format_clean(project, target, configuration)
click to toggle source
Clean.
Calls superclass method
# File lib/travis_formatter.rb, line 73 def format_clean(project, target, configuration); open_fold("Clean"); super; end
format_clean_remove()
click to toggle source
Calls superclass method
# File lib/travis_formatter.rb, line 75 def format_clean_remove; open_fold("Clean"); super; end
format_clean_target(target, project, configuration)
click to toggle source
Calls superclass method
# File lib/travis_formatter.rb, line 74 def format_clean_target(target, project, configuration); open_fold("Clean"); super; end
format_compile(file_name, file_path)
click to toggle source
Calls superclass method
# File lib/travis_formatter.rb, line 70 def format_compile(file_name, file_path); open_fold("Build"); super; end
format_compile_error(file_name, file_path, reason, line, cursor)
click to toggle source
Errors and warnings.
Calls superclass method
# File lib/travis_formatter.rb, line 84 def format_compile_error(file_name, file_path, reason, line, cursor); @errors.push(super); ""; end
format_compile_warning(file_name, file_path, reason, line, cursor)
click to toggle source
Calls superclass method
# File lib/travis_formatter.rb, line 91 def format_compile_warning(file_name, file_path, reason, line, cursor); @warnings.push(super); ""; end
format_duplicate_symbols(message, file_paths)
click to toggle source
Calls superclass method
# File lib/travis_formatter.rb, line 89 def format_duplicate_symbols(message, file_paths); @warnings.push(super); ""; end
format_error(message)
click to toggle source
Calls superclass method
# File lib/travis_formatter.rb, line 85 def format_error(message); @errors.push(super); ""; end
format_failing_test(suite, test, reason, file_path)
click to toggle source
Calls superclass method
# File lib/travis_formatter.rb, line 80 def format_failing_test(suite, test, reason, file_path); @errors.push(super); super; end
format_file_missing_error(error, file_path)
click to toggle source
Calls superclass method
# File lib/travis_formatter.rb, line 86 def format_file_missing_error(error, file_path); @errors.push(super); ""; end
format_group(group, track = true)
click to toggle source
# File lib/travis_formatter.rb, line 31 def format_group(group, track = true) group = group.downcase.gsub(/[^a-z\d\-_.]+/, '-').gsub(/-$/, '') i = 1 parts = group.split('.') if parts.last =~ /^\d+$/ last = parts.pop() i = last ? last.to_i : 1 group = parts.join('.') end if track && @currentGroup != "#{group}.#{i}" && @seenGroups.has_key?(group) i = @seenGroups[group] + 1 end @seenGroups[group] = i "#{group}.#{i}" end
format_ld_warning(message)
click to toggle source
Calls superclass method
# File lib/travis_formatter.rb, line 87 def format_ld_warning(message); @warnings.push(super); ""; end
format_test_run_started(name)
click to toggle source
Test.
Calls superclass method
# File lib/travis_formatter.rb, line 78 def format_test_run_started(name); open_fold("Test"); super; end
format_test_suite_started(name)
click to toggle source
Calls superclass method
# File lib/travis_formatter.rb, line 79 def format_test_suite_started(name); open_fold("Test"); super; end
format_test_summary(message, failures_per_suite)
click to toggle source
Calls superclass method
# File lib/travis_formatter.rb, line 81 def format_test_summary(message, failures_per_suite); @errors.concat(failures_per_suite.values); super; end
format_undefined_symbols(message, symbol, reference)
click to toggle source
Calls superclass method
# File lib/travis_formatter.rb, line 88 def format_undefined_symbols(message, symbol, reference); @warnings.push(super); ""; end
format_warning(message)
click to toggle source
Calls superclass method
# File lib/travis_formatter.rb, line 90 def format_warning(message); @warnings.push(super); ""; end
open_fold(group, track = true)
click to toggle source
# File lib/travis_formatter.rb, line 55 def open_fold(group, track = true) description = group group = format_group(group, track) return if @currentGroup == group or not @travis close_fold() if @currentGroup != nil @currentGroup = group STDOUT.puts "travis_fold:start:#{group}\033[33;1m#{description}\033[0m\n" end