You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by kc...@apache.org on 2008/06/18 02:55:30 UTC

svn commit: r668908 - in /incubator/thrift/trunk/lib/rb/lib: thrift.rb thrift/protocol/tbinaryprotocol.rb

Author: kclark
Date: Tue Jun 17 17:55:29 2008
New Revision: 668908

URL: http://svn.apache.org/viewvc?rev=668908&view=rev
Log:
Add in hook to only provide the deprecated API when the client doesn't require 'thrift' directly

Modified:
    incubator/thrift/trunk/lib/rb/lib/thrift.rb
    incubator/thrift/trunk/lib/rb/lib/thrift/protocol/tbinaryprotocol.rb

Modified: incubator/thrift/trunk/lib/rb/lib/thrift.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/lib/thrift.rb?rev=668908&r1=668907&r2=668908&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/lib/thrift.rb (original)
+++ incubator/thrift/trunk/lib/rb/lib/thrift.rb Tue Jun 17 17:55:29 2008
@@ -10,32 +10,18 @@
 
 $:.unshift File.dirname(__FILE__)
 
-require 'thrift/exceptions'
-TException = Thrift::Exception
-TApplicationException = Thrift::ApplicationException
+module Thrift
+  # prevent the deprecation layer from being loaded if you require 'thrift'
+  DEPRECATION = false unless const_defined? :DEPRECATION
+end
 
+require 'thrift/deprecation'
+require 'thrift/exceptions'
 require 'thrift/types'
-TType = Thrift::Types
-TMessageType = Thrift::MessageTypes
-
 require 'thrift/processor'
-TProcessor = Thrift::Processor
-
 require 'thrift/client'
-ThriftClient = Thrift::Client
-
 require 'thrift/struct'
-ThriftStruct = Thrift::Struct
-
 require 'thrift/protocol/tprotocol'
-TProtocol = Thrift::Protocol
-TProtocolException = Thrift::ProtocolException
-
 require 'thrift/transport/tsocket'
 require 'thrift/transport/ttransport'
-
 require 'thrift/server/tserver'
-
-
-
-

Modified: incubator/thrift/trunk/lib/rb/lib/thrift/protocol/tbinaryprotocol.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/lib/thrift/protocol/tbinaryprotocol.rb?rev=668908&r1=668907&r2=668908&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/lib/thrift/protocol/tbinaryprotocol.rb (original)
+++ incubator/thrift/trunk/lib/rb/lib/thrift/protocol/tbinaryprotocol.rb Tue Jun 17 17:55:29 2008
@@ -183,7 +183,9 @@
   end
 end
 
-TBinaryProtocol = Thrift::BinaryProtocol
+if Thrift::DEPRECATION
+  TBinaryProtocol = Thrift::BinaryProtocol
+end
 
 class TBinaryProtocolFactory < TProtocolFactory
   def getProtocol(trans)