From: Christopher Piro Date: Thu, 4 Oct 2007 01:54:11 +0000 (+0000) Subject: [thrift] don't scope non-service types in Ruby X-Git-Tag: 0.2.0~1181 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=e4e1968935f0dce5720f82baef19605f64512120;p=common%2Fthrift.git [thrift] don't scope non-service types in Ruby Summary: non-service types live in the top-level namespace, so look for them there. example from FacebookService.rb (accessing Service from reflection_limited_types.rb): FIELDS = { - 0 => {:type => TType::STRUCT, :name => 'success', :class => reflection_limited_types.Service} + 0 => {:type => TType::STRUCT, :name => 'success', :class => Service} } preferable to adding a "module honk_types ... end" around honk_types.rb ... non-service types should land in top-level space (or whatever ruby_namespace has been defined). if ruby_namespace even works ... who knows Reviewed By: mcslee Test Plan: now reflection_limited works with my simple Ruby client honestly, there's no test suite for these? TODO:cpiro Revert: OK TracCamp Project: Thrift DiffCamp Revision: 735 git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665291 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 edfad0fb..9e3cd3c7 100644 --- a/compiler/cpp/src/generate/t_rb_generator.cc +++ b/compiler/cpp/src/generate/t_rb_generator.cc @@ -762,12 +762,6 @@ string t_rb_generator::argument_list(t_struct* tstruct) { string t_rb_generator::type_name(t_type* ttype) { string prefix = ""; - t_program* program = ttype->get_program(); - if (program != NULL && program != program_) { - if (!ttype->is_service()) { - prefix = program->get_name() + "_types."; - } - } string name = ttype->get_name(); if (ttype->is_struct() || ttype->is_xception()) {