O'Reilly logo

Learning Apache Thrift by Krzysztof Rakowski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Ruby

Ruby is another very popular programming language used not only for web applications (that is, in the Ruby on Rails framework), but also for general scripting.

Generating the code

Apache Thrift's compiler has a limited number of special options for Ruby; there are only two. Run the following command to see them:

$ thrift --help 

Look for the information about Ruby generators:

  rb (Ruby):
    rubygems:        Add a "require 'rubygems'" line to the top of each generated file.
    namespaced:      Generate files in idiomatic namespaced directories.

Let's explain both of them:

  • rubygems: As the description states, it just adds the require 'rubygems' line on top of each file that is generated by the compiler.
  • namespaced: The files that are generated are put in the directories ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required