Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
9fe51788
Commit
9fe51788
authored
10 years ago
by
Tim Emiola
Browse files
Options
Downloads
Patches
Plain Diff
Removes google3 specifics from the README.md, aligns the description with an open source release
parent
eaed637d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ruby/README.md
+41
-42
41 additions, 42 deletions
src/ruby/README.md
with
41 additions
and
42 deletions
src/ruby/README.md
+
41
−
42
View file @
9fe51788
Ruby for GRPC
=========
====
gRPC Ruby
=========
LAYOUT
------
A Ruby implementation of gRPC, Google's RPC library.
Directory structure is the recommended layout for
[
ruby extensions
](
http://guides.rubygems.org/gems-with-extensions/
)
*
ext: the extension code
*
lib: the entrypoint grpc ruby library to be used in a 'require' statement
*
test: tests
INSTALLATION PREREQUISITES
--------------------------
This requires Ruby 2.x, as the rpc api surface uses keyword args.
DEPENDENCIES
------------
INSTALLING
----------
*
Extension
-
Install the gRPC core library
TODO: describe this, once the core distribution mechanism is defined.
The extension can be built and tested using
[
rake
](
https://rubygems.org/gems/rake
)
. However, the rake-extensiontask rule
is not supported on older versions of rubygems, and the necessary version of
rubygems.
$ gem install grpc
This is resolved by using
[
RVM
](
https://rvm.io/
)
instead; install a single-user
ruby environment, and develop on the latest stable version of ruby (2.1.5).
Installing from source
----------------------
INSTALLATION PREREQUISITES
--------------------------
I
nstall
RVM
-
Build or Install the gRPC core
E.g, from the root of the grpc
[
git repo
](
https://github.com/google/grpc
)
$ cd ../..
$ make && sudo make i
nstall
-
Install Ruby 2.x. Consider doing this with
[
RVM
](
http://rvm.io
)
, it's a nice way of controlling
the exact ruby version that's used.
$ command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
$
\c
url -sSL https://get.rvm.io | bash -s stable --ruby
$
$ # follow the instructions to ensure that your're using the latest stable version of Ruby
$ # and that the rvm command is installed
$
$ gem install bundler # install bundler, the standard ruby package manager
HACKING
-------
-
Install
[
bundler
](
http://bundler.io/
)
$ gem install bundler
The extension can be built and tested using the Rakefile.
-
Finally, install grpc ruby locally.
$ cd
<install_dir>
$ bundle install
$ rake # compiles the extension, runs the unit tests, see rake -T for other options
$ # create a workspace
$ git5 start
<your-git5-branch>
net/grpc
$
$ # build the C library and install it in $HOME/grpc_dev
$
<google3>
/net/grpc/c/build_gyp/build_grpc_dev.sh
$
$ # build the ruby extension and test it.
$ cd google3_dir/net/grpc/ruby
$ rake
Finally, install grpc ruby locally.
CONTENTS
--------
$ cd
<this_dir>
$
$ # update the Gemfile, modify the line beginning # gem 'beefcake' to refer to
$ # the patched beefcake dir
$
$ bundle install
Directory structure is the layout for
[
ruby extensions
](
http://guides.rubygems.org/gems-with-extensions/
)
*
ext: the extension code
*
lib: the entrypoint grpc ruby library to be used in a 'require' statement
*
spec: tests
*
bin: example gRPC clients and servers, e.g,
```
ruby
# client
stub
=
Math
::
Math
::
Stub
.
new
(
'my.test.math.server.com:8080'
)
req
=
Math
::
DivArgs
.
new
(
dividend:
7
,
divisor:
3
)
logger
.
info
(
"div(7/3): req=
#{
req
.
inspect
}
"
)
resp
=
stub
.
div
(
req
,
INFINITE_FUTURE
)
logger
.
info
(
"Answer:
#{
resp
.
inspect
}
"
)
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment