6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/schlepper/process.rb', line 6
def run_all
old_sync = STDOUT.sync
STDOUT.sync = true
create_table_if_necessary
fetch_script_numbers_from_database
load_tasks_that_need_run
puts "#{Schlepper::Task.children.count} tasks to process"
puts '~~~~~~~~~~~~~~~~~~~~~'
Schlepper::Task.children.each { |klass| process_one klass }
rescue => e
offending_file = e.send(:caller_locations).first.path.split("/").last
puts "#{offending_file} caused an error: "
raise e
ensure
STDOUT.sync = old_sync
end
|