Class: Guard::CoffeeScript

Inherits:
Guard
  • Object
show all
Defined in:
lib/guard/coffeescript.rb,
lib/guard/coffeescript/runner.rb,
lib/guard/coffeescript/inspector.rb

Defined Under Namespace

Modules: Inspector, Runner

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of CoffeeScript.



12
13
14
15
16
17
18
19
20
# File 'lib/guard/coffeescript.rb', line 12

def initialize(watchers = [], options = {})
  watchers = [] if !watchers
  watchers << ::Guard::Watcher.new(%r{#{ options.delete(:input) }/(.+\.coffee)}) if options[:input]

  super(watchers, {
      :bare => false,
      :shallow => false
  }.merge(options))
end

Instance Method Details

#run_allObject



22
23
24
# File 'lib/guard/coffeescript.rb', line 22

def run_all
  run_on_change(Watcher.match_files(self, Dir.glob(File.join('**', '*.coffee'))))
end

#run_on_change(paths) ⇒ Object



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

def run_on_change(paths)
  changed_files = Runner.run(Inspector.clean(paths), watchers, options)
  notify changed_files
end