Sha256: f747f0543617dc523bbf6ec01f4877d7369c4c7ab210683d7819f886738ac995

Contents?: true

Size: 674 Bytes

Versions: 2

Compression:

Stored size: 674 Bytes

Contents

require 'guard'
require 'guard/guard'

module Guard
  class MarvTemplates < ::Guard::Guard

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

    # Runs on marv watch
    def start
      copy_templates("Copying templates over", true)
    end

    # Runs on all command in guard console
    def run_all
      copy_templates("Rebuilding all templates", true)
    end

    # Called on file(s) modifications
    def run_on_change(paths)
      copy_templates("Templates have changed, copying over", nil)
    end

    # Copy templates
    def copy_templates(message, clean)
      UI.info message
      ::Marv::Guard.builder.copy_templates(clean)
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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