Class: Nitra::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/nitra/formatter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(progress, configuration) ⇒ Formatter

Returns a new instance of Formatter.



8
9
10
11
# File 'lib/nitra/formatter.rb', line 8

def initialize(progress, configuration)
  self.progress = progress
  self.configuration = configuration
end

Instance Attribute Details

#configurationObject

Returns the value of attribute configuration.



6
7
8
# File 'lib/nitra/formatter.rb', line 6

def configuration
  @configuration
end

#progressObject

Returns the value of attribute progress.



6
7
8
# File 'lib/nitra/formatter.rb', line 6

def progress
  @progress
end

#start_timeObject

Returns the value of attribute start_time.



6
7
8
# File 'lib/nitra/formatter.rb', line 6

def start_time
  @start_time
end

Instance Method Details

#finishObject



23
24
25
26
27
28
# File 'lib/nitra/formatter.rb', line 23

def finish
  puts progress.filtered_output

  puts "\n#{overview}"
  puts "#{$aborted ? "Aborted after" : "Finished in"} #{"%0.1f" % (Time.now-start_time)} seconds"
end


18
19
20
21
# File 'lib/nitra/formatter.rb', line 18

def print_progress
  print_failures
  print_bar
end

#startObject



13
14
15
16
# File 'lib/nitra/formatter.rb', line 13

def start
  self.start_time = Time.now
  print_progress
end