Class: Guard::Assets

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Assets

Returns a new instance of Assets.



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

def initialize(options={})
  super
end

Instance Method Details

#build_all_assets(message, clean = nil) ⇒ Object

Build all assets



24
25
26
27
28
29
30
31
# File 'lib/marv/project/guard/assets.rb', line 24

def build_all_assets(message, clean=nil)
  builder = Marv::Project::Guard.builder.assets

  UI.info message
  builder.clean_images unless clean.nil?
  builder.copy_images
  builder.build_assets
end

#run_allObject

Runs on all command in guard console



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

def run_all
  build_all_assets "Rebuilding all assets", true
end

#run_on_change(paths) ⇒ Object

Called on file(s) modifications



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

def run_on_change(paths)
  build_all_assets "Assets have changed, rebuilding..."
end

#startObject

Runs on marv watch



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

def start
  build_all_assets "Building all assets"
end