Class: Hydra::Listener::ProgressBar
- Defined in:
- lib/hydra/listener/progress_bar.rb
Overview
Output a progress bar as files are completed
Instance Method Summary collapse
-
#file_end(file, output) ⇒ Object
Increment completed files count and update bar.
-
#testing_begin(files) ⇒ Object
Store the total number of files.
-
#testing_end ⇒ Object
Break the line.
Methods inherited from Abstract
#file_begin, #initialize, #worker_begin, #worker_end
Constructor Details
This class inherits a constructor from Hydra::Listener::Abstract
Instance Method Details
#file_end(file, output) ⇒ Object
Increment completed files count and update bar
15 16 17 18 19 20 21 22 |
# File 'lib/hydra/listener/progress_bar.rb', line 15 def file_end(file, output) unless output == '.' @output.write "\r#{' '*60}\r#{output}\n" @errors = true end @files_completed += 1 end |
#testing_begin(files) ⇒ Object
Store the total number of files
6 7 8 9 10 11 12 |
# File 'lib/hydra/listener/progress_bar.rb', line 6 def testing_begin(files) @total_files = files.size @files_completed = 0 @test_output = "" @errors = false end |
#testing_end ⇒ Object
Break the line
25 26 27 28 |
# File 'lib/hydra/listener/progress_bar.rb', line 25 def testing_end @output.write "\n" end |