Class: Runner
- Inherits:
-
Object
- Object
- Runner
- Defined in:
- lib/flote/runner.rb
Constant Summary collapse
- WORKING_DIR =
'.'
Instance Attribute Summary collapse
-
#execute_callback ⇒ Object
Returns the value of attribute execute_callback.
-
#init_session_callback ⇒ Object
Returns the value of attribute init_session_callback.
-
#run_command ⇒ Object
Returns the value of attribute run_command.
-
#source_files ⇒ Object
Returns the value of attribute source_files.
Instance Method Summary collapse
- #execute ⇒ Object
- #execute_once(files) ⇒ Object
-
#initialize(shell, view) ⇒ Runner
constructor
A new instance of Runner.
- #start ⇒ Object
Constructor Details
#initialize(shell, view) ⇒ Runner
Returns a new instance of Runner.
9 10 11 12 |
# File 'lib/flote/runner.rb', line 9 def initialize shell, view @shell = shell @view = view end |
Instance Attribute Details
#execute_callback ⇒ Object
Returns the value of attribute execute_callback.
5 6 7 |
# File 'lib/flote/runner.rb', line 5 def execute_callback @execute_callback end |
#init_session_callback ⇒ Object
Returns the value of attribute init_session_callback.
5 6 7 |
# File 'lib/flote/runner.rb', line 5 def init_session_callback @init_session_callback end |
#run_command ⇒ Object
Returns the value of attribute run_command.
5 6 7 |
# File 'lib/flote/runner.rb', line 5 def run_command @run_command end |
#source_files ⇒ Object
Returns the value of attribute source_files.
5 6 7 |
# File 'lib/flote/runner.rb', line 5 def source_files @source_files end |
Instance Method Details
#execute ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/flote/runner.rb', line 19 def execute files = @shell.files_in_dir_tree WORKING_DIR, @source_files newest_dir_entry = @shell.newest_dir_entry WORKING_DIR, files change_time = @shell.modification_time newest_dir_entry if change_time == @previous_change_time then Progress.next return end Progress.end @view. newest_dir_entry, change_time execute_once files @previous_change_time = change_time end |
#execute_once(files) ⇒ Object
33 34 35 36 |
# File 'lib/flote/runner.rb', line 33 def execute_once files process = @shell.execute @run_command if @execute_callback then @execute_callback.call(files, process) end end |
#start ⇒ Object
14 15 16 17 |
# File 'lib/flote/runner.rb', line 14 def start if @init_session_callback then @init_session_callback.call end execute end |