Merge pull request #8304 from apolcyn/fix_ruby_tools_32_bit_windows

make ruby tools use x86 directory names for sub-x86 cpu
v1.0.x
apolcyn 8 years ago committed by GitHub
commit 0dcd709c4a
  1. 4
      src/ruby/tools/bin/grpc_tools_ruby_protoc
  2. 4
      src/ruby/tools/bin/grpc_tools_ruby_protoc_plugin
  3. 2
      src/ruby/tools/grpc-tools.gemspec
  4. 29
      src/ruby/tools/platform_check.rb

@ -30,7 +30,7 @@
require 'rbconfig'
require_relative '../os_check'
require_relative '../platform_check'
ext = RbConfig::CONFIG['EXEEXT']
@ -39,7 +39,7 @@ protoc_name = 'protoc' + ext
plugin_name = 'grpc_ruby_plugin' + ext
protoc_dir = File.join(File.dirname(__FILE__),
RbConfig::CONFIG['host_cpu'] + '-' + OS.os_name)
PLATFORM.architecture + '-' + PLATFORM.os_name)
protoc_path = File.join(protoc_dir, protoc_name)

@ -30,12 +30,12 @@
require 'rbconfig'
require_relative '../os_check'
require_relative '../platform_check'
plugin_name = 'grpc_ruby_plugin' + RbConfig::CONFIG['EXEEXT']
plugin_path = File.join(File.dirname(__FILE__),
RbConfig::CONFIG['host_cpu'] + '-' + OS.os_name,
PLATFORM.architecture + '-' + PLATFORM.os_name,
plugin_name)
exec([ plugin_path, plugin_path ], *ARGV)

@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.description = 'protoc and the Ruby gRPC protoc plugin'
s.license = 'BSD-3-Clause'
s.files = %w( version.rb os_check.rb README.md )
s.files = %w( version.rb platform_check.rb README.md )
s.files += Dir.glob('bin/**/*')
s.bindir = 'bin'

@ -27,19 +27,28 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# This is based on http://stackoverflow.com/a/171011/159388 by Aaron Hinni
require 'rbconfig'
module OS
def OS.os_name
# This is based on http://stackoverflow.com/a/171011/159388 by Aaron Hinni
module PLATFORM
def PLATFORM.os_name
case RbConfig::CONFIG['host_os']
when /cygwin|mswin|mingw|bccwin|wince|emx/
'windows'
when /darwin/
'macos'
else
'linux'
when /cygwin|mswin|mingw|bccwin|wince|emx/
'windows'
when /darwin/
'macos'
else
'linux'
end
end
def PLATFORM.architecture
case RbConfig::CONFIG['host_cpu']
when /x86_64/
'x86_64'
else
'x86'
end
end
end
Loading…
Cancel
Save