thrift/lib/rb
David Reiss 68ccc699a3 Move Ruby fielded object creation from generated constructor to ThriftStruct
Rather than the generated code needing to handle simple fielded
creation of objects, the ThriftStruct module constructor is extended to
handle hash arguments. Statements such as

  o = ThriftObject.new :field1 => value1, :field2 => value2, ...

are supported as before, and the string form,

  o = ThriftObject.new "field1" => value1, "field2" => value2, ...

disabled by the previous patch now also works.

Placing this code in the module is also just a cleaner solution.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665502 13f79535-47bb-0310-9956-ffa450edef68
2008-02-26 06:40:22 +00:00
..
lib/thrift Move Ruby fielded object creation from generated constructor to ThriftStruct 2008-02-26 06:40:22 +00:00
COPYING Thrift: Whitespace cleanup. 2008-02-06 22:18:40 +00:00
LICENSE Thrift: Whitespace cleanup. 2008-02-06 22:18:40 +00:00
README READMEs and DOCs and ant tasks, oh my 2007-03-06 00:06:27 +00:00
setup.rb Thrift: Whitespace cleanup. 2008-02-06 22:18:40 +00:00

Thrift Ruby Software Library

Author: Mark Slee (mcslee@facebook.com)
Last Modified: 2007-Mar-05

Thrift is distributed under the Thrift open source software license.
Please see the included LICENSE file.

Using Thrift with Ruby
======================

Okay, I'll be honest. I learned Ruby by implementing the Thrift library in
Ruby and writing the code generator at the same time. I am not a trendy
web 2.0 programmer. Shit, I don't even know Rails. So if you care about Ruby
you will probably find that this is currently the least robust Thrift library
implementation. But there's plenty of time to improve it...

The source code for the Ruby library is designed for installation with the
Python-esque setup.rb utility, which is included here and redistributable
under the GPL license.

To install the Thrift Ruby libraries, become superuser and do:

ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

Alternatively, if you know more about Ruby than me, you can improve the build
and installation process and contribute them back to this project. Wicked.