Sha256: 92c6cf72e6c94970e5bea721f19d296c1174a70a38df2de66197d8a66faac8ce

Contents?: true

Size: 805 Bytes

Versions: 2

Compression:

Stored size: 805 Bytes

Contents

require 'guard'
require 'guard/guard'

module Guard
  class MarvConfig < ::Guard::Guard

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

    # This method should be mainly used for "reload"
    def reload
      UI.info "Reloading project config"
      ::Marv::Guard.project.load_config
    end

    # Runs on all command in guard console
    def run_all
      UI.info "Reloading project config"
      ::Marv::Guard.project.load_config
      true
    end

    # Called on file(s) modifications
    def run_on_change(paths)
      UI.info "Project config changed, reloading"
      ::Marv::Guard.project.load_config
      ::Marv::Guard.builder = ::Marv::Builder.new(::Marv::Guard.project)

      # Rebuild everything if the config changes
      ::Marv::Guard.builder.build
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
marv-0.3.2 lib/guard/marv/config.rb
marv-0.3.1 lib/guard/marv/config.rb