diff options
Diffstat (limited to 'ruby')
-rw-r--r-- | ruby/Gemfile.lock | 6 | ||||
-rw-r--r-- | ruby/Rakefile | 11 | ||||
-rw-r--r-- | ruby/google-protobuf.gemspec | 13 | ||||
-rw-r--r-- | ruby/lib/google/protobuf.rb | 6 | ||||
-rwxr-xr-x | ruby/travis-test.sh | 5 |
5 files changed, 29 insertions, 12 deletions
diff --git a/ruby/Gemfile.lock b/ruby/Gemfile.lock index 8599da75..27e57506 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/ @@ -10,6 +10,7 @@ GEM rake (10.4.2) rake-compiler (0.9.5) rake + rake-compiler-dock (0.5.1) rubygems-tasks (0.2.4) test-unit (3.0.9) power_assert @@ -21,8 +22,9 @@ PLATFORMS DEPENDENCIES google-protobuf! rake-compiler + rake-compiler-dock rubygems-tasks test-unit BUNDLED WITH - 1.10.6 + 1.11.2 diff --git a/ruby/Rakefile b/ruby/Rakefile index c25103d8..81c3119e 100644 --- a/ruby/Rakefile +++ b/ruby/Rakefile @@ -20,6 +20,17 @@ else Rake::ExtensionTask.new("protobuf_c", spec) do |ext| ext.ext_dir = "ext/google/protobuf_c" ext.lib_dir = "lib/google" + ext.cross_compile = true + ext.cross_platform = [ + 'x86-mingw32', 'x64-mingw32', + 'x86_64-linux', 'x86-linux', + 'universal-darwin' + ] + end + + task 'gem:windows' do + require 'rake_compiler_dock' + RakeCompilerDock.sh "bundle && rake cross native gem RUBY_CC_VERSION=2.3.0:2.2.2:2.1.6" end end diff --git a/ruby/google-protobuf.gemspec b/ruby/google-protobuf.gemspec index 3d53209d..7b64ee77 100644 --- a/ruby/google-protobuf.gemspec +++ b/ruby/google-protobuf.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "google-protobuf" - s.version = "3.0.0.alpha.4.0" + s.version = "3.0.0.alpha.5.0" s.licenses = ["BSD"] s.summary = "Protocol Buffers" s.description = "Protocol Buffers are Google's data interchange format." @@ -8,12 +8,13 @@ Gem::Specification.new do |s| s.authors = ["Protobuf Authors"] s.email = "protobuf@googlegroups.com" s.require_paths = ["lib"] - s.files = `git ls-files -z`.split("\x0").find_all{|f| f =~ /lib\/.+\.rb/} - unless RUBY_PLATFORM == "java" - s.files += `git ls-files "*.c" "*.h" extconf.rb Makefile`.split - s.extensions= ["ext/google/protobuf_c/extconf.rb"] - else + s.files = Dir.glob('lib/**/*.rb') + if RUBY_PLATFORM == "java" s.files += ["lib/google/protobuf_java.jar"] + else + s.files += Dir.glob('ext/**/*') + s.extensions= ["ext/google/protobuf_c/extconf.rb"] + s.add_development_dependency "rake-compiler-dock" end s.test_files = ["tests/basic.rb", "tests/stress.rb", 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' diff --git a/ruby/travis-test.sh b/ruby/travis-test.sh index 9ec7eb22..75db7d93 100755 --- a/ruby/travis-test.sh +++ b/ruby/travis-test.sh @@ -17,9 +17,8 @@ test_version() { "rvm install $version && rvm use $version && \ which ruby && \ gem install bundler && bundle && \ - rake test && \ - cd ../conformance && \ - make test_ruby" + rake test && + cd ../conformance && make test_ruby" fi } |