From af4aa9bd64229d726d62a532f5f31a415ff74725 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Thu, 4 Feb 2016 10:44:22 -0800 Subject: Added support for binary gems. --- ruby/lib/google/protobuf.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ruby/lib') diff --git a/ruby/lib/google/protobuf.rb b/ruby/lib/google/protobuf.rb index f0eb6268..62bdd1bf 100644 --- a/ruby/lib/google/protobuf.rb +++ b/ruby/lib/google/protobuf.rb @@ -44,7 +44,11 @@ if RUBY_PLATFORM == "java" require 'json' require 'google/protobuf_java' else - require 'google/protobuf_c' + begin + require "google/#{RUBY_VERSION.sub(/\.\d$/, '')}/protobuf_c" + rescue LoadError + require 'google/protobuf_c' + end end require 'google/protobuf/repeated_field' -- cgit v1.2.3