You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Ryan Blue (JIRA)" <ji...@apache.org> on 2016/01/19 23:30:39 UTC

[jira] [Created] (AVRO-1785) Ruby: schema_normalization.rb is incompatible with Ruby 1.8.7

Ryan Blue created AVRO-1785:
-------------------------------

             Summary: Ruby: schema_normalization.rb is incompatible with Ruby 1.8.7
                 Key: AVRO-1785
                 URL: https://issues.apache.org/jira/browse/AVRO-1785
             Project: Avro
          Issue Type: Bug
          Components: ruby
    Affects Versions: 1.8.0
            Reporter: Ryan Blue


I was just checking AVRO-1775 in 1.8.7 and ran into compile errors. The schema_normalization.rb code that was introduced by AVRO-1694 is not compatible with Ruby 1.8.7 because it uses the "new" hash syntax in method definitions.

{code}
blue@work:~/workspace/avro/lang/ruby$ bundle exec rake test
/home/blue/workspace/avro/lang/ruby/Rakefile:19: warning: already initialized constant VERSION
/home/blue/.rvm/rubies/ruby-1.8.7-p374/bin/ruby -I"lib:ext:bin:test" -I"/home/blue/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.4.2/lib" "/home/blue/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.4.2/lib/rake/rake_test_loader.rb" "test/test_help.rb" "test/test_socket_transport.rb" "test/test_fingerprints.rb" "test/test_schema_normalization.rb" "test/test_schema.rb" "test/test_datafile.rb" "test/test_io.rb" "test/test_protocol.rb" 
./lib/avro/schema_normalization.rb:67: warning: else without rescue is useless
./lib/avro.rb:42:in `require': ./lib/avro/schema_normalization.rb:50: syntax error, unexpected ':', expecting ')' (SyntaxError)
        normalize_named_type(schema, fields: fields)
                                            ^
./lib/avro/schema_normalization.rb:52: syntax error, unexpected ':', expecting ')'
        normalize_named_type(schema, symbols: schema.symbols)
                                             ^
./lib/avro/schema_normalization.rb:52: syntax error, unexpected ')', expecting kEND
./lib/avro/schema_normalization.rb:54: syntax error, unexpected ':', expecting ')'
        normalize_named_type(schema, size: schema.size)
                                          ^
./lib/avro/schema_normalization.rb:54: syntax error, unexpected ')', expecting kEND
./lib/avro/schema_normalization.rb:56: odd number list for Hash
        { type: type, items: normalize_schema(schema.items) }
               ^
./lib/avro/schema_normalization.rb:56: syntax error, unexpected ':', expecting '}'
        { type: type, items: normalize_schema(schema.items) }
               ^
./lib/avro/schema_normalization.rb:56: syntax error, unexpected ':', expecting '='
        { type: type, items: normalize_schema(schema.items) }
                            ^
./lib/avro/schema_normalization.rb:56: syntax error, unexpected '}', expecting kEND
./lib/avro/schema_normalization.rb:58: odd number list for Hash
        { type: type, values: normalize_schema(schema.values) }
               ^
./lib/avro/schema_normalization.rb:58: syntax error, unexpected ':', expecting '}'
        { type: type, values: normalize_schema(schema.values) }
               ^
./lib/avro/schema_normalization.rb:58: syntax error, unexpected ':', expecting '='
        { type: type, values: normalize_schema(schema.values) }
                             ^
./lib/avro/schema_normalization.rb:58: syntax error, unexpected '}', expecting kEND
./lib/avro/schema_normalization.rb:72: odd number list for Hash
        name: field.name,
             ^
./lib/avro/schema_normalization.rb:72: syntax error, unexpected ':', expecting '}'
        name: field.name,
             ^
./lib/avro/schema_normalization.rb:73: syntax error, unexpected ':', expecting '='
        type: normalize_schema(field.type)
             ^
./lib/avro/schema_normalization.rb:74: syntax error, unexpected '}', expecting kEND
./lib/avro/schema_normalization.rb:80: odd number list for Hash
      { name: name, type: schema.type_sym.to_s }.merge(attributes)
             ^
./lib/avro/schema_normalization.rb:80: syntax error, unexpected ':', expecting '}'
      { name: name, type: schema.type_sym.to_s }.merge(attributes)
             ^
./lib/avro/schema_normalization.rb:80: syntax error, unexpected ':', expecting '='
      { name: name, type: schema.type_sym.to_s }.merge(attributes)
                         ^
./lib/avro/schema_normalization.rb:80: syntax error, unexpected '}', expecting kEND
      { name: name, type: schema.type_sym.to_s }.merge(attributes)
                                                ^
        from ./lib/avro.rb:42
        from /home/blue/workspace/avro/lang/ruby/test/test_help.rb:22:in `require'
        from /home/blue/workspace/avro/lang/ruby/test/test_help.rb:22
        from /home/blue/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.4.2/lib/rake/rake_test_loader.rb:15:in `require'
        from /home/blue/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.4.2/lib/rake/rake_test_loader.rb:15
        from /home/blue/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.4.2/lib/rake/rake_test_loader.rb:4:in `select'
        from /home/blue/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.4.2/lib/rake/rake_test_loader.rb:4
rake aborted!
Command failed with status (1): [ruby -I"lib:ext:bin:test" -I"/home/blue/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.4.2/lib" "/home/blue/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.4.2/lib/rake/rake_test_loader.rb" "test/test_help.rb" "test/test_socket_transport.rb" "test/test_fingerprints.rb" "test/test_schema_normalization.rb" "test/test_schema.rb" "test/test_datafile.rb" "test/test_io.rb" "test/test_protocol.rb" ]
/home/blue/.rvm/gems/ruby-1.8.7-p374/gems/echoe-4.6.6/lib/echoe.rb:749:in `define_tasks'
/home/blue/.rvm/gems/ruby-1.8.7-p374/bin/ruby_executable_hooks:15
Tasks: TOP => test_inner
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)