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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.