Sha256: a3f74cf2f97f7c99f9f8e3330e2f6e29afa236f4d140b7226cbe9f0884eb6f7d
Contents?: true
Size: 803 Bytes
Versions: 1
Compression:
Stored size: 803 Bytes
Contents
require 'find' module Pluginscan # Responsible for searching through a directory for php files, and counting the total files class FileFinder def initialize(directory) @directory = directory end def count found_files.count end def php_files found_files.php_files end private def found_files @found_files ||= find_files end def find_files found_files = FoundFiles.new Find.find @directory do |file| found_files.count += 1 unless Dir.exist?(file) # Skip directories found_files.php_files << file if file =~ /\.php$/ end found_files end FoundFiles = Struct.new(:php_files, :count) do def initialize self.php_files = [] self.count = 0 end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pluginscan-0.9.0 | lib/pluginscan/file_finder.rb |