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:59:17 UTC

svn commit: r668920 - in /incubator/thrift/trunk/lib/rb/lib/thrift: exceptions.rb processor.rb

Author: kclark
Date: Tue Jun 17 17:59:17 2008
New Revision: 668920

URL: http://svn.apache.org/viewvc?rev=668920&view=rev
Log:
Convert more CamelCase names to ruby_style

Modified:
    incubator/thrift/trunk/lib/rb/lib/thrift/exceptions.rb
    incubator/thrift/trunk/lib/rb/lib/thrift/processor.rb

Modified: incubator/thrift/trunk/lib/rb/lib/thrift/exceptions.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/lib/thrift/exceptions.rb?rev=668920&r1=668919&r2=668920&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/lib/thrift/exceptions.rb (original)
+++ incubator/thrift/trunk/lib/rb/lib/thrift/exceptions.rb Tue Jun 17 17:59:17 2008
@@ -26,46 +26,46 @@
     end
 
     def read(iprot)
-      iprot.readStructBegin()
+      iprot.read_struct_begin()
       while true
-        fname, ftype, fid = iprot.readFieldBegin()
+        fname, ftype, fid = iprot.read_field_begin()
         if (ftype === Types::STOP)
           break
         end
         if (fid == 1)
           if (ftype === Types::STRING)
-            @message = iprot.readString();
+            @message = iprot.read_string();
           else
             iprot.skip(ftype)
           end
         elsif (fid == 2)
           if (ftype === Types::I32)
-            @type = iprot.readI32();
+            @type = iprot.read_i32();
           else
             iprot.skip(ftype)
           end
         else
           iprot.skip(ftype)
         end
-        iprot.readFieldEnd()
+        iprot.read_field_end()
       end
-      iprot.readStructEnd()
+      iprot.read_struct_end()
     end
 
     def write(oprot)
-      oprot.writeStructBegin('Thrift::ApplicationException')
+      oprot.write_struct_begin('Thrift::ApplicationException')
       if (@message != nil)
-        oprot.writeFieldBegin('message', Types::STRING, 1)
-        oprot.writeString(@message)
-        oprot.writeFieldEnd()
+        oprot.write_field_begin('message', Types::STRING, 1)
+        oprot.write_string(@message)
+        oprot.write_field_end()
       end
       if (@type != nil)
-        oprot.writeFieldBegin('type', Types::I32, 2)
-        oprot.writeI32(@type)
-        oprot.writeFieldEnd()
+        oprot.write_field_begin('type', Types::I32, 2)
+        oprot.write_i32(@type)
+        oprot.write_field_end()
       end
-      oprot.writeFieldStop()
-      oprot.writeStructEnd()
+      oprot.write_field_stop()
+      oprot.write_struct_end()
     end
 
   end

Modified: incubator/thrift/trunk/lib/rb/lib/thrift/processor.rb
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/lib/thrift/processor.rb?rev=668920&r1=668919&r2=668920&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/lib/thrift/processor.rb (original)
+++ incubator/thrift/trunk/lib/rb/lib/thrift/processor.rb Tue Jun 17 17:59:17 2008
@@ -5,17 +5,17 @@
     end
 
     def process(iprot, oprot)
-      name, type, seqid  = iprot.readMessageBegin()
+      name, type, seqid  = iprot.read_message_begin()
       if respond_to?("process_#{name}")
         send("process_#{name}", seqid, iprot, oprot)
         return true
       else
         iprot.skip(Types::STRUCT)
-        iprot.readMessageEnd()
+        iprot.read_message_end()
         x = ApplicationException.new(ApplicationException::UNKNOWN_METHOD, 'Unknown function '+name)
-        oprot.writeMessageBegin(name, MessageTypes::EXCEPTION, seqid)
+        oprot.write_message_begin(name, MessageTypes::EXCEPTION, seqid)
           x.write(oprot)
-        oprot.writeMessageEnd()
+        oprot.write_message_end()
         oprot.trans.flush()
         return
       end
@@ -24,14 +24,14 @@
     def read_args(iprot, args_class)
       args = args_class.new
       args.read(iprot)
-      iprot.readMessageEnd
+      iprot.read_message_end
       args
     end
 
     def write_result(result, oprot, name, seqid)
-      oprot.writeMessageBegin(name, MessageTypes::REPLY, seqid)
+      oprot.write_message_begin(name, MessageTypes::REPLY, seqid)
       result.write(oprot)
-      oprot.writeMessageEnd()
+      oprot.write_message_end()
       oprot.trans.flush()
     end
   end