From f9e3c23fe8d54d1587afe163d38214c94907a336 Mon Sep 17 00:00:00 2001
From: "Nicolas \"Pixel\" Noble" <pixel@nobis-crew.org>
Date: Tue, 9 Feb 2016 03:33:40 +0100
Subject: [PATCH] Fixing ruby versionning.

---
 grpc.gemspec                                    | 2 +-
 src/ruby/lib/grpc/version.rb                    | 2 +-
 templates/grpc.gemspec.template                 | 2 +-
 templates/src/ruby/lib/grpc/version.rb.template | 2 +-
 tools/buildgen/plugins/expand_version.py        | 4 ++++
 5 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/grpc.gemspec b/grpc.gemspec
index e990948edf..fb4361b2f9 100755
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
   s.require_paths = %w( src/ruby/bin src/ruby/lib src/ruby/pb )
   s.platform      = Gem::Platform::RUBY
 
-  s.add_dependency 'google-protobuf', '~> 3.0.0alpha.1.1'
+  s.add_dependency 'google-protobuf', '~> 3.0.0.alpha.5.0'
   s.add_dependency 'googleauth',      '~> 0.5.1'
 
   s.add_development_dependency 'bundler',            '~> 1.9'
diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb
index e98073c057..d7aa18be3e 100644
--- a/src/ruby/lib/grpc/version.rb
+++ b/src/ruby/lib/grpc/version.rb
@@ -29,5 +29,5 @@
 
 # GRPC contains the General RPC module.
 module GRPC
-  VERSION = '0.13.0-pre1'
+  VERSION = '0.13.0.pre1'
 end
diff --git a/templates/grpc.gemspec.template b/templates/grpc.gemspec.template
index c4987a6725..20408613a8 100644
--- a/templates/grpc.gemspec.template
+++ b/templates/grpc.gemspec.template
@@ -33,7 +33,7 @@
     s.require_paths = %w( src/ruby/bin src/ruby/lib src/ruby/pb )
     s.platform      = Gem::Platform::RUBY
 
-    s.add_dependency 'google-protobuf', '~> 3.0.0alpha.1.1'
+    s.add_dependency 'google-protobuf', '~> 3.0.0.alpha.5.0'
     s.add_dependency 'googleauth',      '~> 0.5.1'
 
     s.add_development_dependency 'bundler',            '~> 1.9'
diff --git a/templates/src/ruby/lib/grpc/version.rb.template b/templates/src/ruby/lib/grpc/version.rb.template
index a47d2d8548..6488614aed 100644
--- a/templates/src/ruby/lib/grpc/version.rb.template
+++ b/templates/src/ruby/lib/grpc/version.rb.template
@@ -31,5 +31,5 @@
 
   # GRPC contains the General RPC module.
   module GRPC
-    VERSION = '${settings.ruby_version}'
+    VERSION = '${settings.ruby_version.ruby()}'
   end
diff --git a/tools/buildgen/plugins/expand_version.py b/tools/buildgen/plugins/expand_version.py
index 4600c3224e..a103618c01 100755
--- a/tools/buildgen/plugins/expand_version.py
+++ b/tools/buildgen/plugins/expand_version.py
@@ -76,6 +76,10 @@ class Version:
         raise Exception('Don\'t know how to translate version tag "%s" to pep440' % self.tag)
     return s
 
+  def ruby(self):
+    """Version string in Ruby style"""
+    return '%d.%d.%d.%s' % (self.major, self.minor, self.patch, self.tag)
+
 def mako_plugin(dictionary):
   """Expand version numbers:
      - for each language, ensure there's a language_version tag in
-- 
GitLab