From 181c7f26360429b236ab833c746d10d97811931f Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Wed, 15 Jul 2015 11:05:10 -0700 Subject: Added Ruby to conformance tests. This involved fixing a few important bugs in the Ruby implementation -- mostly cases of mixing upb field types and descriptor types (upb field types do not distinguish between int/sint/fixed/sfixed like descriptor types do). Also added protobuf-specific exceptions so parse errors can be caught specifically. Change-Id: Ib49d3db976900b2c6f3455c8b88af52cfb86e036 --- ruby/lib/google/protobuf.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ruby/lib/google/protobuf.rb') diff --git a/ruby/lib/google/protobuf.rb b/ruby/lib/google/protobuf.rb index 99b17929..74ea770d 100644 --- a/ruby/lib/google/protobuf.rb +++ b/ruby/lib/google/protobuf.rb @@ -31,6 +31,15 @@ # require mixins before we hook them into the java & c code require 'google/protobuf/message_exts' +# We define these before requiring the platform-specific modules. +# That way the module init can grab references to these. +module Google + module Protobuf + class Error < RuntimeError; end + class ParseError < Error; end + end +end + if RUBY_PLATFORM == "java" require 'json' require 'google/protobuf_java' -- cgit v1.2.3