Class: Guard::Rugular
- Inherits:
-
Plugin
- Object
- Plugin
- Guard::Rugular
- Defined in:
- lib/rugular/tasks/server/guards/rugular.rb
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Rugular
constructor
A new instance of Rugular.
- #reload ⇒ Object
- #run_all ⇒ Object
- #run_on_changes(paths) ⇒ Object
- #run_on_removals(paths) ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
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
#reload ⇒ Object
15 |
# File 'lib/rugular/tasks/server/guards/rugular.rb', line 15 def reload; true end |
#run_all ⇒ Object
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 = compile_haml(file) when 'coffee' then = compile_coffee(file) when 'yaml' then = compile_yaml end ::Guard::UI.info 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 |
#start ⇒ Object
13 |
# File 'lib/rugular/tasks/server/guards/rugular.rb', line 13 def start; true end |
#stop ⇒ Object
14 |
# File 'lib/rugular/tasks/server/guards/rugular.rb', line 14 def stop; true end |