avro-salsify-fork 1.9.0.4 → 1.9.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4148d1a482eea909deae7631c18e93db4a7907c2
4
- data.tar.gz: 70e111ad5d85ee5ca788b8385fed629d4f37fb3b
3
+ metadata.gz: 8e59f4f6d198e67587336ff1a67ac04506ac3ce8
4
+ data.tar.gz: 9518b4306d5aaf364d4fe9802fbe37193368795a
5
5
  SHA512:
6
- metadata.gz: e85db5cae3501913da2497112689d8fa433bf1d48d7f937842b0927deda3d55eaf9c4beb0b26b274cb2d8fac79bdfc820e5e343ec774ddc0a14d508dca7a8105
7
- data.tar.gz: bbe69d3e6679d4f2c20aea2ca4dc09d63f30b1a75dd40de60b390e500f272a70c7aa34d904f83479965c730c40bdab61846eadbf5ff3f46bceb260440665c912
6
+ metadata.gz: f490f2b392b80340fed5d7c495a0180e535b28709130185763a77411b9ea963bd15be9ed187d8193919bfcb7395e2c447ee0ea436213b32e37630db1852f9aa1
7
+ data.tar.gz: 666ed344ce16350f075aed6a32856ac7b07d0f5814a11d1ed582d38f472baaa9276141ac9172a0681989339204ae6e2dc490f75174bf554e96c36d518d6f6e3d
data/Rakefile CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  require 'rubygems'
18
18
  require 'echoe'
19
- VERSION = '1.9.0.4'
19
+ VERSION = '1.9.0.5'
20
20
  Echoe.new('avro-salsify-fork', VERSION) do |p|
21
21
  p.author = "Apache Software Foundation / Salsify Engineering"
22
22
  p.email = "engineering@salsify.com"
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: avro-salsify-fork 1.9.0.4 ruby lib
2
+ # stub: avro-salsify-fork 1.9.0.5 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "avro-salsify-fork".freeze
6
- s.version = "1.9.0.4"
6
+ s.version = "1.9.0.5"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
10
10
  s.authors = ["Apache Software Foundation / Salsify Engineering".freeze]
11
- s.date = "2017-01-30"
11
+ s.date = "2017-02-17"
12
12
  s.description = "Avro is a data serialization and RPC format.\nThis release contains the changes submitted in https://github.com/apache/avro/pull/116\nto support logical types in the Ruby gem.".freeze
13
13
  s.email = "engineering@salsify.com".freeze
14
14
  s.extra_rdoc_files = ["CHANGELOG".freeze, "LICENSE".freeze, "lib/avro.rb".freeze, "lib/avro/data_file.rb".freeze, "lib/avro/io.rb".freeze, "lib/avro/ipc.rb".freeze, "lib/avro/logical_types.rb".freeze, "lib/avro/protocol.rb".freeze, "lib/avro/schema.rb".freeze, "lib/avro/schema_compatibility.rb".freeze, "lib/avro/schema_normalization.rb".freeze, "lib/avro/schema_validator.rb".freeze]
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.licenses = ["Apache License 2.0 (Apache-2.0)".freeze]
18
18
  s.rdoc_options = ["--line-numbers".freeze, "--title".freeze, "Avro-salsify-fork".freeze]
19
19
  s.rubyforge_project = "avro-salsify-fork".freeze
20
- s.rubygems_version = "2.6.8".freeze
20
+ s.rubygems_version = "2.6.10".freeze
21
21
  s.summary = "Apache Avro for Ruby with logical types patch".freeze
22
22
  s.test_files = ["test/test_datafile.rb".freeze, "test/test_fingerprints.rb".freeze, "test/test_help.rb".freeze, "test/test_io.rb".freeze, "test/test_logical_types.rb".freeze, "test/test_protocol.rb".freeze, "test/test_schema.rb".freeze, "test/test_schema_compatibility.rb".freeze, "test/test_schema_normalization.rb".freeze, "test/test_schema_validator.rb".freeze, "test/test_socket_transport.rb".freeze]
23
23
 
@@ -343,7 +343,7 @@ module Avro
343
343
  attr_reader :size
344
344
  def initialize(name, space, size, names=nil, logical_type=nil)
345
345
  # Ensure valid cto args
346
- unless size.is_a?(Fixnum) || size.is_a?(Bignum)
346
+ unless size.is_a?(Integer)
347
347
  raise AvroError, 'Fixed Schema requires a valid integer for size property.'
348
348
  end
349
349
  super(:fixed, name, space, names, logical_type)
@@ -86,13 +86,13 @@ module Avro
86
86
  when :string, :bytes
87
87
  fail TypeMismatchError unless datum.is_a?(String)
88
88
  when :int
89
- fail TypeMismatchError unless datum.is_a?(Fixnum) || datum.is_a?(Bignum)
89
+ fail TypeMismatchError unless datum.is_a?(Integer)
90
90
  result.add_error(path, "out of bound value #{datum}") unless INT_RANGE.cover?(datum)
91
91
  when :long
92
- fail TypeMismatchError unless datum.is_a?(Fixnum) || datum.is_a?(Bignum)
92
+ fail TypeMismatchError unless datum.is_a?(Integer)
93
93
  result.add_error(path, "out of bound value #{datum}") unless LONG_RANGE.cover?(datum)
94
94
  when :float, :double
95
- fail TypeMismatchError unless [Float, Fixnum, Bignum].any?(&datum.method(:is_a?))
95
+ fail TypeMismatchError unless [Float, Integer].any?(&datum.method(:is_a?))
96
96
  when :fixed
97
97
  if datum.is_a? String
98
98
  message = "expected fixed with size #{expected_schema.size}, got \"#{datum}\" with size #{datum.size}"
@@ -171,7 +171,11 @@ module Avro
171
171
  private
172
172
 
173
173
  def actual_value_message(value)
174
- avro_type = ruby_to_avro_type(value.class)
174
+ avro_type = if value.class == Integer
175
+ ruby_integer_to_avro_type(value)
176
+ else
177
+ ruby_to_avro_type(value.class)
178
+ end
175
179
  if value.nil?
176
180
  avro_type
177
181
  else
@@ -189,6 +193,10 @@ module Avro
189
193
  Hash => 'record'
190
194
  }.fetch(ruby_class, ruby_class)
191
195
  end
196
+
197
+ def ruby_integer_to_avro_type(value)
198
+ INT_RANGE.cover?(value) ? 'int' : 'long'
199
+ end
192
200
  end
193
201
  end
194
202
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avro-salsify-fork
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0.4
4
+ version: 1.9.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Apache Software Foundation / Salsify Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-30 00:00:00.000000000 Z
11
+ date: 2017-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  version: '1.2'
105
105
  requirements: []
106
106
  rubyforge_project: avro-salsify-fork
107
- rubygems_version: 2.6.8
107
+ rubygems_version: 2.6.10
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: Apache Avro for Ruby with logical types patch