avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem van Bergen <wil...@vanbergen.org>
Subject Ruby gem fork - contribute back?
Date Wed, 25 Jun 2014 08:51:06 GMT

For a Ruby project, I am using AVRO schemas to validate Ruby objects. Because I ran into some
issues with the official avro gem, so I forked it: https://github.com/wvanbergen/tros. (The
name probably only makes sense to Dutch people :)

### Changes

- Fixed a round trip encoding issue for union(double, int) types. 
Integers were being encoded as floats, and read back as float. In Ruby versions 2.0 and later,
a float == bigint equality check will return false. This caused a test to fail.

- Fix UTF-8 support for Ruby 1.9+, and JRuby.
The original code was written for Ruby 1.8, and there's some big changes to how to properly
do this in Ruby 1.9+ and JRuby.

- Remove monkey patching of Enumerable
Monkey patching builtin objects is frowned upon, especially in libraries. Fixing it was easy:

- Dropped dependency of yajl-ruby and/or multi_json. 
The yajl-ruby dependency was causing compatibility issues with the rest of my application,
and there's no released version yet with working multi_json (1.7.6 cannot be installed because
multi_json is misspelled multi-json). Instead of fixing that, I decided to simply use Ruby's
built in support for JSON. For libraries, the less external dependencies the better.

I also did some heavy refactoring to make the Ruby codebase work outside of the context of
the greater Avro project, and applied some best practices of the Ruby ecosystem. Finally,
I set up CI (https://travis-ci.org/wvanbergen/tros) that checks the gem on multiple Ruby versions.

### Contributing back?

I would like to contribute back my changes if you are interested. However, maintaining Ruby
1.8 support will make this very hard. Ruby 1.8 doesn't come with built in JSON support, and
it's unicode handling is severely broken. It is also no longer maintained: https://www.ruby-lang.org/en/news/2013/12/17/maintenance-of-1-8-7-and-1-9-2/

Is it acceptable to drop support for Ruby 1.8? If so, I can work with you to get my changes
back into the main codebase.

Willem van Bergen
View raw message