Ruby code gen fixes and some README improvements


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665053 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/README b/README
index 4475e63..647df05 100644
--- a/README
+++ b/README
@@ -4,6 +4,8 @@
 Marc Kwiatkowski (marc@facebook.com)
 Aditya Agarwal (aditya@facebook.com)
 
+Last Modified: 2007-Mar-06
+
 Thrift is distributed under the Thrift open source software license.
 Please see the included LICENSE file.
 
@@ -17,9 +19,12 @@
 language as its input and generates code across programming languages that
 uses the abstracted stack to build interoperable RPC clients and servers.
 
+Thrift is specifically designed to support non-atomic version changes
+across client and server code.
+
 For more details on Thrift's design and implementation, take a gander at
 the Thrift whitepaper included in this distribution or at the README files
-in a particular subdirectory of interest.
+in your particular subdirectory of interest.
 
 Heirarchy
 =========
@@ -37,13 +42,17 @@
     java/
     php/
     py/
-    ruby/
+    rb/
 
   test/
 
     Contains sample Thrift files and test code across the target programming
     languages.
 
+  tutorial/
+
+    Contains a basic tutorial that will teach you how to develop software
+    using Thrift.
 
 Requirements
 ============
@@ -97,7 +106,7 @@
 
 Run ./configure --help to see other configuration options
 
-Make thrift 
+Make thrift:
 
 	make
 
@@ -105,6 +114,9 @@
 
 	make install
 
-Note that some language packages must be installed manually (i.e. Java, Ruby).
+Note that some language packages must be installed manually using build tools
+better suited to those languages (at the time of this writing, this applies
+to Java, Ruby, PHP).
+
 Look for the README file in the lib/<language>/ folder for more details on the
 installation of each language library package.
diff --git a/compiler/cpp/README b/compiler/cpp/README
new file mode 100644
index 0000000..a2efb4f
--- /dev/null
+++ b/compiler/cpp/README
@@ -0,0 +1,25 @@
+Thrift Code Compiler
+
+Author: Mark Slee (mcslee@facebook.com)
+Last Modified: 2007-Mar-06
+
+Thrift is distributed under the Thrift open source software license.
+Please see the included LICENSE file.
+
+Thrift Code Compiler
+====================
+
+This compiler takes thrift files as input and generates output code across
+various programming languages. To build and install it, do this:
+
+  ./bootstrap.sh
+  ./configure
+  make
+  sudo make install
+
+It requires some form of LEX and YACC to be installed, which should be
+picked up by autoconf.
+
+Not much else to report here. You'll have to look at the code to get your
+questions answered. Or just run the executable after you build and take
+a look at the usage message.
diff --git a/compiler/cpp/cleanup.sh b/compiler/cpp/cleanup.sh
index 7415fd8..7dea388 100755
--- a/compiler/cpp/cleanup.sh
+++ b/compiler/cpp/cleanup.sh
@@ -8,7 +8,6 @@
 Makefile.in \
 Makefile.orig \
 NEWS \
-README \
 aclocal.m4 \
 autom4te.cache \
 autoscan.log \
diff --git a/compiler/cpp/src/generate/t_rb_generator.cc b/compiler/cpp/src/generate/t_rb_generator.cc
index 7433104..7672030 100644
--- a/compiler/cpp/src/generate/t_rb_generator.cc
+++ b/compiler/cpp/src/generate/t_rb_generator.cc
@@ -576,7 +576,7 @@
 
   if (tservice->get_extends() != NULL) {
     string extends = type_name(tservice->get_extends());
-    indent(f_service_) << "include " << extends  << ".Iface" << endl;
+    indent(f_service_) << "include " << extends  << "::Iface" << endl;
   }
 
   vector<t_function*> functions = tservice->get_functions();
@@ -600,7 +600,7 @@
   string extends_client = "";
   if (tservice->get_extends() != NULL) {
     extends = type_name(tservice->get_extends());
-    extends_client = " < " + extends + ".Client, ";
+    extends_client = " < " + extends + "::Client ";
   }
 
   indent(f_service_) <<
@@ -620,6 +620,9 @@
       indent() << "    @oprot = oprot" << endl <<
       indent() << "  end" << endl <<
       indent() << "  @seqid = 0" << endl;
+  } else {
+    f_service_ <<
+      indent() << "  super(iprot, oprot)" << endl;
   }
   indent(f_service_) << "end" << endl << endl;
 
@@ -763,7 +766,7 @@
   string extends_processor = "";
   if (tservice->get_extends() != NULL) {
     extends = type_name(tservice->get_extends());
-    extends_processor = " < " + extends + ".Processor, ";
+    extends_processor = " < " + extends + "::Processor ";
   }
 
   // Generate the header portion
@@ -783,6 +786,9 @@
     f_service_ <<
       indent() << "@handler = handler" << endl <<
       indent() << "@processMap = {}" << endl;
+  } else {
+    f_service_ <<
+      indent() << "super(handler)" << endl;
   }
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     f_service_ <<
@@ -998,7 +1004,7 @@
                                                   t_struct* tstruct,
                                                   string prefix) {
   out <<
-    indent() << prefix << " = " << type_name(tstruct) << "()" << endl <<
+    indent() << prefix << " = " << type_name(tstruct) << ".new()" << endl <<
     indent() << prefix << ".read(iprot)" << endl;
 }
 
diff --git a/compiler/cpp/src/main.cc b/compiler/cpp/src/main.cc
index 621116d..eb48cd0 100644
--- a/compiler/cpp/src/main.cc
+++ b/compiler/cpp/src/main.cc
@@ -291,8 +291,8 @@
   fprintf(stderr, "  -py         Generate Python output files\n");
   fprintf(stderr, "  -rb         Generate Ruby output files\n");
   fprintf(stderr, "  -xsd        Generate XSD output files\n");
-  fprintf(stderr, "  -I dir       Add a directory to the list of directories \n");
-  fprintf(stderr, "               searched for include directives\n");
+  fprintf(stderr, "  -I dir      Add a directory to the list of directories \n");
+  fprintf(stderr, "                searched for include directives\n");
   fprintf(stderr, "  -nowarn     Suppress all compiler warnings (BAD!)\n");
   fprintf(stderr, "  -strict     Strict compiler warnings on\n");
   fprintf(stderr, "  -v[erbose]  Verbose mode\n");