OLD | NEW |
(Empty) | |
| 1 [](https://rubygems.org/gems/grpc/) |
| 2 gRPC Ruby |
| 3 ========= |
| 4 |
| 5 A Ruby implementation of gRPC. |
| 6 |
| 7 Status |
| 8 ------ |
| 9 |
| 10 Beta |
| 11 |
| 12 PREREQUISITES |
| 13 ------------- |
| 14 |
| 15 - Ruby 2.x. The gRPC API uses keyword args. |
| 16 |
| 17 INSTALLATION |
| 18 --------------- |
| 19 |
| 20 **Linux and Mac OS X:** |
| 21 |
| 22 ```sh |
| 23 gem install grpc |
| 24 ``` |
| 25 |
| 26 BUILD FROM SOURCE |
| 27 --------------------- |
| 28 - Clone this repository |
| 29 |
| 30 - Install Ruby 2.x. Consider doing this with [RVM](http://rvm.io), it's a nice w
ay of controlling |
| 31 the exact ruby version that's used. |
| 32 ```sh |
| 33 $ command curl -sSL https://rvm.io/mpapis.asc | gpg --import - |
| 34 $ \curl -sSL https://get.rvm.io | bash -s stable --ruby=ruby-2 |
| 35 $ |
| 36 $ # follow the instructions to ensure that your're using the latest stable versi
on of Ruby |
| 37 $ # and that the rvm command is installed |
| 38 ``` |
| 39 - Make sure your run `source $HOME/.rvm/scripts/rvm` as instructed to complete t
he set up of RVM |
| 40 |
| 41 - Install [bundler](http://bundler.io/) |
| 42 ``` |
| 43 $ gem install bundler |
| 44 ``` |
| 45 |
| 46 - Finally, build and install the gRPC gem locally. |
| 47 ```sh |
| 48 $ # from this directory |
| 49 $ bundle install # creates the ruby bundle, including building the grpc extensi
on |
| 50 $ rake # runs the unit tests, see rake -T for other options |
| 51 ``` |
| 52 |
| 53 DOCUMENTATION |
| 54 ------------- |
| 55 - rubydoc for the gRPC gem is available online at [rubydoc][]. |
| 56 - the gRPC Ruby reference documentation is available online at [grpc.io][] |
| 57 |
| 58 CONTENTS |
| 59 -------- |
| 60 Directory structure is the layout for [ruby extensions][] |
| 61 - ext: the gRPC ruby extension |
| 62 - lib: the entrypoint gRPC ruby library to be used in a 'require' statement |
| 63 - spec: Rspec unittests |
| 64 - bin: example gRPC clients and servers, e.g, |
| 65 |
| 66 ```ruby |
| 67 stub = Math::Math::Stub.new('my.test.math.server.com:8080') |
| 68 req = Math::DivArgs.new(dividend: 7, divisor: 3) |
| 69 GRPC.logger.info("div(7/3): req=#{req.inspect}") |
| 70 resp = stub.div(req) |
| 71 GRPC.logger.info("Answer: #{resp.inspect}") |
| 72 ``` |
| 73 |
| 74 [ruby extensions]:http://guides.rubygems.org/gems-with-extensions/ |
| 75 [rubydoc]: http://www.rubydoc.info/gems/grpc |
| 76 [grpc.io]: http://www.grpc.io/docs/installation/ruby.html |
| 77 [Debian jessie-backports]:http://backports.debian.org/Instructions/ |
OLD | NEW |