Sha256: f7b2691d7cfaa90555b6797dd32e65d6af01f3d05f852628353e041d039cca9f

Contents?: true

Size: 668 Bytes

Versions: 3

Compression:

Stored size: 668 Bytes

Contents

# encoding: UTF-8

require "rubygems"
require "treetop"
require "protopuffs/message/base"
require "protopuffs/message/field"
require "protopuffs/message/wire_type"
require "protopuffs/parser/parser"


module Protopuffs
  class ParseError < StandardError; end

  def self.proto_load_path
    @proto_load_path ||= []
  end

  def self.proto_load_path=(paths)
    @proto_load_path = paths
  end

  def self.load_message_classes
    parser = Protopuffs::Parser::ProtocolBufferDescriptor.new

    @proto_load_path.each do |path|
      Dir.glob(File.join(path, "**/*.proto")) do |descriptor_path|
        parser.parse(File.read(descriptor_path))
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
chrisk-protopuffs-0.2.1 lib/protopuffs.rb
chrisk-protopuffs-0.3.0 lib/protopuffs.rb
protopuffs-0.3.0 lib/protopuffs.rb