Sha256: f9c571e75db6a48b161764388e4b6029856456add365e9564b4e4c9bd1b29931

Contents?: true

Size: 928 Bytes

Versions: 4

Compression:

Stored size: 928 Bytes

Contents

require 'longleaf/candidates/service_candidate_filesystem_iterator'
require 'longleaf/candidates/service_candidate_index_iterator'

module Longleaf
  # Service which locates files that have services which need to be performed on them.
  class ServiceCandidateLocator
    def initialize(app_config)
      @app_config = app_config
    end

    # Get a iterator of the candidates matching the given FileSelector which need services run.
    # @param file_selector [FileSelector] selector identifying the files to pull candidates from.
    # @return an iterator
    def candidate_iterator(file_selector, event, force = false)
      if @app_config.index_manager.using_index?
        ServiceCandidateIndexIterator.new(file_selector, event, @app_config, force)
      else
        # Get filesystem based implementation
        ServiceCandidateFilesystemIterator.new(file_selector, event, @app_config, force)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
longleaf-1.1.1 lib/longleaf/candidates/service_candidate_locator.rb
longleaf-1.1.0 lib/longleaf/candidates/service_candidate_locator.rb
longleaf-1.0.0 lib/longleaf/candidates/service_candidate_locator.rb
longleaf-0.3.0 lib/longleaf/candidates/service_candidate_locator.rb