Class: Envoi::WatchFolderUtility::WatchFolder::Foreman

Inherits:
Object
  • Object
show all
Defined in:
lib/cantemo/portal/agent/cli/commands/watch_folders-working.rb

Constant Summary collapse

AWF =
Envoi::Aspera::WatchService::WatchFolder

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = { }) ⇒ Foreman

Returns a new instance of Foreman.



101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/cantemo/portal/agent/cli/commands/watch_folders-working.rb', line 101

def initialize(args = { })
  initialize_logger(args)

  @agent = Envoi::Mam::Cantemo::Agent.load_from_config_file(args)
  @config = agent.config
  cantemo_config = config[:cantemo] || config['cantemo']
  @watch_folder_defs = cantemo_config[:watch_folders] || cantemo_config['watch_folders']

  @ignored_file_paths_by_watch_folder = Hash.new { |h, k| h[k] = [] }

  @watch_folders = process_watch_folder_defs
end

Instance Attribute Details

#watch_folder_defsObject

Returns the value of attribute watch_folder_defs.



97
98
99
# File 'lib/cantemo/portal/agent/cli/commands/watch_folders-working.rb', line 97

def watch_folder_defs
  @watch_folder_defs
end

Instance Method Details

#process_watch_folder_def(watch_folder_def) ⇒ Object



114
115
116
117
# File 'lib/cantemo/portal/agent/cli/commands/watch_folders-working.rb', line 114

def process_watch_folder_def(watch_folder_def)
  # @TODO TYPE CHECK
  AWF.process_watch_folder_def(watch_folder_def)
end

#process_watch_folder_defs(watch_folder_defs = @watch_folder_defs) ⇒ Object



119
120
121
# File 'lib/cantemo/portal/agent/cli/commands/watch_folders-working.rb', line 119

def process_watch_folder_defs(watch_folder_defs = @watch_folder_defs)
  watch_folder_defs.map { |wfd| process_watch_folder_def(wfd) }
end