Class: ProcessSettings::Monitor

Inherits:
FileMonitor show all
Defined in:
lib/process_settings/monitor.rb

Overview

DEPRECATED

Class Attribute Summary collapse

Attributes inherited from FileMonitor

#file_path, #untargeted_settings

Attributes inherited from AbstractMonitor

#full_context_cache, #logger, #min_polling_seconds, #static_context, #statically_targeted_settings

Class Method Summary collapse

Methods inherited from FileMonitor

#initialize, #listen_thread_running?, #restart_after_fork, #start, #start_watchdog_thread, #stop_watchdog_thread

Methods inherited from AbstractMonitor

#[], #cancel_when_updated, ensure_no_symbols, #full_context_from_cache, #initialize, #on_change, #targeted_value, #when_updated

Constructor Details

This class inherits a constructor from ProcessSettings::FileMonitor

Class Attribute Details

.file_pathObject

Returns the value of attribute file_path.



12
13
14
# File 'lib/process_settings/monitor.rb', line 12

def file_path
  @file_path
end

.instanceObject



32
33
34
35
36
37
38
39
# File 'lib/process_settings/monitor.rb', line 32

def instance
  if @instance
    @instance
  else
    ActiveSupport::Deprecation.warn("`ProcessSettings::Monitor.instance` lazy create is deprecated and will be removed in v1.0. Assign a `FileMonitor` object to `ProcessSettings.instance =` instead.")
    @instance = default_instance
  end
end

.loggerObject

Returns the value of attribute logger.



12
13
14
# File 'lib/process_settings/monitor.rb', line 12

def logger
  @logger
end

Class Method Details

.clear_instanceObject



27
28
29
30
# File 'lib/process_settings/monitor.rb', line 27

def clear_instance
  @instance = nil
  @default_instance = nil
end

.default_instanceObject



41
42
43
44
# File 'lib/process_settings/monitor.rb', line 41

def default_instance
  ActiveSupport::Deprecation.warn("`ProcessSettings::Monitor.instance` is deprecated and will be removed in v1.0. Assign a `FileMonitor` object to `ProcessSettings.instance =` instead.")
  @default_instance ||= new_from_settings
end

.new_from_settingsObject



21
22
23
24
25
# File 'lib/process_settings/monitor.rb', line 21

def new_from_settings
  file_path or raise ArgumentError, "#{self}::file_path must be set before calling instance method"
  logger or raise ArgumentError, "#{self}::logger must be set before calling instance method"
  new(file_path, logger: logger)
end