From c42231b6fa56318fa6d9dd43a7f717e095e331c0 Mon Sep 17 00:00:00 2001 From: Kevin Clark Date: Wed, 18 Jun 2008 00:56:30 +0000 Subject: [PATCH] Set up the class deprecations git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668911 13f79535-47bb-0310-9956-ffa450edef68 --- lib/rb/lib/thrift/client.rb | 1 + lib/rb/lib/thrift/deprecation.rb | 11 ----------- lib/rb/lib/thrift/exceptions.rb | 2 ++ lib/rb/lib/thrift/processor.rb | 1 + lib/rb/lib/thrift/protocol/tbinaryprotocol.rb | 5 +---- lib/rb/lib/thrift/protocol/tprotocol.rb | 2 ++ lib/rb/lib/thrift/struct.rb | 1 + lib/rb/lib/thrift/types.rb | 2 ++ 8 files changed, 10 insertions(+), 15 deletions(-) diff --git a/lib/rb/lib/thrift/client.rb b/lib/rb/lib/thrift/client.rb index 7f1297c1..55e72b3d 100644 --- a/lib/rb/lib/thrift/client.rb +++ b/lib/rb/lib/thrift/client.rb @@ -35,4 +35,5 @@ module Thrift end end end + deprecate_class! :ThriftClient => Client end diff --git a/lib/rb/lib/thrift/deprecation.rb b/lib/rb/lib/thrift/deprecation.rb index f7221b44..49324c8c 100644 --- a/lib/rb/lib/thrift/deprecation.rb +++ b/lib/rb/lib/thrift/deprecation.rb @@ -42,14 +42,3 @@ module Kernel end end end - -# TProtocol = Thrift::Protocol -# TProtocolException = Thrift::ProtocolException -# ThriftStruct = Thrift::Struct -# ThriftClient = Thrift::Client -# TProcessor = Thrift::Processor -# TType = Thrift::Types -# TMessageType = Thrift::MessageTypes -# TException = Thrift::Exception -# TApplicationException = Thrift::ApplicationException -# TBinaryProtocol = Thrift::BinaryProtocol diff --git a/lib/rb/lib/thrift/exceptions.rb b/lib/rb/lib/thrift/exceptions.rb index 972d5710..efaa805a 100644 --- a/lib/rb/lib/thrift/exceptions.rb +++ b/lib/rb/lib/thrift/exceptions.rb @@ -7,6 +7,7 @@ module Thrift attr_reader :message end + deprecate_class! :TException => Exception class ApplicationException < Exception @@ -68,4 +69,5 @@ module Thrift end end + deprecate_class! :TApplicationException => ApplicationException end \ No newline at end of file diff --git a/lib/rb/lib/thrift/processor.rb b/lib/rb/lib/thrift/processor.rb index 5ec881f5..d9d5a095 100644 --- a/lib/rb/lib/thrift/processor.rb +++ b/lib/rb/lib/thrift/processor.rb @@ -35,4 +35,5 @@ module Thrift oprot.trans.flush() end end + deprecate_class! :TProcessor => Processor end diff --git a/lib/rb/lib/thrift/protocol/tbinaryprotocol.rb b/lib/rb/lib/thrift/protocol/tbinaryprotocol.rb index a0618b60..adfeb812 100644 --- a/lib/rb/lib/thrift/protocol/tbinaryprotocol.rb +++ b/lib/rb/lib/thrift/protocol/tbinaryprotocol.rb @@ -181,10 +181,7 @@ module Thrift end end -end - -if Thrift::DEPRECATION - TBinaryProtocol = Thrift::BinaryProtocol + deprecate_class! :TBinaryProtocol => BinaryProtocol end class TBinaryProtocolFactory < TProtocolFactory diff --git a/lib/rb/lib/thrift/protocol/tprotocol.rb b/lib/rb/lib/thrift/protocol/tprotocol.rb index 5d4e6368..905b754c 100644 --- a/lib/rb/lib/thrift/protocol/tprotocol.rb +++ b/lib/rb/lib/thrift/protocol/tprotocol.rb @@ -26,6 +26,7 @@ module Thrift end end + deprecate_class! :TProtocolException => ProtocolException class Protocol @@ -215,6 +216,7 @@ module Thrift end end + deprecate_class! :TProtocol => Protocol end class TProtocolFactory diff --git a/lib/rb/lib/thrift/struct.rb b/lib/rb/lib/thrift/struct.rb index 35b34154..f1907a3a 100644 --- a/lib/rb/lib/thrift/struct.rb +++ b/lib/rb/lib/thrift/struct.rb @@ -134,4 +134,5 @@ module Thrift :element => field[:element] } end end + deprecate_class! :ThriftStruct => Struct end diff --git a/lib/rb/lib/thrift/types.rb b/lib/rb/lib/thrift/types.rb index 2ff893f9..b1fbb87c 100644 --- a/lib/rb/lib/thrift/types.rb +++ b/lib/rb/lib/thrift/types.rb @@ -14,10 +14,12 @@ module Thrift SET = 14 LIST = 15 end + deprecate_class! :TType => Types module MessageTypes CALL = 1 REPLY = 2 EXCEPTION = 3 end + deprecate_class! :TMessageType => MessageTypes end \ No newline at end of file -- 2.17.1