lib/etl/control/source.rb in activewarehouse-etl-0.7.2 vs lib/etl/control/source.rb in activewarehouse-etl-0.8.0

- old
+ new

@@ -79,9 +79,19 @@ local_dir = local_directory FileUtils.mkdir_p(local_dir) File.join(local_dir, "#{filename}.csv") end + # Get the last fully written local file + def last_local_file + File.join(local_directory, File.basename(last_local_file_trigger, '.trig')) + end + + # Get the last local file trigger + def last_local_file_trigger + Dir.glob(File.join(local_directory, '*.trig')).last + end + # Get the local trigger file that is used to indicate that the file has # been completely written def local_file_trigger(file) Pathname.new(file.to_s + '.trig') end \ No newline at end of file