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-1.1.8 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.1.7 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.1.6 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.1.5 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.1.4 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.1.3 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.1.2 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.1.1 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.1.0 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.0.4 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.0.3 eitil_support/lib/eitil_support/directory/lookups.rb
eitil-1.0.3.e.1 eitil_support/lib/eitil_support/directory/lookups.rb