THRIFT-501. rb: File.dirname(...) requires cause warnings in some scenarios

This patch removes the File.dirname usage. Instead, you should put the directory that contains your _types.rb into the load path.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@776800 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/generate/t_rb_generator.cc b/compiler/cpp/src/generate/t_rb_generator.cc
index f654424..6cbfeaf 100644
--- a/compiler/cpp/src/generate/t_rb_generator.cc
+++ b/compiler/cpp/src/generate/t_rb_generator.cc
@@ -218,7 +218,7 @@
 
   f_consts_ <<
     rb_autogen_comment() << endl <<
-    "require File.dirname(__FILE__) + '/" << underscore(program_name_) << "_types'" << endl <<
+    "require '" << underscore(program_name_) << "_types'" << endl <<
     endl;
     begin_namespace(f_consts_, ruby_modules(program_));
 
@@ -412,7 +412,7 @@
       etype = ((t_set*)type)->get_elem_type();
     }
     if (type->is_set()) {
-      out << "Set.new([";
+      out << "Set.new([" << endl;
     } else {
       out << "[" << endl;
     }
@@ -635,7 +635,7 @@
   }
 
   f_service_ <<
-    "require File.dirname(__FILE__) + '/" << underscore(program_name_) << "_types'" << endl <<
+    "require '" << underscore(program_name_) << "_types'" << endl <<
     endl;
 
   begin_namespace(f_service_, ruby_modules(tservice->get_program()));