aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/bin/math_server.rb
diff options
context:
space:
mode:
Diffstat (limited to 'src/ruby/bin/math_server.rb')
-rwxr-xr-xsrc/ruby/bin/math_server.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/ruby/bin/math_server.rb b/src/ruby/bin/math_server.rb
index b41ccf6ce1..562f197317 100755
--- a/src/ruby/bin/math_server.rb
+++ b/src/ruby/bin/math_server.rb
@@ -41,9 +41,25 @@ $LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir)
require 'forwardable'
require 'grpc'
+require 'logger'
require 'math_services'
require 'optparse'
+# RubyLogger defines a logger for gRPC based on the standard ruby logger.
+module RubyLogger
+ def logger
+ LOGGER
+ end
+
+ LOGGER = Logger.new(STDOUT)
+end
+
+# GRPC is the general RPC module
+module GRPC
+ # Inject the noop #logger if no module-level logger method has been injected.
+ extend RubyLogger
+end
+
# Holds state for a fibonacci series
class Fibber
def initialize(limit)
@@ -155,7 +171,8 @@ end
def test_server_creds
certs = load_test_certs
- GRPC::Core::ServerCredentials.new(nil, certs[1], certs[2])
+ GRPC::Core::ServerCredentials.new(
+ nil, [{ private_key: certs[1], cert_chain: certs[2] }], false)
end
def main