class Lucid::Formatter::Progress

Constants

CHARS

Attributes

runtime[R]

Public Class Methods

new(runtime, path_or_io, options) click to toggle source
# File lib/lucid/formatter/progress.rb, line 11
def initialize(runtime, path_or_io, options)
  @runtime, @io, @options = runtime, ensure_io(path_or_io, 'progress'), options
end

Public Instance Methods

after_feature_element(*args) click to toggle source
# File lib/lucid/formatter/progress.rb, line 29
def after_feature_element(*args)
  progress(:failed) if (defined? @exception_raised) and (@exception_raised)
  @exception_raised = false
end
after_features(features) click to toggle source
# File lib/lucid/formatter/progress.rb, line 19
def after_features(features)
  @io.puts
  @io.puts
  print_summary(features)
end
after_outline_table(outline_table) click to toggle source
# File lib/lucid/formatter/progress.rb, line 52
def after_outline_table(outline_table)
  @outline_table = nil
end
after_step_result(step_result) click to toggle source
# File lib/lucid/formatter/progress.rb, line 43
def after_step_result(step_result)
  progress(step_result.status)
  @status = step_result.status
end
after_steps(*args) click to toggle source
# File lib/lucid/formatter/progress.rb, line 39
def after_steps(*args)
  @exception_raised = false
end
before_feature_element(*args) click to toggle source
# File lib/lucid/formatter/progress.rb, line 25
def before_feature_element(*args)
  @exception_raised = false
end
before_features(features) click to toggle source
# File lib/lucid/formatter/progress.rb, line 15
def before_features(features)
  print_profile_information
end
before_outline_table(outline_table) click to toggle source
# File lib/lucid/formatter/progress.rb, line 48
def before_outline_table(outline_table)
  @outline_table = outline_table
end
before_steps(*args) click to toggle source
# File lib/lucid/formatter/progress.rb, line 34
def before_steps(*args)
  progress(:failed) if (defined? @exception_raised) and (@exception_raised)
  @exception_raised = false
end
exception(*args) click to toggle source
# File lib/lucid/formatter/progress.rb, line 62
def exception(*args)
  @exception_raised = true
end
table_cell_value(value, status) click to toggle source
# File lib/lucid/formatter/progress.rb, line 56
def table_cell_value(value, status)
  return unless @outline_table
  status ||= @status
  progress(status) unless table_header_cell?(status)
end

Private Instance Methods

print_summary(features) click to toggle source
progress(status) click to toggle source
# File lib/lucid/formatter/progress.rb, line 85
def progress(status)
  char = CHARS[status]
  @io.print(format_string(char, status))
  @io.flush
end
table_header_cell?(status) click to toggle source
# File lib/lucid/formatter/progress.rb, line 91
def table_header_cell?(status)
  status == :skipped_param
end