Sha256: fb824267e10c8c097be859d995ab60aff57cc664f1e6801f0f5873dd7437593e

Contents?: true

Size: 741 Bytes

Versions: 13

Compression:

Stored size: 741 Bytes

Contents

module RevealCK
  module Commands
    # The idea of listening for file system changes that indicate its
    # time to tell browsers to reload.
    class ListenToReloadBrowser
      attr_reader :prefix

      def initialize(ui)
        @prefix = ui.prefix_for(:reload)
      end

      def run
        sleeping_guard = setup_and_run_guard
        ThreadWaker.new(sleeping_guard).run
        sleeping_guard
      end

      private

      def setup_and_run_guard
        require 'guard/cli'
        Guard::UI.options[:template] = "#{prefix} :message"
        guardfile = RevealCK.path('files/reveal-ck/Guardfile')
        Thread.new do
          Guard.start(guardfile: guardfile, no_interactions: true)
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
reveal-ck-3.9.0 lib/reveal-ck/commands/listen_to_reload_browser.rb
reveal-ck-3.8.1 lib/reveal-ck/commands/listen_to_reload_browser.rb
reveal-ck-3.8.0 lib/reveal-ck/commands/listen_to_reload_browser.rb
reveal-ck-3.7.0 lib/reveal-ck/commands/listen_to_reload_browser.rb
reveal-ck-3.6.0 lib/reveal-ck/commands/listen_to_reload_browser.rb
reveal-ck-3.5.1 lib/reveal-ck/commands/listen_to_reload_browser.rb
reveal-ck-3.5.0 lib/reveal-ck/commands/listen_to_reload_browser.rb
reveal-ck-3.4.0 lib/reveal-ck/commands/listen_to_reload_browser.rb
reveal-ck-3.3.1 lib/reveal-ck/commands/listen_to_reload_browser.rb
reveal-ck-3.3.0 lib/reveal-ck/commands/listen_to_reload_browser.rb
reveal-ck-3.2.0 lib/reveal-ck/commands/listen_to_reload_browser.rb
reveal-ck-3.1.0 lib/reveal-ck/commands/listen_to_reload_browser.rb
reveal-ck-3.0.1 lib/reveal-ck/commands/listen_to_reload_browser.rb