Sha256: 6fc504732dbb57b69be1483ba08175d4ced3154eb84dcbf09769f8267f70aef5

Contents?: true

Size: 536 Bytes

Versions: 72

Compression:

Stored size: 536 Bytes

Contents

# require "eitil_support/directory"

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

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
eitil-2.0.8 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-2.0.7 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-2.0.6 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-2.0.5 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-2.0.4 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-2.0.3 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-2.0.2 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-2.0.1 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-2.0.0 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.4.1 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.4.0 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.3.12 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.3.11 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.3.10 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.3.9 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.3.8 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.3.7 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.3.6 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.3.5 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.3.4 eitil_support/lib/eitil_support/directory/lookups.rb