Sha256: 710dbb1ae32e94df2fbbc38e6dc27ce94c7d6d616e6eecc8e2d7f22804d80f78

Contents?: true

Size: 847 Bytes

Versions: 9

Compression:

Stored size: 847 Bytes

Contents

require 'rack-livereload'

# Stub Guard
module Guard
  class Plugin
    def initialize(options = {})
    end
  end

  module UI
    class << self
      def method_missing(meth, *args)
        Locomotive::Common::Logger.send(meth, *args)
      end
    end
  end
end

require 'guard/livereload'
require 'locomotive/wagon/misc/tcp_port'

module Locomotive
  module Wagon

    class LiveReload

      extend Forwardable

      def_delegators :@livereload, :start, :stop, :run_on_modifications

      attr_reader :port

      def initialize(options = {})
        tcp_port = Locomotive::Wagon::TcpPort.new(options[:host], 35729)
        @port = tcp_port.first

        Locomotive::Common::Logger.debug "service=liveReload action=start port=#{@port}"

        @livereload = Guard::LiveReload.new(options.merge(port: @port))
      end

    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
locomotivecms_wagon-2.0.0.rc3 lib/locomotive/wagon/tools/livereload.rb
locomotivecms_wagon-2.0.0.rc2 lib/locomotive/wagon/tools/livereload.rb
locomotivecms_wagon-2.0.0.rc1 lib/locomotive/wagon/tools/livereload.rb
locomotivecms_wagon-2.0.0.pre.beta.2 lib/locomotive/wagon/tools/livereload.rb
locomotivecms_wagon-2.0.0.pre.beta.1 lib/locomotive/wagon/tools/livereload.rb
locomotivecms_wagon-2.0.0.pre.alpha.3 lib/locomotive/wagon/tools/livereload.rb
locomotivecms_wagon-2.0.0.pre.alpha.2 lib/locomotive/wagon/tools/livereload.rb
locomotivecms_wagon-2.0.0.pre.alpha.1 lib/locomotive/wagon/tools/livereload.rb
locomotivecms_wagon-2.0.0.pre.alpha lib/locomotive/wagon/tools/livereload.rb