* Rolled forward again with "Updated upb from defcleanup branch..."
Revert "Revert "Updated upb from defcleanup branch and modified Ruby to use it (#5539)" (#5848)"
This reverts commit 1568deab40.
* A few more merge fixes.
* Updated for defcleanup2 branch.
* Fixed upb to define upb_decode().
* Fixed names of nested messages.
* Revert submodule.
* Set -std=gnu90 and fixed warnings/errors.
Some of our Kokoro tests seem to run with this level of warnings,
and the source strives to be gnu90 compatible. Enforcing it for
every build removes the possibility of some errors showing up in
Kokoro/Travis tests only.
* Fixed remaining warnings with gnu90 mode.
I tried to match warning flags with what Ruby appears to do
in our Kokoro tests.
* Initialize values registered by rb_gc_register_address().
* Fixed subtle GC bug.
We need to initialize this marked value before creating the instance.
* Truly fix the GC bug.
* Updated upb for mktime() fix.
* Removed XOPEN_SOURCE as we are not using strptime().
* Removed fixed tests from the conformance failure list for Ruby.
* Fixed memory error related to oneof def names.
* Picked up new upb changes re: JSON printing.
* Uncomment concurrent decoding test.
value_field_typeclass should be a enum module, not EnumDescriptor
object.
Also expanding tests for enum valued maps.
Fixes#4580
Signed-off-by: Sorah Fukumori <her@sorah.jp>
* add implicit time conversion
* add duration
* add init test
* more tests
* add type check and alternative c type check
* add rational and bigdecimal
* use rb_obj_is_kind_of
* use native time check
* chain implicit conversions
* remove unused variable
* Revert "Revert "Fix Ruby module name generation when the ruby_package option is used (#5735)""
This reverts commit bb211e851e.
* add new files to Makefile.am
* add frozen checks
* Use rb_check_frozen
* Correct assertion on frozen error message
The second argument for the method assert_raise is the message
to show when the assertion fails. It does not check the error
object's message.
Add an additional assertion that does check the error's message.
* do frozen check first
* example with extra enum method
* update expected test output
* slight simplification
* add test for generated enum helpers
* move const helpers to c extension
* more explicit test
* more explicit test
* indent
* add foo test
* add check for _const suffix
* Revert "Revert "Enable the ignore_unknown_field option in the Ruby unmarshal options" (#5511)"
This reverts commit be1716a6d0.
* Separate ruby conformance test on Mac
* Fix shell syntax
* Fix test
* Add ruby 2.6 test
* Fix broken tests
* Fix compatibility test
* Fix bundler version
* Use new docker image
* Fix broken test
* Use new docker image in ruby26 test
* Install ruby for mac
This adds the ability for the MRI Ruby library to optionally pass in a
ignore_unknown_fields option when decoding JSON. The functionality was
added upstream in upb, this change exposes that option.
* Replace assert_true/assert_false with assert, because they are not provided in newer version of test/unit
* Use rescue to handle exception subclass
* Commented out the require that caused gc_test failure.
* Commented out test
* Fix typo
This change only adds basic proto2 support without advanced features
like extensions, custom options, maps, etc.
The protoc binary now generates ruby code for proto2 syntax.
However, for now, it is restricted to proto2 files without advanced features
like extensions, in which case it still errors out.
This change also modifies the DSL to add proto messages to the DescriptorPool.
There is a new DSL Builder#add_file to create a new FileDescriptor. With this,
the generated ruby DSL looks something like:
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file "test.proto" do
add_message "foo" do
optional :val, :int32, 1
end
end
end
* Add continuous test for ruby 2.3, 2.4 and 2.5
* Change ruby 2.5 to 2.5.0
* No need to provide argument to rb_funcall when argc is 0
* Fix tests for ruby 2.5
* Use rescue instead of assert_raise to accept subclass of error
* Add continuous test for ruby 2.3, 2.4 and 2.5
* Change ruby 2.5 to 2.5.0
* No need to provide argument to rb_funcall when argc is 0
* Fix tests for ruby 2.5
* Use rescue instead of assert_raise to accept subclass of error
* This allows for ruby code to catch and handle Protobuf
TypeErrors separately from the standard Ruby TypeError
* Maintains backwards compatibility by having the new
Google::Protobuf::TypeError inherit from the base
TypeError. Any code that was catching TypeError should
continue to work.
* Add discard unknown API in ruby.
* Add test for oneof message field.
* Add TestUnknown to represent unknown field data clearly.
* Only serialize the message with unknown fields itself in test.
* Move discard_unknown from Message to Google.Protobuf