Sha256: e52e997090783b4320607be3b4b496427119f66965c2a1f69abebd407b6f619a

Contents?: true

Size: 617 Bytes

Versions: 7

Compression:

Stored size: 617 Bytes

Contents

class FileActioner
  
  def initialize(file_finder, task_manager)
    @file_finder = file_finder
    @task_manager = task_manager
    
    @prev_all_files = []
  end
  
  def run
    begin
      files = @file_finder.find
    
      # Refactor this to the file_finder class
      changes = (files[:all] - @prev_all_files) | (@prev_all_files - files[:all])
      files[:filtered] = files[:filtered] | changes
    
      if (files[:filtered] != [])
        @task_manager.run(files)
      end
    
      @prev_all_files = files[:all]
    rescue Exception => e
      @task_manager.output_exception(e);
    end
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
loris-0.2.3 lib/file_actioner.rb
loris-0.2.2 lib/file_actioner.rb
loris-0.2.1 lib/file_actioner.rb
loris-0.2.0 lib/file_actioner.rb
loris-0.1.7 lib/file_actioner.rb
loris-0.1.5 lib/file_actioner.rb
loris-0.1.4 lib/file_actioner.rb