Sha256: 27e28ce994718ada8c027c906009d6395ecd85baad4d45bb2a72cd5e1be07235

Contents?: true

Size: 572 Bytes

Versions: 24

Compression:

Stored size: 572 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 relations
        parsers.map(&:relations).map(&:to_a).reduce([], :+)
      end

      private

      attr_reader :parsers
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rubrowser-2.11 lib/rubrowser/parser/directory.rb
rubrowser-2.10 lib/rubrowser/parser/directory.rb
rubrowser-2.9.1 lib/rubrowser/parser/directory.rb
rubrowser-2.9.0 lib/rubrowser/parser/directory.rb
rubrowser-2.8.0 lib/rubrowser/parser/directory.rb
rubrowser-2.7.1 lib/rubrowser/parser/directory.rb
rubrowser-2.7.0 lib/rubrowser/parser/directory.rb
rubrowser-2.6.0 lib/rubrowser/parser/directory.rb
rubrowser-2.5.0 lib/rubrowser/parser/directory.rb
rubrowser-2.4.0 lib/rubrowser/parser/directory.rb
rubrowser-2.3.0 lib/rubrowser/parser/directory.rb
rubrowser-2.2.0 lib/rubrowser/parser/directory.rb
rubrowser-2.1.0 lib/rubrowser/parser/directory.rb
rubrowser-2.0.0 lib/rubrowser/parser/directory.rb
rubrowser-0.3.1 lib/rubrowser/parser/directory.rb
rubrowser-0.3.0 lib/rubrowser/parser/directory.rb
rubrowser-0.2.7 lib/rubrowser/parser/directory.rb
rubrowser-0.2.6 lib/rubrowser/parser/directory.rb
rubrowser-0.2.5 lib/rubrowser/parser/directory.rb
rubrowser-0.2.4 lib/rubrowser/parser/directory.rb