module EitilSupport module Directory class << self def contents(directory='app') Dir[File.join(directory, '**', '*')] end def files(directory='app') contents(directory).select { |file| File.file?(file) } end def subdirs(directory='app') contents(directory).select { |file| File.directory?(file) } end def lines(directory='app') files(directory).map { |file| File.open(file).count }.sum end end end end