method

calculate_directory_statistics

calculate_directory_statistics(directory, pattern = /^(?!\\.).*?\\.(rb|js|coffee|rake)$/)
private

No documentation available.

# File railties/lib/rails/code_statistics.rb, line 41
    def calculate_directory_statistics(directory, pattern = /^(?!\.).*?\.(rb|js|coffee|rake)$/)
      stats = CodeStatisticsCalculator.new

      Dir.foreach(directory) do |file_name|
        path = "#{directory}/#{file_name}"

        if File.directory?(path) && (/^\./ !~ file_name)
          stats.add(calculate_directory_statistics(path, pattern))
        elsif file_name =~ pattern
          stats.add_by_file_path(path)
        end
      end

      stats
    end

1Note

Statistics

WilliamsGeorge ยท Oct 2, 2013

Thanks for the coding part it was really helpful for me, I would apply it on my project. http://www.koolchart.com