<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -9,50 +9,50 @@ class ThriftClient
   # small command-line tools that don't want to install a dozen ruby files.
   module Simple
     VERSION_1 = 0x8001
-  
+
     # message types
     CALL, REPLY, EXCEPTION = (1..3).to_a
-  
+
     # value types
     STOP, VOID, BOOL, BYTE, DOUBLE, _, I16, _, I32, _, I64, STRING, STRUCT, MAP, SET, LIST = (0..15).to_a
-  
+
     FORMATS = {
       BYTE =&gt; &quot;c&quot;,
       DOUBLE =&gt; &quot;G&quot;,
       I16 =&gt; &quot;n&quot;,
       I32 =&gt; &quot;N&quot;,
     }
-  
+
     SIZES = {
       BYTE =&gt; 1,
       DOUBLE =&gt; 8,
       I16 =&gt; 2,
       I32 =&gt; 4,
     }
-  
+
     module ComplexType
       module Extends
         def type_id=(n)
           @type_id = n
         end
-  
+
         def type_id
           @type_id
         end
       end
-  
+
       module Includes
         def to_i
           self.class.type_id
         end
-  
+
         def to_s
           args = self.values.map { |v| self.class.type_id == STRUCT ? v.name : v.to_s }.join(&quot;, &quot;)
           &quot;#{self.class.name}.new(#{args})&quot;
         end
       end
     end
-  
+
     def self.make_type(type_id, name, *args)
       klass = Struct.new(&quot;STT_#{name}&quot;, *args)
       klass.send(:extend, ComplexType::Extends)
@@ -60,12 +60,12 @@ class ThriftClient
       klass.type_id = type_id
       klass
     end
-  
+
     ListType = make_type(LIST, &quot;ListType&quot;, :element_type)
     MapType = make_type(MAP, &quot;MapType&quot;, :key_type, :value_type)
     SetType = make_type(SET, &quot;SetType&quot;, :element_type)
     StructType = make_type(STRUCT, &quot;StructType&quot;, :struct_class)
-  
+
     class &lt;&lt; self
       def pack_value(type, value)
         case type
@@ -87,11 +87,11 @@ class ThriftClient
           [ value ].pack(FORMATS[type])
         end
       end
-  
+
       def pack_request(method_name, arg_struct, request_id=0)
         [ VERSION_1, CALL, method_name.to_s.size, method_name.to_s, request_id, arg_struct._pack ].pack(&quot;nnNa*Na*&quot;)
       end
-  
+
       def read_value(s, type)
         case type
         when BOOL
@@ -118,7 +118,7 @@ class ThriftClient
           s.read(SIZES[type]).unpack(FORMATS[type]).first
         end
       end
-  
+
       def read_list(s, element_type=nil)
         etype, len = s.read(5).unpack(&quot;cN&quot;)
         expected_type = (element_type and element_type.to_i == etype.to_i) ? element_type : etype
@@ -128,7 +128,7 @@ class ThriftClient
         end
         rv
       end
-  
+
       def read_map(s, key_type=nil, value_type=nil)
         ktype, vtype, len = s.read(6).unpack(&quot;ccN&quot;)
         rv = {}
@@ -144,7 +144,7 @@ class ThriftClient
         end
         rv
       end
-  
+
       def read_struct(s, struct_class=nil)
         rv = struct_class.new()
         while true
@@ -156,7 +156,7 @@ class ThriftClient
           rv[field.name] = value if field
         end
       end
-  
+
       def read_response(s, rv_class)
         version, message_type, method_name_len = s.read(8).unpack(&quot;nnN&quot;)
         method_name = s.read(method_name_len)
@@ -164,55 +164,55 @@ class ThriftClient
         [ method_name, seq_id, read_struct(s, rv_class).rv ]
       end
     end
-  
-  
+
+
     ## ----------------------------------------
-  
+
     class Field
       attr_accessor :name, :type, :fid
-  
+
       def initialize(name, type, fid)
         @name = name
         @type = type
         @fid = fid
       end
-  
+
       def pack(value)
         [ type.to_i, fid, ThriftClient::Simple.pack_value(type, value) ].pack(&quot;cna*&quot;)
       end
     end
-  
-  
+
+
     class ThriftException &lt; RuntimeError
       def initialize(reason)
         @reason = reason
       end
-  
+
       def to_s
         &quot;ThriftException(#{@reason.inspect})&quot;
       end
     end
-  
-  
+
+
     module ThriftStruct
       module Include
         def _pack
           self.class._fields.map { |f| f.pack(self[f.name]) }.join + [ STOP ].pack(&quot;c&quot;)
         end
       end
-  
+
       module Extend
         def _fields
           @fields
         end
-  
+
         def _fields=(f)
           @fields = f
         end
       end
     end
-  
-  
+
+
     def self.make_struct(name, *fields)
       st_name = &quot;ST_#{name}&quot;
       if Struct.constants.include?(st_name)
@@ -227,27 +227,27 @@ class ThriftClient
         klass
       end
     end
-  
-  
+
+
     class ThriftService
       def initialize(sock)
         @sock = sock
       end
-  
+
       def self._arg_structs
         @_arg_structs = {} if @_arg_structs.nil?
         @_arg_structs
       end
-  
+
       def self.thrift_method(name, rtype, *args)
         arg_struct = ThriftClient::Simple.make_struct(&quot;Args__#{name}&quot;, *args)
         rv_struct = ThriftClient::Simple.make_struct(&quot;Retval__#{name}&quot;, ThriftClient::Simple::Field.new(:rv, rtype, 0))
         _arg_structs[name.to_sym] = [ arg_struct, rv_struct ]
-  
+
         arg_names = args.map { |a| a.name.to_s }.join(&quot;, &quot;)
-        class_eval &quot;def #{name}(#{arg_names}); _proxy(:#{name}#{args ? ', ' : ''}#{arg_names}); end&quot;
+        class_eval &quot;def #{name}(#{arg_names}); _proxy(:#{name}#{args.size &gt; 0 ? ', ' : ''}#{arg_names}); end&quot;
       end
-  
+
       def _proxy(method_name, *args)
         cls = self.class.ancestors.find { |cls| cls.respond_to?(:_arg_structs) and cls._arg_structs[method_name.to_sym] }
         arg_class, rv_class = cls._arg_structs[method_name.to_sym]
@@ -256,14 +256,14 @@ class ThriftClient
         rv = ThriftClient::Simple.read_response(@sock, rv_class)
         rv[2]
       end
-  
+
       # convenience. robey is lazy.
       [[ :field, &quot;Field.new&quot; ], [ :struct, &quot;StructType.new&quot; ],
        [ :list, &quot;ListType.new&quot; ], [ :map, &quot;MapType.new&quot; ]].each do |new_name, old_name|
         class_eval &quot;def self.#{new_name}(*args); ThriftClient::Simple::#{old_name}(*args); end&quot;
       end
-  
-      [ :i32, :i64, :string ].each { |sym| class_eval &quot;def self.#{sym}; ThriftClient::Simple::#{sym.to_s.upcase}; end&quot; }
+
+      [ :void, :bool, :byte, :double, :i16, :i32, :i64, :string ].each { |sym| class_eval &quot;def self.#{sym}; ThriftClient::Simple::#{sym.to_s.upcase}; end&quot; }
     end
   end
 end</diff>
      <filename>lib/thrift_client/simple.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>42c5f167fd99da9cd66225b1250c98d0ddad860b</id>
    </parent>
    <parent>
      <id>3c39627b2f12f8e0b20aac6c167c4b2649bb3330</id>
    </parent>
  </parents>
  <author>
    <name>Evan Weaver</name>
    <email>eweaver@twitter.com</email>
  </author>
  <url>http://github.com/fauna/thrift_client/commit/d4445b16ae04b805a429a541f0bfb2290b70d14a</url>
  <id>d4445b16ae04b805a429a541f0bfb2290b70d14a</id>
  <committed-date>2009-10-28T12:08:55-07:00</committed-date>
  <authored-date>2009-10-28T12:08:55-07:00</authored-date>
  <message>Merge branch 'master' of git@github.com:fauna/thrift_client</message>
  <tree>b856f61a6cf0cb1d94e9ed527dc43844a10715aa</tree>
  <committer>
    <name>Evan Weaver</name>
    <email>eweaver@twitter.com</email>
  </committer>
</commit>
