From 32194ab4425c5db1a6406427df0251ebd96186d6 Mon Sep 17 00:00:00 2001 From: Bryan Duxbury Date: Wed, 20 May 2009 18:22:19 +0000 Subject: [PATCH] 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 --- compiler/cpp/src/generate/t_rb_generator.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/cpp/src/generate/t_rb_generator.cc b/compiler/cpp/src/generate/t_rb_generator.cc index f654424b..6cbfeaf2 100644 --- a/compiler/cpp/src/generate/t_rb_generator.cc +++ b/compiler/cpp/src/generate/t_rb_generator.cc @@ -218,7 +218,7 @@ void t_rb_generator::init_generator() { 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 @@ string t_rb_generator::render_const_value(t_type* type, t_const_value* value) { 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 @@ void t_rb_generator::generate_service(t_service* tservice) { } 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())); -- 2.17.1