<commit_before>module Rails3::Assist
  module File
    module Methods
      {:initializer => 'rb', :db => 'rb', :migration => 'rb', :locale => 'yml', :javascript => 'js', :stylesheet => 'css'}.each_pair do |name, ext|
        plural_name = name.to_s.pluralize
        pure_ext = ext.gsub /^\./, ''
        class_eval %{      
          def #{name}_file? name
            name = (name =~ /.rb$/) ? name : "\#{name}.#{pure_ext}"            
            ::File.file? #{name}_file(name)
          end            
          alias_method :has_#{name}_file?, :#{name}_file?

          def #{name}_files? *names
            names.to_strings.each do |name|
              return false if !#{name}_file?(name)
            end
            true
          end            
          
          def #{name}_file name
            name = (name =~ /.rb$/) ? name : "\#{name}.#{pure_ext}"
            ::File.join(Rails3::Assist::Artifact::Directory.#{name}_dir, name)
          end  

          def create_#{name} name, &block
            Rails3::Assist.create_empty_tmp #{name}_dir if !::File.directory?(Rails3::Assist::Artifact::Directory.#{name}_dir)
            ::File.overwrite #{name}_file(name) do
              yield
            end
          end

          def remove_all_#{plural_name}
            return if !::File.directory?(Rails3::Assist::Artifact::Directory.#{name}_dir)
            #{name}_files.each{|f| ::File.delete_file! f}
          end

          def remove_#{plural_name} *names
            return remove_all_#{plural_name} if names.empty? <commit_msg>improved some more<commit_after>module Rails3::Assist
  module File
    module Methods
      {:initializer => 'rb', :db => 'rb', :migration => 'rb', :locale => 'yml', :javascript => 'js', :stylesheet => 'css'}.each_pair do |name, ext|
        plural_name = name.to_s.pluralize
        pure_ext = ext.gsub /^\./, ''
        class_eval %{      
          def #{name}_file? name
            name = (name =~ /.rb$/) ? name : "\#{name}.#{pure_ext}"            
            ::File.file? #{name}_file(name)
          end            
          alias_method :has_#{name}_file?, :#{name}_file?

          def #{name}_files? *names
            names.to_strings.each do |name|
              return false if !#{name}_file?(name)
            end
            true
          end            
          
          def #{name}_file name
            name = (name =~ /.rb$/) ? name : "\#{name}.#{pure_ext}"
            ::File.join(Rails3::Assist::Artifact::Directory.#{name}_dir, name)
          end  

          def create_#{name} name, &block
            Rails3::Assist::App.create_empty_tmp #{name}_dir if !::File.directory?(Rails3::Assist::Artifact::Directory.#{name}_dir)
            ::File.overwrite #{name}_file(name) do
              yield
            end
          end

          def remove_all_#{plural_name}
            return if !::File.directory?(Rails3::Assist::Artifact::Directory.#{name}_dir)
            #{name}_files.each{|f| ::File.delete_file! f}
          end

          def remove_#{plural_name} *names
            return remove_all_#{plural_name} if names.empty? 
{'fraction_non_alphanumeric': 0.15384615384615385, 'fraction_numerical': 0.003205128205128205, 'mean_word_length': 1.8606782768102659, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '3594074', 'n_tokens_mistral': 960, 'n_tokens_neox': 974, 'n_words': 190}