Sha256: d5081beab40de929c3ccf52bd845b27a4dc7d13f18cb98ccbefecbfeecbea617

Contents?: true

Size: 680 Bytes

Versions: 3

Compression:

Stored size: 680 Bytes

Contents

require 'guard'
require 'guard/guard'

module Guard
  class LiveReload < Guard

    autoload :Reactor, 'guard/livereload/reactor'

    attr_accessor :reactor

    # =================
    # = Guard methods =
    # =================

    def initialize(watchers = [], options = {})
      super
      @options = {
        :api_version => '1.6',
        :host => '0.0.0.0',
        :port => '35729',
        :apply_js_live => true,
        :apply_css_live => true
      }.update(options)
    end

    def start
      @reactor = Reactor.new(@options)
    end

    def stop
      reactor.stop
    end

    def run_on_change(paths)
      reactor.reload_browser(paths)
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
guard-livereload-0.1.10 lib/guard/livereload.rb
guard-livereload-0.1.9 lib/guard/livereload.rb
guard-livereload-0.1.8 lib/guard/livereload.rb