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 ...

Get Learning Apache Thrift now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.