Commit Graph

95 Commits

Author SHA1 Message Date
Chris Fallin
d326277397 Update MRI C Ruby extension to use new version of upb.
- Alter encode/decode paths to use the `upb_env` (environment)
  abstraction.
- Update upb amalgamation to upstream `93791bfe`.
- Fix a compilation warning (void*->char* cast).
- Modify build flags so that upb doesn't produce warnings -- the Travis
  build logs were pretty cluttered previously.
2015-05-15 11:36:12 -07:00
Chris Fallin
a526605aec Merge pull request #338 from skippy/encode-decode-helpers
ruby: Encode decode cleanup and behavior normalization
2015-05-15 10:52:56 -07:00
Chris Fallin
e96b5b6b7b Merge pull request #385 from cfallin/travis-refactor
Refactor Travis tests: split configs and run in parallel.
2015-05-14 15:05:08 -07:00
Chris Fallin
20e94b24dd Refactor Travis tests: split configs and run in parallel. 2015-05-14 11:48:21 -07:00
Adam Greene
cd7ebbe54f make repeated_field quack like an array 2015-05-14 10:38:11 -07:00
Chris Fallin
eb37551ae4 Added Ruby to Travis testing.
- Added RVM-based Ruby test driver that tests MRI and JRuby.
- Fixed JRuby compilation (at least in my current setup): force source
  version to 1.6 (Java 6) to allow generics and annotations.
- Modify the skipped JRuby JSON tests so that the exit code is 0 (skip()
  results in a failing exit code from `rake test`). An upcoming PR
  should fix JSON under JRuby in general soon.
2015-05-13 14:58:48 -07:00
Adam Greene
d1b52a00e0 adding and simplifying encoders/decoders
* make consistent between mri and jruby
* create a #to_h and have it use symbols for keys
* add #to_json and #to_proto helpers on the Google::Protobuf message classes
2015-05-13 10:03:56 -07:00
Chris Fallin
16a283f794 Merge pull request #334 from skippy/allow-msg-to-accept-nil
ruby: allow a message field to be unset
2015-05-02 19:02:08 -07:00
Adam Greene
64678265c5 allow a message field to be unset 2015-05-02 13:48:23 -07:00
Adam Greene
d55733c76e return nil if array index indicie is out of bounds
ruby arrays don't throw an exception; they return nil.  Lets do the
same!

this fix also includes the ability to use negative array indicies
2015-05-01 22:50:57 -07:00
Adam Greene
c70b6058ea add size alias for length
starting to make `RepeatedField` quack like an array

additional changes:
* make sure gemspec gets all ruby code files
* add homepage in gem spec removes one of the warnings, and the gem spec authors are pushing
everyone to include a homepage in the gem
* remove excess whitespace in test suite to bring formatting inline with the rest of the file
2015-05-01 11:48:04 -07:00
Adam Greene
761cfa08e6 build cleanups
* update docs to simplify build steps
* Gemfile.lock seemed to have an older version specified
* do not check in the pkg dir
2015-05-01 08:48:56 -07:00
Chris Fallin
14fd96224c Bump gem version to release bugfix. 2015-04-13 14:04:12 -07:00
Chris Fallin
e9abbd23fb Fixed issue #283: crash in JSON handler cleanup.
Includes repro test case from @wfarr.
2015-04-13 14:02:43 -07:00
Isaiah Peng
27e2b57830 add jruby support by protobuf-java reflection API 2015-03-10 23:14:08 +01:00
Chris Fallin
dfdec3b654 Updated Ruby gem version and added note to ruby/README.md regarding version number scheme.
Change-Id: Idb29077c153530de78ce28c094442aa8f51ddd25
2015-03-03 10:56:23 -08:00
Jisi Liu
40f2df3c16 Bump the version number to 3.0.0-alpha-3-pre
Change-Id: I33479e529b060e4fed532a827a386d3baecc835e
2015-03-02 19:31:31 -08:00
Chris Fallin
21fb217e6a Updated Ruby README with more details on getting started.
Change-Id: I54df314660cdb861ad8c4da75a08d4cb97faf638
2015-02-23 12:28:43 -08:00
Chris Fallin
11ad1bd277 Update Ruby gem version to 3.0.0.alpha.2.0.
This update conforms to our two-numbers-after-alpha scheme that allows
us to bump the last number if we need to re-upload a gem. (Rubygems does
not allow re-use of a version number once a gem is uploaded.)

Change-Id: Ia8e7c129d19800afd66f8052785cf5a00462c7ba
2015-02-20 18:06:31 -08:00
Chris Fallin
6ad8f547fe Updated Ruby README.
Change-Id: I8c3717f549c9b4e9d07c77ec5875c9cd62b296ac
2015-02-20 17:49:14 -08:00
Chris Fallin
db87a9c07a Merge pull request #211 from isaiah/map_inspect
Ruby implementation Map#inspect should be consistent with Hash#inspect
2015-02-17 13:02:32 -06:00
Isaiah Peng
4502626fa7 Google::Protobuf::Map#inspect should be consistent with Hash#inspect 2015-02-14 22:15:12 +01:00
Chris Fallin
315b93fdcc Addressed code-review comment. 2015-02-13 14:32:09 -08:00
Chris Fallin
a2bea0a001 Properly support maps in Ruby protoc and another bugfix.
Previously, we supported map fields in the Ruby DSL. However, we never
connected the final link in the chain and generated `map` DSL commands
for map fields in `.proto` files. My apologies -- I had been testing
with the DSL directly so I missed this.

Also fixed a handlerdata-setup-infinite-loop when a map value field's
type is its containing message.
2015-02-12 16:08:01 -08:00
Joshua Haberman
20490e33ca Merge pull request #189 from cfallin/update-ruby-upb
Updated to latest upb and added test for JSON map operation.
2015-02-05 15:22:17 -08:00
Chris Fallin
06bf6308ea README.md update for Ruby gem. 2015-02-05 14:58:57 -08:00
Chris Fallin
e7e79a43ed Merge pull request #190 from isaiah/to_ary
add #to_ary to RepeatedField
2015-02-03 09:57:13 -08:00
Isaiah Peng
ee5f6e9a35 add #to_ary to RepeatedField 2015-02-03 16:45:12 +01:00
Chris Fallin
a50759254f Updated to latest upb and added test for JSON map operation. 2015-02-02 15:07:34 -08:00
Chris Fallin
a3953da536 Updated based on code-review comments. 2015-02-02 13:16:57 -08:00
Chris Fallin
eb33f9d3d6 Updated based on code-review comments. 2015-02-02 13:03:08 -08:00
Chris Fallin
07b8b0f28d Addressed code-review comments. 2015-01-26 13:52:51 -08:00
Chris Fallin
9de35e7421 Addressed code-review comments. 2015-01-26 11:23:19 -08:00
Chris Fallin
e2debef5d8 Ruby extension: added oneof accessor. 2015-01-14 18:02:27 -08:00
Chris Fallin
e1b7d38d9a Addressed code-review comments. 2015-01-14 17:14:05 -08:00
Chris Fallin
3f3820d8f8 Two tests for Ruby code generator:
- A golden-file test that ensures protoc produces known-valid output.
- A Ruby test that loads that golden file and ensures it actually works
  with the extension.

This split strategy allows us to test end-to-end without needing to
integrate the Ruby gem build system and the protoc build system. This is
desirable because we do not want a gem build/install to depend on
building protoc, and we do not want building protoc to depend on
building and testing the gem.
2015-01-14 15:44:46 -08:00
Chris Fallin
fcd8889d5b Support oneofs in MRI Ruby C extension. 2015-01-14 14:35:57 -08:00
Chris Fallin
ace4212e60 Line-wraps at 80 chars. 2015-01-13 13:47:58 -08:00
Chris Fallin
addd26cbb3 Addressed code-review comments. 2015-01-12 16:09:35 -08:00
Chris Fallin
97b663a8be Update upb amalgamation. 2015-01-09 16:15:22 -08:00
Chris Fallin
4c92289766 Addressed code-review comments. 2015-01-09 15:37:55 -08:00
Chris Fallin
80276ac021 Addressed code-review comments. 2015-01-06 18:01:32 -08:00
Chris Fallin
fd1a3ff11d Support for maps in the MRI C Ruby extension.
This adds the Map container and support for parsing and serializing maps
in the protobuf wire format (as defined by the C++ implementation, with
MapEntry submessages in a repeated field). JSON map
serialization/parsing are not yet supported as these will require some
changes to upb as well.
2015-01-06 15:44:09 -08:00
Chris Fallin
91473dcebf Rename protobuf Ruby module to google/protobuf and rework its build
system. The Ruby module build now uses an amalgamated distribution of
upb, and successfully builds a Ruby gem called 'google-protobuf' with
module 'google/protobuf'.
2014-12-12 15:58:26 -08:00
Chris Fallin
973f425725 Provide a Ruby extension.
This adds a Ruby extension in ruby/ that is based on the 'upb' library
(now included as a submodule), and adds support for Ruby code generation
to the protoc compiler.
2014-12-09 16:55:59 -08:00