Class: Guard::ForgeConfig

Inherits:
Guard
  • Object
show all
Defined in:
lib/guard/forge/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(watchers = [], options = {}) ⇒ ForgeConfig

Returns a new instance of ForgeConfig.



6
7
8
# File 'lib/guard/forge/config.rb', line 6

def initialize(watchers=[], options={})
  super
end

Instance Method Details

#reloadObject

Called on Ctrl-Z signal This method should be mainly used for “reload” (really!) actions like reloading passenger/spork/bundler/…



12
13
14
15
# File 'lib/guard/forge/config.rb', line 12

def reload
  UI.info "Reloading project config"
  ::Forge::Guard.project.load_config
end

#run_allObject

Called on Ctrl-\ signal This method should be principally used for long action like running all specs/tests/…



19
20
21
22
23
# File 'lib/guard/forge/config.rb', line 19

def run_all
  UI.info "Reloading project config"
  ::Forge::Guard.project.load_config
  true
end

#run_on_change(paths) ⇒ Object

Called on file(s) modifications



26
27
28
29
30
31
32
# File 'lib/guard/forge/config.rb', line 26

def run_on_change(paths)
  UI.info "Project config changed, reloading"
  ::Forge::Guard.project.load_config
  ::Forge::Guard.builder = ::Forge::Builder.new(::Forge::Guard.project)
  # Rebuild everything if the config changes
  ::Forge::Guard.builder.build
end