Class: Longleaf::ServiceCandidateLocator

Inherits:
Object
  • Object
show all
Defined in:
lib/longleaf/candidates/service_candidate_locator.rb

Overview

Service which locates files that have services which need to be performed on them.

Instance Method Summary collapse

Constructor Details

#initialize(app_config) ⇒ ServiceCandidateLocator

Returns a new instance of ServiceCandidateLocator



7
8
9
# File 'lib/longleaf/candidates/service_candidate_locator.rb', line 7

def initialize(app_config)
  @app_config = app_config
end

Instance Method Details

#candidate_iterator(file_selector, event, force = false) ⇒ Object

Get a iterator of the candidates matching the given FileSelector which need services run.

Parameters:

  • file_selector (FileSelector)

    selector identifying the files to pull candidates from.

Returns:

  • an iterator



14
15
16
17
18
19
20
21
# File 'lib/longleaf/candidates/service_candidate_locator.rb', line 14

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