Class: Guard::Guard Deprecated

Inherits:
Object
  • Object
show all
Includes:
Plugin::Base
Defined in:
lib/guard/guard.rb

Overview

Deprecated.

Inheriting from `Guard::Guard` is deprecated, please inherit from Plugin instead. Please note that the constructor signature has changed from `Guard::Guard#initialize(watchers = [], options = {})` to `Guard::Plugin#initialize(options = {})`.

Instance Attribute Summary

Attributes included from Plugin::Base

#callbacks, #group, #options, #watchers

Instance Method Summary collapse

Methods included from Plugin::Base

included, #name, #reload, #run_all, #run_on_additions, #run_on_changes, #run_on_modifications, #run_on_removals, #start, #stop, #title, #to_s

Methods included from Plugin::Hooker

add_callback, callbacks, #hook, notify, reset_callbacks!

Constructor Details

#initialize(watchers = [], options = {}) ⇒ Guard

Deprecated.

Inheriting from `Guard::Guard` is deprecated, please inherit from Plugin instead. Please note that the constructor signature has changed from `Guard::Guard#initialize(watchers = [], options = {})` to `Guard::Plugin#initialize(options = {})`.

Initializes a Guard plugin. Don't do any work here,

especially as Guard plugins get initialized even if they are not in an
active group!

Parameters:

  • watchers (Array<Guard::Watcher>) (defaults to: [])

    the Guard plugin file watchers

  • options (Hash) (defaults to: {})

    the custom Guard plugin options

Options Hash (options):

  • group (Symbol)

    the group this Guard plugin belongs to

  • any_return (Boolean)

    allow any object to be returned from a watcher

See Also:



34
35
36
37
38
39
# File 'lib/guard/guard.rb', line 34

def initialize(watchers = [], options = {})
  ::Guard::UI.deprecation(::Guard::Deprecator::GUARD_GUARD_DEPRECATION % title)

  _set_instance_variables_from_options(options.merge(watchers: watchers))
  _register_callbacks
end