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/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");