<commit_before>module Quinc
  module Sources

    # On large file/directory structures, finding all files and then trimming
    # down that list takes a long time. Let's use the command 'find' to find
    # exactly the files we want.
    class FastModifiedFiles
      attr_reader :path
      attr_reader :modified_since

      def initialize(path, modified_since)
        @path = File.expand_path(path)
        @modified_since = modified_since
      end

      def files
        seconds = (Time.now - modified_since).ceil
        files = `find "#{ path }" -mtime -#{ seconds }s`.strip.split("\n")
        files.select { |f| File.file?(f) }
      end
    end

  end
end
<commit_msg>fix bug in fast modified files<commit_after>module Quinc
  module Sources

    # On large file/directory structures, finding all files and then trimming
    # down that list takes a long time. Let's use the command 'find' to find
    # exactly the files we want.
    class FastModifiedFiles
      attr_reader :path
      attr_reader :modified_since

      def initialize(path, modified_since)
        @path = File.expand_path(path)
        @path += "/" unless @path[-1] == "/"
        @modified_since = modified_since.to_time
      end

      def files
        seconds = (Time.now - modified_since).ceil
        files = `find "#{ path }" -mtime -#{ seconds }s`.strip.split("\n")
        files.select { |f| File.file?(f) }
      end
    end

  end
end

{'fraction_non_alphanumeric': 0.09497206703910614, 'fraction_numerical': 0.0006983240223463687, 'mean_word_length': 2.436450839328537, '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': '5818198', 'n_tokens_mistral': 424, 'n_tokens_neox': 415, 'n_words': 138}