Sha256: 3a6ab0a3b05c3d607a19d3751dfe5b099687fcc22d25b5956d0324ac50e61d59

Contents?: true

Size: 733 Bytes

Versions: 2

Compression:

Stored size: 733 Bytes

Contents

require 'guard'
require 'guard/guard'
require 'guard/jasmine-headless-webkit/runner'

module Guard
  class JasmineHeadlessWebkit < Guard
    def initialize(watchers = [], options = {})
      super
      @options = {
        :all_on_start => true
      }.merge(options)
    end
    
    def start
      UI.info "Guard::JasmineHeadlessWebkit is running."
      run_all if @options[:all_on_start]
    end

    def run_all
      JasmineHeadlessWebkitRunner.run
    end

    def run_on_change(paths)
      run_all if JasmineHeadlessWebkitRunner.run(paths) == 0
    end
  end

  class Dsl
    def newest_js_file(path)
      Dir[path + '*.{js,coffee}'].sort { |left, right| File.mtime(right) <=> File.mtime(left) }.first
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
guard-jasmine-headless-webkit-0.0.3 lib/guard/jasmine-headless-webkit.rb
guard-jasmine-headless-webkit-0.0.2 lib/guard/jasmine-headless-webkit.rb