Sha256: b3bd3f80ed9b5103fc0a657811443d5d4ae06d20af1ed456e0e06635a9f4dcee

Contents?: true

Size: 574 Bytes

Versions: 1

Compression:

Stored size: 574 Bytes

Contents

module Rubrowser
  module Parser
    class Directory
      attr_reader :directory

      def initialize(directory)
        @directory = directory
        files = Dir.glob(::File.join(directory, '**', '*.rb'))
        @parsers = files.map { |f| File.new(f) }
      end

      def parse
        parsers.each(&:parse)
      end

      def definitions
        parsers.map(&:definitions).map(&:to_a).reduce([], :+)
      end

      def occurences
        parsers.map(&:occurences).map(&:to_a).reduce([], :+)
      end

      private

      attr_reader :parsers
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubrowser-0.1.6 lib/parser/directory.rb