<commit_before>module Mactag
  class Table
    @@tags = []

    class << self
      ##
      #
      # Generates the TAGS-table.
      #
      # ==== Example
      #   Mactag::Table.generate do
      #     app 'app/**/*.rb', 'lib/*.rb'
      #
      #     plugins 'thinking-sphinx', 'whenever'
      #
      #     gems 'paperclip', 'authlogic'
      #     gem 'formtastic', :version => '0.9.7'
      #
      #     rails :except => :actionmailer, :version => '2.3.5'
      #   end
      #
      # See documentation for the methods *app*, *plugins*, *gems* and
      # *rails* in respective tag class.
      #
      def generate(&block)
        parser = Mactag::Tag::Parser.new(self)
        parser.instance_eval(&block)
      end

      ##
      #
      # Add +tag+ to list of tags.
      #
      def <<(tag)
        @@tags << tag
      end

      ##
      #
      # Returns a string with all files that should be tagged. The
      # files are separated with a whitespace.
      #
      def tags
        @@tags.flatten!
        @@tags.collect!(&:tag)
        @@tags.collect! { |file| File.expand_path(file) }
        @@tags.collect! { |file| Dir.glob(file) }
        @@tags.uniq!
        @@tags.join(' ')
      end

      ##
      #
      # Create the TAGS file.
      #
      def create
        unless File.directory?(Mactag::Config.gem_home)
          Mactag.warn 'Gem home path does not exist on your system'
        end

        if @@tags.collect(&:files).flatten.empty?
          Mactag.warn 'You did not specify anything to tag'<commit_msg>No need to flatten anymore.<commit_after>module Mactag
  class Table
    @@tags = []

    class << self
      ##
      #
      # Generates the TAGS-table.
      #
      # ==== Example
      #   Mactag::Table.generate do
      #     app 'app/**/*.rb', 'lib/*.rb'
      #
      #     plugins 'thinking-sphinx', 'whenever'
      #
      #     gems 'paperclip', 'authlogic'
      #     gem 'formtastic', :version => '0.9.7'
      #
      #     rails :except => :actionmailer, :version => '2.3.5'
      #   end
      #
      # See documentation for the methods *app*, *plugins*, *gems* and
      # *rails* in respective tag class.
      #
      def generate(&block)
        parser = Mactag::Tag::Parser.new(self)
        parser.instance_eval(&block)
      end

      ##
      #
      # Add +tag+ to list of tags.
      #
      def <<(tag)
        @@tags << tag
      end

      ##
      #
      # Returns a string with all files that should be tagged. The
      # files are separated with a whitespace.
      #
      def tags
        @@tags.collect!(&:tag)
        # @@tags.flatten!
        @@tags.collect! { |file| File.expand_path(file) }
        @@tags.collect! { |file| Dir.glob(file) }
        @@tags.uniq!
        @@tags.join(' ')
      end

      ##
      #
      # Create the TAGS file.
      #
      def create
        unless File.directory?(Mactag::Config.gem_home)
          Mactag.warn 'Gem home path does not exist on your system'
        end

        if @@tags.collect(&:files).flatten.empty?
          Mactag.warn 'You did not specify anything to tag'
{'fraction_non_alphanumeric': 0.13586606567933032, 'fraction_numerical': 0.0038634900193174502, 'mean_word_length': 1.6131202691337259, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 9, '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': '3175260', 'n_tokens_mistral': 1023, 'n_tokens_neox': 978, 'n_words': 247}