avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r910701 - in /hadoop/avro/trunk: CHANGES.txt README.txt lang/ruby/lib/avro/io.rb lang/ruby/lib/avro/schema.rb
Date Tue, 16 Feb 2010 21:24:07 GMT
Author: cutting
Date: Tue Feb 16 21:24:06 2010
New Revision: 910701

URL: http://svn.apache.org/viewvc?rev=910701&view=rev
Log:
AVRO-415.  Fix Ruby to work with Ruby 1.8.6.

Modified:
    hadoop/avro/trunk/CHANGES.txt
    hadoop/avro/trunk/README.txt
    hadoop/avro/trunk/lang/ruby/lib/avro/io.rb
    hadoop/avro/trunk/lang/ruby/lib/avro/schema.rb

Modified: hadoop/avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/CHANGES.txt?rev=910701&r1=910700&r2=910701&view=diff
==============================================================================
--- hadoop/avro/trunk/CHANGES.txt (original)
+++ hadoop/avro/trunk/CHANGES.txt Tue Feb 16 21:24:06 2010
@@ -481,6 +481,8 @@
 
     AVRO-407. Fix a bug in the Java data file reader. (Scott Carey via cutting)
 
+    AVRO-415. Fix Ruby to work with Ruby 1.8.6.
+
 Avro 1.2.0 (14 October 2009)
 
   INCOMPATIBLE CHANGES

Modified: hadoop/avro/trunk/README.txt
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/README.txt?rev=910701&r1=910700&r2=910701&view=diff
==============================================================================
--- hadoop/avro/trunk/README.txt (original)
+++ hadoop/avro/trunk/README.txt Tue Feb 16 21:24:06 2010
@@ -12,7 +12,7 @@
  - Python: 2.5 or greater, python-setuptools for dist target
  - C: gcc, autoconf, automake, libtool, asciidoc 
  - C++: g++, flex, bison, libboost-dev
- - Ruby: ruby, gem, rake, echoe, jajl-ruby
+ - Ruby: ruby 1.86 or greater, gem, rake, echoe, jajl-ruby
  - Apache Ant 1.7
  - Apache Forrest 0.8 (for documentation, requires Java 1.5)
 

Modified: hadoop/avro/trunk/lang/ruby/lib/avro/io.rb
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/ruby/lib/avro/io.rb?rev=910701&r1=910700&r2=910701&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/ruby/lib/avro/io.rb (original)
+++ hadoop/avro/trunk/lang/ruby/lib/avro/io.rb Tue Feb 16 21:24:06 2010
@@ -552,9 +552,10 @@
       end
 
       def write_union(writers_schema, datum, encoder)
-        index_of_schema = writers_schema.schemas.
-          find_index{|e| Schema.validate(e, datum) }
-        unless index_of_schema
+        index_of_schema = -1
+        found = writers_schema.schemas.
+          find{|e| index_of_schema += 1; found = Schema.validate(e, datum) }
+        unless found  # Because find_index doesn't exist in 1.8.6
           raise AvroTypeError.new(writers_schema, datum)
         end
         encoder.write_long(index_of_schema)

Modified: hadoop/avro/trunk/lang/ruby/lib/avro/schema.rb
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/ruby/lib/avro/schema.rb?rev=910701&r1=910700&r2=910701&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/ruby/lib/avro/schema.rb (original)
+++ hadoop/avro/trunk/lang/ruby/lib/avro/schema.rb Tue Feb 16 21:24:06 2010
@@ -287,7 +287,7 @@
           ns_type = new_schema.type
           if VALID_TYPES.include?(ns_type) &&
               !NAMED_TYPES.include?(ns_type) &&
-              schema_objects.map(&:type).include?(ns_type)
+              schema_objects.map{|o| o.type }.include?(ns_type)
             raise SchemaParseError, "#{ns_type} is already in Union"
           elsif ns_type == 'union'
             raise SchemaParseError, "Unions cannot contain other unions"



Mime
View raw message