Class: Guard::Templates

Inherits:
Plugin
  • Object
show all
Defined in:
lib/marv/project/guard/templates.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Templates

Returns a new instance of Templates.



4
5
6
# File 'lib/marv/project/guard/templates.rb', line 4

def initialize(options={})
  super
end

Instance Method Details

#copy_all_templates(message, clean = nil) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/marv/project/guard/templates.rb', line 23

def copy_all_templates(message, clean=nil)
  builder = Marv::Project::Guard.builder.templates

  UI.info message
  builder.clean_templates unless clean.nil?
  builder.copy_templates
end

#run_allObject

Runs on all command in guard console



14
15
16
# File 'lib/marv/project/guard/templates.rb', line 14

def run_all
  copy_all_templates "Rebuilding all templates", true
end

#run_on_change(paths) ⇒ Object

Called on file(s) modifications



19
20
21
# File 'lib/marv/project/guard/templates.rb', line 19

def run_on_change(paths)
  copy_all_templates "Templates have changed, copying over"
end

#startObject

Runs on marv watch



9
10
11
# File 'lib/marv/project/guard/templates.rb', line 9

def start
  copy_all_templates "Copying templates over"
end