lib/guard.rb
def add_guard(name, watchers = [], callbacks = [], options = {})
      if name.to_sym == :ego
        UI.deprecation('Guard::Ego is now part of Guard. You can remove it from your Guardfile.')
      else
        guard_class = get_guard_class(name)
        callbacks.each { |callback| Hook.add_callback(callback[:listener], guard_class, callback[:events]) }
        @guards << guard_class.new(watchers, options)
      end
    end
# Add a Guard to use.
#
# @param [String] name the Guard name
# @param [Array<Watcher>] watchers the list of declared watchers
# @param [Array<Hash>] callbacks the list of callbacks
# @param [Hash] the Guard options
#
Add a Guard to use.
Add a Guard to use .
def add_guard(name, watchers = [], callbacks = [], options = {})
      if name.to_sym == :ego
        UI.deprecation('Guard::Ego is now part of Guard. You can remove it from your Guardfile.')
      else
        guard_class = get_guard_class(name)
        callbacks.each { |callback| Hook.add_callback(callback[:listener], guard_class, callback[:events]) }
        @guards << guard_class.new(watchers, options)
      end
    end
def add_guard ( name , watchers = [ ] , callbacks = [ ] , options = { } ) if name . to_sym == :ego UI . deprecation ( 'Guard::Ego is now part of Guard. You can remove it from your Guardfile.' ) else guard_class = get_guard_class ( name ) callbacks . each { | callback | Hook . add_callback ( callback [ :listener ] , guard_class , callback [ :events ] ) } @guards << guard_class . new ( watchers , options ) end end
Add a Guard to use.
Add a Guard to use .
name
watchers
callbacks
options
the Guard options
the Guard options