<commit_before>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
        require 'guard/cli'
        Guard::UI.options[:template] = "#{prefix} :message"
        guardfile = RevealCK.path('files/reveal-ck/Guardfile')
        Thread.new do
          Guard.start(guardfile: guardfile)
        end
      end
    end
  end
end
<commit_msg>[dependencies] Disable pry in Guard. Wake up every second.<commit_after>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
        regularly_wakeup 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

      def regularly_wakeup(thread)
        Thread.new do
          loop do
            sleep 1
            thread.wakeup
          end
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.06640368178829717, 'fraction_numerical': 0.0006574621959237344, 'mean_word_length': 2.09979633401222, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3132577', 'n_tokens_mistral': 444, 'n_tokens_neox': 427, 'n_words': 126}