module Guard

def start(options = {})

Options Hash: (**options)
  • guardfile (String) -- the path to the Guardfile
  • watchdir (String) -- the director to watch
  • group (Array) -- the list of groups to start
  • debug (Boolean) -- if debug output should be shown
  • notify (Boolean) -- if system notifications should be shown
  • clear (Boolean) -- if auto clear the UI should be done
def start(options = {})
  setup(options)
  Dsl.evaluate_guardfile(options)
  UI.error 'No guards found in Guardfile, please add at least one.' if ::Guard.guards.empty?
  options[:notify] && ENV['GUARD_NOTIFY'] != 'false' ? Notifier.turn_on : Notifier.turn_off
  listener.on_change do |files|
    Dsl.reevaluate_guardfile        if Watcher.match_guardfile?(files)
    listener.changed_files += files if Watcher.match_files?(guards, files)
  end
  UI.info "Guard is now watching at '#{ listener.directory }'"
  run_on_guards do |guard|
    run_supervised_task(guard, :start)
  end
  unless options[:no_interactions]
    @interactor = Interactor.fabricate
    @interactor.start if @interactor
  end
  listener.start
end