Sha256: 8c2337c7aa7b1c8cab6eea62bab7c96a272d73cb23517180998a17e649f49d70

Contents?: true

Size: 687 Bytes

Versions: 12

Compression:

Stored size: 687 Bytes

Contents

module Guard
  class Templates < ::Guard::Plugin

    def initialize(options={})
      super
    end

    # Runs on marv watch
    def start
      copy_all_templates "Copying templates over"
    end

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

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

    def copy_all_templates(message, clean=nil)
      builder = Marv::Project::Guard.builder.templates

      UI.info message
      builder.clean_templates unless clean.nil?
      builder.copy_templates
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
marv-0.8.2 lib/marv/project/guard/templates.rb
marv-0.8.0 lib/marv/project/guard/templates.rb
marv-0.7.3 lib/marv/project/guard/templates.rb
marv-0.7.2 lib/marv/project/guard/templates.rb
marv-0.7.1 lib/marv/project/guard/templates.rb
marv-0.7.0 lib/marv/project/guard/templates.rb
marv-0.6.5 lib/marv/project/guard/templates.rb
marv-0.6.4 lib/marv/project/guard/templates.rb
marv-0.6.3 lib/marv/project/guard/templates.rb
marv-0.6.2 lib/marv/project/guard/templates.rb
marv-0.6.1 lib/marv/project/guard/templates.rb
marv-0.6.0 lib/marv/project/guard/templates.rb