<commit_before>module Octodown
  module Support
    module Services
      class Riposter
        def self.call(file, &listener_callback)
          require 'listen'

          path = File.dirname(File.expand_path(file.path))
          regex = Regexp.new(file.path)

          @listener ||= Listen.to(path, only: regex) do
            listener_callback.call
          end

          @listener.start
        end
      end
    end
  end
end<commit_msg>Fix regex from listen :only<commit_after>module Octodown
  module Support
    module Services
      class Riposter
        def self.call(file, &listener_callback)
          require 'listen'

          path = File.dirname(File.expand_path(file.path))
          regex = Regexp.new("^#{File.basename(file.path)}$")

          @listener ||= Listen.to(path, only: regex) do
            listener_callback.call
          end

          @listener.start
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08690987124463519, 'fraction_numerical': 0.0, 'mean_word_length': 1.9339622641509433, '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': '1356406', 'n_tokens_mistral': 270, 'n_tokens_neox': 264, 'n_words': 63}