Class: Guard::Yeti

Inherits:
Guard
  • Object
show all
Defined in:
lib/guard/yeti.rb,
lib/guard/yeti/notifier.rb,
lib/guard/yeti/dependency.rb

Defined Under Namespace

Classes: Dependency, Notifier

Instance Method Summary collapse

Constructor Details

#initialize(watches = [], options = {}) ⇒ Yeti

Returns a new instance of Yeti.



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

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

  ['yeti', 'node'].each do |command|
    Dependency.verify_or_raise(command)
  end

  UI.info "Guard::Yeti has started!"
  @latest_output = "sucks"
end

Instance Method Details

#run_on_change(paths) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/guard/yeti.rb', line 25

def run_on_change(paths)
  return false if paths.empty? || !File.exist?(paths[0])

  UI.debug("yeti #{paths[0]} --solo=1", :reset => true)

  output = %x[yeti #{paths[0]} --solo=1]
  result = $?.success?

  Notifier.notify(result, result ? "Passed" : "Failed")

  [result, output]
end

#startObject



21
22
23
# File 'lib/guard/yeti.rb', line 21

def start
  UI.info "Guard::Yeti is running!"
end