Sha256: afba1efc9c97c1082c766fd5bf5ff8b4fc96a0bb75af3a5938a162dae8defab1

Contents?: true

Size: 909 Bytes

Versions: 8

Compression:

Stored size: 909 Bytes

Contents

require 'guard'
require 'guard/guard'
require 'childprocess'

module Guard
  class Spork < Guard

    autoload :Runner, 'guard/spork/runner'
    autoload :SporkInstance, 'guard/spork/spork_instance'
    autoload :SporkWindowsInstance, 'guard/spork/spork_windows_instance'
    attr_accessor :runner

    def initialize(watchers=[], options={})
      super
      @runner = Runner.new(options)
    end

    def start
      runner.kill_global_sporks
      runner.launch_sporks("start")
    end

    def reload
      runner.kill_sporks
      runner.launch_sporks("reload")
    end

    def run_on_changes(paths_or_symbol)
      if paths_or_symbol.is_a?(Symbol)
        runner.kill_sporks(paths_or_symbol)
        runner.launch_sporks("reload", paths_or_symbol)
      else
        runner.kill_sporks
        runner.launch_sporks("reload")
      end
    end

    def stop
      runner.kill_sporks
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
guard-spork-1.5.2 lib/guard/spork.rb
guard-spork-1.5.1 lib/guard/spork.rb
guard-spork-1.5.0 lib/guard/spork.rb
guard-spork-1.4.3 lib/guard/spork.rb
guard-spork-1.4.2 lib/guard/spork.rb
guard-spork-1.4.1 lib/guard/spork.rb
guard-spork-1.4.0 lib/guard/spork.rb
guard-spork-1.3.0 lib/guard/spork.rb