aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ruby/Gemfile.lock4
-rw-r--r--ruby/Rakefile5
-rw-r--r--ruby/lib/google/protobuf.rb6
3 files changed, 12 insertions, 3 deletions
diff --git a/ruby/Gemfile.lock b/ruby/Gemfile.lock
index 8599da75..2c030dd2 100644
--- a/ruby/Gemfile.lock
+++ b/ruby/Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- google-protobuf (3.0.0.alpha.4.0)
+ google-protobuf (3.0.0.alpha.5.0)
GEM
remote: https://rubygems.org/
@@ -25,4 +25,4 @@ DEPENDENCIES
test-unit
BUNDLED WITH
- 1.10.6
+ 1.11.2
diff --git a/ruby/Rakefile b/ruby/Rakefile
index c25103d8..44497dea 100644
--- a/ruby/Rakefile
+++ b/ruby/Rakefile
@@ -21,6 +21,11 @@ else
ext.ext_dir = "ext/google/protobuf_c"
ext.lib_dir = "lib/google"
end
+
+ task 'gem:windows' do
+ require 'rake_compiler_dock'
+ RakeCompilerDock.sh "bundle && rake cross native gem"
+ end
end
Gem::PackageTask.new(spec) do |pkg|
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'