lib/gorgon/originator.rb in gorgon-0.8.1 vs lib/gorgon/originator.rb in gorgon-0.8.2
- old
+ new
@@ -6,10 +6,12 @@
require 'gorgon/originator_logger'
require 'gorgon/failures_printer'
require 'gorgon/source_tree_syncer'
require 'gorgon/shutdown_manager'
require 'gorgon/callback_handler'
+require 'gorgon/runtime_recorder'
+require 'gorgon/runtime_file_reader'
require 'awesome_print'
require 'etc'
require 'socket'
@@ -133,10 +135,11 @@
cleanup_if_job_complete
end
def create_job_state_and_observers
@job_state = JobState.new files.count
+ RuntimeRecorder.new @job_state, configuration[:runtime_file]
@progress_bar_view = ProgressBarView.new @job_state
@progress_bar_view.show
FailuresPrinter.new @job_state
end
@@ -147,12 +150,15 @@
def connection_information
configuration[:connection]
end
def files
- @files ||= configuration[:files].reduce([]) do |memo, obj|
+ return @files unless @files.nil?
+ current_files = configuration[:files].reduce([]) do |memo, obj|
memo.concat(Dir[obj])
end.uniq
+ runtime_file_reader = RuntimeFileReader.new configuration[:runtime_file]
+ @files = runtime_file_reader.sorted_files(current_files)
end
def job_definition
# TODO: remove duplication. Use sync_configuration
job_config = configuration[:job]