def setup(options = {})
@lock = Mutex.new
@options = options
@watchdir = (options[:watchdir] && File.expand_path(options[:watchdir])) || Dir.pwd
@runner = ::Guard::Runner.new
@allow_stop = Listen::Turnstile.new
::Guard::UI.clear(:force => true)
deprecated_options_warning
setup_groups
setup_guards
setup_listener
setup_signal_traps
debug_command_execution if @options[:debug]
::Guard::Dsl.evaluate_guardfile(options)
::Guard::UI.error 'No guards found in Guardfile, please add at least one.' if @guards.empty?
runner.deprecation_warning if @options[:show_deprecations]
setup_notifier
setup_interactor
self
end