Class: Guard::Rugular

Inherits:
Plugin
  • Object
show all
Defined in:
lib/rugular/tasks/server/guards/rugular.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Rugular

Returns a new instance of Rugular.



9
10
11
# File 'lib/rugular/tasks/server/guards/rugular.rb', line 9

def initialize(opts = {})
  super(opts)
end

Instance Method Details

#reloadObject



15
# File 'lib/rugular/tasks/server/guards/rugular.rb', line 15

def reload; true end

#run_allObject



17
18
19
# File 'lib/rugular/tasks/server/guards/rugular.rb', line 17

def run_all
  run_on_changes('src/app/app.coffee')
end

#run_on_changes(paths) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/rugular/tasks/server/guards/rugular.rb', line 21

def run_on_changes(paths)
  paths.each do |file|
    ::Guard::UI.info "Guard received save event for #{file}"

    case file.split('.').last
    when 'haml'   then message = compile_haml(file)
    when 'coffee' then message = compile_coffee(file)
    when 'yaml'   then message = compile_yaml
    end

    ::Guard::UI.info message
  end
end

#run_on_removals(paths) ⇒ Object



35
36
37
# File 'lib/rugular/tasks/server/guards/rugular.rb', line 35

def run_on_removals(paths)
  run_on_changes(paths)
end

#startObject



13
# File 'lib/rugular/tasks/server/guards/rugular.rb', line 13

def start; true end

#stopObject



14
# File 'lib/rugular/tasks/server/guards/rugular.rb', line 14

def stop; true end