Sha256: acf25cf4f630c88a081829cb469ac1834f3e676134f546ebb89dad63f21a7488

Contents?: true

Size: 674 Bytes

Versions: 8

Compression:

Stored size: 674 Bytes

Contents

module Guard
  class Dsl
    
    def self.evaluate_guardfile
      guardfile = "#{Dir.pwd}/Guardfile"
      dsl = new
      dsl.instance_eval(File.read(guardfile.to_s), guardfile.to_s, 1)
    rescue
      UI.error "Guardfile not found or invalid"
      exit 1
    end
    
    def self.guardfile_included?(guard_name)
      File.read('Guardfile').include?("guard '#{guard_name}'")
    end
    
    def guard(name, options = {}, &definition)
      @watchers = []
      definition.call if definition
      ::Guard.add_guard(name, @watchers, options)
    end
    
    def watch(pattern, &action)
      @watchers << ::Guard::Watcher.new(pattern, action)
    end
    
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
arcabouco-0.2.13 vendor/bundle/gems/guard-0.2.2/lib/guard/dsl.rb
guard-0.2.2 lib/guard/dsl.rb
guard-0.2.1 lib/guard/dsl.rb
guard-0.2.0 lib/guard/dsl.rb
guard-0.2.0.beta.1 lib/guard/dsl.rb
guard-0.1.1 lib/guard/dsl.rb
guard-0.1.0 lib/guard/dsl.rb
guard-0.1.0.beta.2 lib/guard/dsl.rb