Class: Guard::Mustachejs
Instance Method Summary collapse
-
#initialize(watchers = [], options = {}) ⇒ Mustachejs
constructor
A new instance of Mustachejs.
- #run_all ⇒ Object
- #run_on_changes(paths) ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(watchers = [], options = {}) ⇒ Mustachejs
Returns a new instance of Mustachejs.
7 8 9 10 11 12 |
# File 'lib/guard/mustachejs.rb', line 7 def initialize(watchers = [], = {}) super(watchers, { :variable => 'mustache_templates', :output => 'public/javascripts/mustache-templates.js' }.merge()) end |
Instance Method Details
#run_all ⇒ Object
22 23 24 25 |
# File 'lib/guard/mustachejs.rb', line 22 def run_all paths = Watcher.match_files(self, Dir.glob(File.join('**', '*'))).uniq write_template paths end |
#run_on_changes(paths) ⇒ Object
18 19 20 |
# File 'lib/guard/mustachejs.rb', line 18 def run_on_changes(paths) run_all end |
#start ⇒ Object
14 15 16 |
# File 'lib/guard/mustachejs.rb', line 14 def start write_template([]) unless File.exists?([:output]) end |