Skip to content
Snippets Groups Projects
Select Git revision
  • 5a2c91806f49cc10362284c8f0d86771791a9692
  • master default protected
  • arm-aarch-platform
  • arm-platform
  • vjpai-patch-3
  • vjpai-patch-1
  • v1.27.x
  • jtattermusch-patch-2
  • jtattermusch-patch-1
  • update-java-worker-example-in-performance-docs
  • revert-21805-revert-21797-reintroduce_21527
  • revert-21804-tls-credentials-1
  • zhen_cleanup_namecheck
  • revert-21806-revert-21767-revert-21725-revert-21680-cq_ordering
  • vjpai-patch-2
  • revert-21766-tls-credentials-1
  • revert-21640-change_local_tcp_security_level
  • revert-21680-cq_ordering
  • revert-21527-unify_boringssl_deps2
  • revert-20803-grpclb_stabilization
  • fix-kokoro-rvm-key
  • v1.27.0
  • v1.27.0-pre2
  • v1.27.0-pre1
  • v1.26.0
  • v1.26.0-pre1
  • v1.25.0
  • v1.25.0-pre1
  • v1.24.3
  • v1.24.2
  • v1.24.1
  • v1.23.1
  • v1.24.0
  • v1.24.0-pre2
  • v1.24.0-pre1
  • v1.22.1
  • v1.23.0
  • v1.23.0-pre1
  • v1.22.0
  • v1.22.0-pre1
  • v1.21.4
41 results

ruby

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Ken Payson authored
    5a2c9180
    History

    Gem gRPC Ruby

    A Ruby implementation of gRPC.

    Status

    Beta

    PREREQUISITES

    • Ruby 2.x. The gRPC API uses keyword args.

    INSTALLATION

    Linux and Mac OS X:

    gem install grpc

    BUILD FROM SOURCE

    • Clone this repository

    • Install Ruby 2.x. Consider doing this with RVM, it's a nice way of controlling the exact ruby version that's used.

    $ command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
    $ \curl -sSL https://get.rvm.io | bash -s stable --ruby=ruby-2
    $
    $ # follow the instructions to ensure that your're using the latest stable version of Ruby
    $ # and that the rvm command is installed
    • Make sure your run source $HOME/.rvm/scripts/rvm as instructed to complete the set up of RVM

    • Install bundler

    $ gem install bundler
    • Finally, build and install the gRPC gem locally.
    $ # from this directory
    $ bundle install  # creates the ruby bundle, including building the grpc extension
    $ rake  # runs the unit tests, see rake -T for other options

    DOCUMENTATION

    • rubydoc for the gRPC gem is available online at rubydoc.
    • the gRPC Ruby reference documentation is available online at grpc.io

    CONTENTS

    Directory structure is the layout for ruby extensions

    • ext: the gRPC ruby extension

    • lib: the entrypoint gRPC ruby library to be used in a 'require' statement

    • spec: Rspec unittests

    • bin: example gRPC clients and servers, e.g,

      stub = Math::Math::Stub.new('my.test.math.server.com:8080')
      req = Math::DivArgs.new(dividend: 7, divisor: 3)
      GRPC.logger.info("div(7/3): req=#{req.inspect}")
      resp = stub.div(req)
      GRPC.logger.info("Answer: #{resp.inspect}")