You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by br...@apache.org on 2009/05/20 20:22:19 UTC

svn commit: r776800 - /incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc

Author: bryanduxbury
Date: Wed May 20 18:22:19 2009
New Revision: 776800

URL: http://svn.apache.org/viewvc?rev=776800&view=rev
Log:
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.


Modified:
    incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc?rev=776800&r1=776799&r2=776800&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc Wed May 20 18:22:19 2009
@@ -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()));