<commit_before>module Guard
  class Webpack < ::Guard.const_get(::Guard.const_defined?(:Plugin) ? :Plugin : :Guard)
    require 'guard/webpack/version'
    require 'guard/webpack/runner'

    DEFAULT_OPTIONS = {
      progress: true,
      colors:   true
    }

    attr_accessor :runner

    def initialize(*args)
      with_defaults(args[-1]) do |opts|
        super(opts)
        @runner = Runner.new(opts)
        @runner.start
      end
    end

    def run_on_modifications(p);  @runner.restart;  end
    def run_all;                  @runner.restart;  end
    def reload;                   @runner.restart;  end
    def start;                    @runner.start;    end
    def stop;                     @runner.stop;     end

    private

    def with_defaults(options)
      yield DEFAULT_OPTIONS.merge(options)
    end

  end
end
<commit_msg>let guard determine who starts who<commit_after>module Guard
  class Webpack < ::Guard.const_get(::Guard.const_defined?(:Plugin) ? :Plugin : :Guard)
    require 'guard/webpack/version'
    require 'guard/webpack/runner'

    DEFAULT_OPTIONS = {
      progress: true,
      colors:   true
    }

    attr_accessor :runner

    def initialize(*args)
      with_defaults(args[-1]) do |opts|
        super(opts)
        @runner = Runner.new(opts)
      end
    end

    def run_on_modifications(p);  @runner.restart;  end
    def run_all;                  @runner.restart;  end
    def reload;                   @runner.restart;  end
    def start;                    @runner.start;    end
    def stop;                     @runner.stop;     end

    private

    def with_defaults(options)
      yield DEFAULT_OPTIONS.merge(options)
    end

  end
end

{'fraction_non_alphanumeric': 0.09417304296645085, 'fraction_numerical': 0.0011771630370806356, 'mean_word_length': 1.9411764705882353, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5962701', 'n_tokens_mistral': 528, 'n_tokens_neox': 503, 'n_words': 118}