avro 1.7.6 → 1.7.7

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest CHANGED
@@ -4,7 +4,6 @@ Rakefile
4
4
  avro.gemspec
5
5
  interop/test_interop.rb
6
6
  lib/avro.rb
7
- lib/avro/collect_hash.rb
8
7
  lib/avro/data_file.rb
9
8
  lib/avro/io.rb
10
9
  lib/avro/ipc.rb
data/Rakefile CHANGED
@@ -23,7 +23,7 @@ Echoe.new('avro', VERSION) do |p|
23
23
  p.summary = "Apache Avro for Ruby"
24
24
  p.description = "Avro is a data serialization and RPC format"
25
25
  p.url = "http://hadoop.apache.org/avro/"
26
- p.runtime_dependencies = %w[multi-json]
26
+ p.runtime_dependencies = %w[multi_json]
27
27
  end
28
28
 
29
29
  t = Rake::TestTask.new(:interop)
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "avro"
5
- s.version = "1.7.6"
5
+ s.version = "1.7.7"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Apache Software Foundation"]
9
- s.date = "2014-01-10"
9
+ s.date = "2014-07-18"
10
10
  s.description = "Avro is a data serialization and RPC format"
11
11
  s.email = "avro-dev@hadoop.apache.org"
12
- s.extra_rdoc_files = ["CHANGELOG", "lib/avro.rb", "lib/avro/collect_hash.rb", "lib/avro/data_file.rb", "lib/avro/io.rb", "lib/avro/ipc.rb", "lib/avro/protocol.rb", "lib/avro/schema.rb"]
13
- s.files = ["CHANGELOG", "Manifest", "Rakefile", "avro.gemspec", "interop/test_interop.rb", "lib/avro.rb", "lib/avro/collect_hash.rb", "lib/avro/data_file.rb", "lib/avro/io.rb", "lib/avro/ipc.rb", "lib/avro/protocol.rb", "lib/avro/schema.rb", "test/random_data.rb", "test/sample_ipc_client.rb", "test/sample_ipc_http_client.rb", "test/sample_ipc_http_server.rb", "test/sample_ipc_server.rb", "test/test_datafile.rb", "test/test_help.rb", "test/test_io.rb", "test/test_protocol.rb", "test/test_socket_transport.rb", "test/tool.rb", "test/test_schema.rb"]
12
+ s.extra_rdoc_files = ["CHANGELOG", "lib/avro.rb", "lib/avro/data_file.rb", "lib/avro/io.rb", "lib/avro/ipc.rb", "lib/avro/protocol.rb", "lib/avro/schema.rb"]
13
+ s.files = ["CHANGELOG", "Manifest", "Rakefile", "avro.gemspec", "interop/test_interop.rb", "lib/avro.rb", "lib/avro/data_file.rb", "lib/avro/io.rb", "lib/avro/ipc.rb", "lib/avro/protocol.rb", "lib/avro/schema.rb", "test/random_data.rb", "test/sample_ipc_client.rb", "test/sample_ipc_http_client.rb", "test/sample_ipc_http_server.rb", "test/sample_ipc_server.rb", "test/test_datafile.rb", "test/test_help.rb", "test/test_io.rb", "test/test_protocol.rb", "test/test_socket_transport.rb", "test/tool.rb", "test/test_schema.rb"]
14
14
  s.homepage = "http://hadoop.apache.org/avro/"
15
15
  s.rdoc_options = ["--line-numbers", "--title", "Avro"]
16
16
  s.require_paths = ["lib"]
@@ -23,11 +23,11 @@ Gem::Specification.new do |s|
23
23
  s.specification_version = 3
24
24
 
25
25
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
- s.add_runtime_dependency(%q<multi-json>, [">= 0"])
26
+ s.add_runtime_dependency(%q<multi_json>, [">= 0"])
27
27
  else
28
- s.add_dependency(%q<multi-json>, [">= 0"])
28
+ s.add_dependency(%q<multi_json>, [">= 0"])
29
29
  end
30
30
  else
31
- s.add_dependency(%q<multi-json>, [">= 0"])
31
+ s.add_dependency(%q<multi_json>, [">= 0"])
32
32
  end
33
33
  end
@@ -34,7 +34,6 @@ module Avro
34
34
  end
35
35
  end
36
36
 
37
- require 'avro/collect_hash'
38
37
  require 'avro/schema'
39
38
  require 'avro/io'
40
39
  require 'avro/data_file'
@@ -20,7 +20,8 @@ module Avro
20
20
  module DataFile
21
21
  VERSION = 1
22
22
  MAGIC = "Obj" + [VERSION].pack('c')
23
- MAGIC_SIZE = MAGIC.size
23
+ MAGIC.force_encoding('BINARY') if MAGIC.respond_to?(:force_encoding)
24
+ MAGIC_SIZE = MAGIC.respond_to?(:bytesize) ? MAGIC.bytesize : MAGIC.size
24
25
  SYNC_SIZE = 16
25
26
  SYNC_INTERVAL = 4000 * SYNC_SIZE
26
27
  META_SCHEMA = Schema.parse('{"type": "map", "values": "bytes"}')
@@ -98,6 +99,7 @@ module Avro
98
99
  @encoder = IO::BinaryEncoder.new(@writer)
99
100
  @datum_writer = datum_writer
100
101
  @buffer_writer = StringIO.new('', 'w')
102
+ @buffer_writer.set_encoding('BINARY') if @buffer_writer.respond_to?(:set_encoding)
101
103
  @buffer_encoder = IO::BinaryEncoder.new(@buffer_writer)
102
104
  @block_count = 0
103
105
 
@@ -181,7 +183,7 @@ module Avro
181
183
  # write number of items in block and block size in bytes
182
184
  encoder.write_long(block_count)
183
185
  to_write = codec.compress(buffer_writer.string)
184
- encoder.write_long(to_write.size)
186
+ encoder.write_long(to_write.respond_to?(:bytesize) ? to_write.bytesize : to_write.size)
185
187
 
186
188
  # write block contents
187
189
  writer.write(to_write)
@@ -104,7 +104,7 @@ module Avro
104
104
  hsh['types'] = types.map{|t| t.to_avro(names) } if types
105
105
 
106
106
  if messages
107
- hsh['messages'] = messages.collect_hash{|k,t| [k, t.to_avro(names)] }
107
+ hsh['messages'] = messages.inject({}) {|h, (k,t)| h[k] = t.to_avro(names); h }
108
108
  end
109
109
 
110
110
  hsh
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avro
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 7
9
- - 6
10
- version: 1.7.6
9
+ - 7
10
+ version: 1.7.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Apache Software Foundation
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2014-01-10 00:00:00 Z
18
+ date: 2014-07-18 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  version_requirements: &id001 !ruby/object:Gem::Requirement
@@ -27,10 +27,10 @@ dependencies:
27
27
  segments:
28
28
  - 0
29
29
  version: "0"
30
- name: multi-json
30
+ name: multi_json
31
31
  prerelease: false
32
- type: :runtime
33
32
  requirement: *id001
33
+ type: :runtime
34
34
  description: Avro is a data serialization and RPC format
35
35
  email: avro-dev@hadoop.apache.org
36
36
  executables: []
@@ -40,7 +40,6 @@ extensions: []
40
40
  extra_rdoc_files:
41
41
  - CHANGELOG
42
42
  - lib/avro.rb
43
- - lib/avro/collect_hash.rb
44
43
  - lib/avro/data_file.rb
45
44
  - lib/avro/io.rb
46
45
  - lib/avro/ipc.rb
@@ -53,7 +52,6 @@ files:
53
52
  - avro.gemspec
54
53
  - interop/test_interop.rb
55
54
  - lib/avro.rb
56
- - lib/avro/collect_hash.rb
57
55
  - lib/avro/data_file.rb
58
56
  - lib/avro/io.rb
59
57
  - lib/avro/ipc.rb
@@ -1,25 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one
2
- # or more contributor license agreements. See the NOTICE file
3
- # distributed with this work for additional information
4
- # regarding copyright ownership. The ASF licenses this file
5
- # to you under the Apache License, Version 2.0 (the
6
- # "License"); you may not use this file except in compliance
7
- # with the License. You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- module Enumerable
18
- def collect_hash
19
- inject(Hash.new) do |memo, i|
20
- k, v = yield(i)
21
- memo[k] = v if k
22
- memo
23
- end
24
- end
25
- end