Class | Listen::Adapter |
In: |
lib/listen/adapter.rb
|
Parent: | Object |
DEFAULT_LATENCY | = | 0.25 | The default delay between checking for changes. | |
MISSING_DEPENDENCY_MESSAGE | = | <<-EOS.gsub(/^\s*/, '') For a better performance, it's recommended that you satisfy the missing dependency. EOS .gsub(/^\s*/, '') | The default warning message when there is a missing dependency. | |
POLLING_FALLBACK_MESSAGE | = | <<-EOS.gsub(/^\s*/, '') Listen will be polling changes. Learn more at https://github.com/guard/listen#polling-fallback. EOS .gsub(/^\s*/, '') | The default warning message when falling back to polling adapter. |
directories | [RW] | |
latency | [RW] | |
paused | [RW] |
Initializes the adapter.
@param [String, Array<String>] directories the directories to watch @param [Hash] options the adapter options @option options [Float] latency the delay between checking for changes in seconds @option options [Boolean] report_changes whether or not to automatically report changes (run the callback)
@yield [changed_dirs, options] callback Callback called when a change happens @yieldparam [Array<String>] changed_dirs the changed directories @yieldparam [Hash] options callback options (like :recursive => true)
@return [Listen::Adapter] the adapter
Selects the appropriate adapter implementation for the current OS and initializes it.
@param [String, Array<String>] directories the directories to watch @param [Hash] options the adapter options @option options [Boolean] force_polling to force polling or not @option options [String, Boolean] polling_fallback_message to change polling fallback message or remove it @option options [Float] latency the delay between checking for changes in seconds
@yield [changed_dirs, options] callback Callback called when a change happens @yieldparam [Array<String>] changed_dirs the changed directories @yieldparam [Hash] options callback options (like :recursive => true)
@return [Listen::Adapter] the chosen adapter
Checks if the adapter is usable and works on the current OS.
@param [String, Array<String>] directories the directories to watch @param [Hash] options the adapter options @option options [Float] latency the delay between checking for changes in seconds
@return [Boolean] whether usable and work or not
Runs a tests to determine if the adapter can actually pick up changes in a given directory and returns the result.
@note This test takes some time depending the adapter latency.
@param [String, Pathname] directory the directory to watch @param [Hash] options the adapter options @option options [Float] latency the delay between checking for changes in seconds
@return [Boolean] whether the adapter works or not
Starts the adapter.
@param [Boolean] blocking whether or not to block the current thread after starting