Class: Guard::Go

Inherits:
Guard
  • Object
show all
Defined in:
lib/guard/go.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(watchers = [], options = {}) ⇒ Go

Returns a new instance of Go.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/guard/go.rb', line 10

def initialize(watchers = [], options = {})
  super

  defaults = {
    :server => 'app.go',
    :test => false
  }
  
  @options = defaults.merge(options)

  @runner = ::Guard::GoRunner.new(@options)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/guard/go.rb', line 8

def options
  @options
end

Instance Method Details

#run_on_change(paths) ⇒ Object



28
29
30
31
# File 'lib/guard/go.rb', line 28

def run_on_change(paths)
  start_info
  run_info @runner.restart
end

#startObject



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

def start
  start_info
  run_info @runner.start
end

#stopObject



33
34
35
36
37
# File 'lib/guard/go.rb', line 33

def stop
  @runner.stop
  UI.info "Stopping Go..."
  Notifier.notify("Until next time...", :title => "Go shutting down.", :image => :pending)
end