Class: Guard::Pow

Inherits:
Plugin
  • Object
show all
Defined in:
lib/guard/pow.rb,
lib/guard/pow/manager.rb

Defined Under Namespace

Classes: Manager

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Pow

Returns a new instance of Pow.



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

def initialize(options = {})
  super
  @options = {
    restart_on_start: false,
    restart_on_reload: true
  }.merge(options)
  @manager = Manager.new
end

Instance Attribute Details

#managerObject

Returns the value of attribute manager.



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

def manager
  @manager
end

Instance Method Details

#reloadObject



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

def reload
  manager.restart if options[:restart_on_reload]
end

#run_on_changes(paths) ⇒ Object



27
28
29
# File 'lib/guard/pow.rb', line 27

def run_on_changes(paths)
  manager.restart
end

#startObject



19
20
21
# File 'lib/guard/pow.rb', line 19

def start
  manager.restart if options[:restart_on_start]
end