Class: Guard::Librarian

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

Defined Under Namespace

Classes: Notifier

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Librarian.



10
11
12
13
14
# File 'lib/guard/librarian.rb', line 10

def initialize(watchers = [], options = {})
  super
  options[:run_on_start] = true unless options[:run_on_start] == false
  options[:notify] = true if options[:notify].nil?
end

Instance Method Details

#reloadObject



20
21
22
# File 'lib/guard/librarian.rb', line 20

def reload
  start
end

#run_on_change(paths = []) ⇒ Object



24
25
26
27
28
# File 'lib/guard/librarian.rb', line 24

def run_on_change(paths = [])
  #puts "paths=#{paths.join(' ')}"
  dirs = paths.map {|_| File.dirname(_) }
  refresh_bundle(dirs)
end

#startObject



16
17
18
# File 'lib/guard/librarian.rb', line 16

def start
  refresh_bundle if options[:run_on_start]
end