Method: Guard::Copy#initialize

Defined in:
lib/guard/copy.rb

#initialize(options = {}) ⇒ Copy

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:

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

    the Guard plugin options

Options Hash (options):

  • watchers (Array<Guard::Watcher>)

    the Guard plugin file watchers

  • group (Symbol)

    the group this Guard plugin belongs to

  • any_return (Boolean)

    allow any object to be returned from a watcher



23
24
25
26
27
# File 'lib/guard/copy.rb', line 23

def initialize(options = {})
  inject_watchers(options)
  super
  @targets = Array(options[:to]).map { |to| Target.new(to, options) }
end