<commit_before>module ClearcaseHelper
  class View
    include Executables

    attr_reader :view_path
    attr_reader :identity_map

    def initialize(view_path)
      @view_path = view_path
    end

    def files(refresh=false, options={})
      if @files and !refresh
        return @files
      end

      success, stdout = cleartool("ls", "-recurse", @view_path, options)

      # load excludes from .ccignore
      ccignore_file = File.join(@view_path,'.ccignore')
      ccignore = if File.exist?(ccignore_file)
                   File.readlines(ccignore_file).map {|ignore| ignore.strip}
                 else
                   %w(\.hg|\.git|\.svn)
                 end

      raw_files = stdout.split(/\n/)
      raw_files.reject! do |f|
        ccignore.any? do |ignore|<commit_msg>* improve .ccignore file format: commentlines and empty lines are supported now<commit_after>module ClearcaseHelper
  class View
    include Executables

    attr_reader :view_path
    attr_reader :identity_map

    def initialize(view_path)
      @view_path = view_path
    end

    def files(refresh=false, options={})
      if @files and !refresh
        return @files
      end

      success, stdout = cleartool("ls", "-recurse", @view_path, options)

      # load excludes from .ccignore
      ccignore_file = File.join(@view_path,'.ccignore')
      ccignore = if File.exist?(ccignore_file)
                   File.readlines(ccignore_file).map {|ignore| ignore.strip}.reject{|line| line.match(/^#.*/) || line.empty?}
                 else
                   %w(\.hg|\.git|\.svn)
                 end

      raw_files = stdout.split(/\n/)
      raw_files.reject! do |f|
        ccignore.any? do |ignore|
{'fraction_non_alphanumeric': 0.10993533215755438, 'fraction_numerical': 0.0, 'mean_word_length': 2.2234848484848486, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2201514', 'n_tokens_mistral': 528, 'n_tokens_neox': 510, 'n_words': 120}