class Guard::Goliath

Constants

DEFAULT_OPTIONS

Attributes

options[R]
runner[R]

Public Class Methods

new(options = {}) click to toggle source
Calls superclass method
# File lib/guard/goliath.rb, line 19
def initialize(options = {})
  super
  @options = DEFAULT_OPTIONS.merge(options)
  @runner = ::Guard::GoliathRunner.new(@options)
end

Public Instance Methods

reload() click to toggle source
# File lib/guard/goliath.rb, line 30
def reload
  UI.info 'Restarting App...'
  Notifier.notify("App restarting on port #{options[:port]} in #{options[:environment]} environment...", title: 'Restarting App...', image: :pending)
  if runner.restart
    UI.info "App restarted, pid #{runner.pid}"
    Notifier.notify("App restarted on port #{options[:port]}.", title: 'App restarted!', image: :success)
  else
    UI.info 'App NOT restarted, check your log files.'
    Notifier.notify('App NOT restarted, check your log files.', title: 'App NOT restarted!', image: :failed)
  end
end
run_on_changes(paths) click to toggle source
# File lib/guard/goliath.rb, line 47
def run_on_changes(paths)
  reload
end
start() click to toggle source
# File lib/guard/goliath.rb, line 25
def start
  UI.info "Guard::Goliath will now restart your app on port #{options[:port]} using #{options[:environment]} environment."
  reload if options[:start_on_start]
end
stop() click to toggle source
# File lib/guard/goliath.rb, line 42
def stop
  Notifier.notify('Until next time...', title: 'App shutting down.', image: :pending)
  runner.stop
end