Class: ProcessSettings::Monitor
- Inherits:
-
FileMonitor
- Object
- AbstractMonitor
- FileMonitor
- ProcessSettings::Monitor
- Defined in:
- lib/process_settings/monitor.rb
Overview
DEPRECATED
Class Attribute Summary collapse
-
.file_path ⇒ Object
Returns the value of attribute file_path.
- .instance ⇒ Object
-
.logger ⇒ Object
Returns the value of attribute logger.
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
- .clear_instance ⇒ Object
- .default_instance ⇒ Object
- .deprecator ⇒ Object
- .new_from_settings ⇒ Object
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_path ⇒ Object
Returns the value of attribute file_path.
12 13 14 |
# File 'lib/process_settings/monitor.rb', line 12 def file_path @file_path end |
.instance ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/process_settings/monitor.rb', line 36 def instance if @instance @instance else deprecator.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 |
.logger ⇒ Object
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_instance ⇒ Object
31 32 33 34 |
# File 'lib/process_settings/monitor.rb', line 31 def clear_instance @instance = nil @default_instance = nil end |
.default_instance ⇒ Object
45 46 47 48 |
# File 'lib/process_settings/monitor.rb', line 45 def default_instance deprecator.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 |
.deprecator ⇒ Object
15 16 17 |
# File 'lib/process_settings/monitor.rb', line 15 def deprecator @deprecator ||= ActiveSupport::Deprecation.new('1.0', 'ProcessSettings') end |
.new_from_settings ⇒ Object
25 26 27 28 29 |
# File 'lib/process_settings/monitor.rb', line 25 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 |