msgpack 0.7.5-x86-mingw32 → 0.7.6-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +9 -0
- data/Rakefile +1 -1
- data/ext/java/org/msgpack/jruby/Encoder.java +12 -7
- data/lib/msgpack/version.rb +1 -1
- data/spec/msgpack_spec.rb +9 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcbde438631780821c89ee3c321dcfa32eedb09d
|
4
|
+
data.tar.gz: 93e0835a1fdf5e0cdc90d45f394eaf315761bd8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c16d01185539cc87a0c75cd1348ce5e231824d6d34b56d79b080c197533061d16c80802b5b44cd25d3ff2ab8026fda33994b449be74da35a22da6022e2c4a42
|
7
|
+
data.tar.gz: 53b0bb453d6e2941598c0c82ca209535a61660de38da697e92ada02c977136c98fadba8ec8582695ad3d0e9bd6e1c2c99dbfb185d51813f018a8be508e805ad6
|
data/ChangeLog
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
2016-05-10 version 0.7.6:
|
2
|
+
|
3
|
+
* Fix bug to raise IndexOutOfBoundsException for Bignum value with small int in JRuby
|
4
|
+
|
5
|
+
2016-04-06 version 0.7.5:
|
6
|
+
|
7
|
+
* Improved support for i386/armel/armhf environments
|
8
|
+
* Fix bug for negative ext type id and some architectures (arm*)
|
9
|
+
|
1
10
|
2016-01-08 version 0.7.4:
|
2
11
|
|
3
12
|
* Improved compatibility of Packer between CRuby and JRuby about argument IO-ish object values.
|
data/Rakefile
CHANGED
@@ -65,7 +65,7 @@ namespace :build do
|
|
65
65
|
desc 'Build gems for Windows per rake-compiler-dock'
|
66
66
|
task :windows do
|
67
67
|
require 'rake_compiler_dock'
|
68
|
-
RakeCompilerDock.sh 'bundle && gem i json && rake cross native gem RUBY_CC_VERSION=2.0.0:2.1.6:2.2.2:2.3.0'
|
68
|
+
RakeCompilerDock.sh 'bundle && gem i json && rake cross native gem RUBY_CC_VERSION=1.9.3:2.0.0:2.1.6:2.2.2:2.3.0'
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
@@ -3,6 +3,7 @@ package org.msgpack.jruby;
|
|
3
3
|
|
4
4
|
import java.math.BigInteger;
|
5
5
|
import java.nio.ByteBuffer;
|
6
|
+
import java.util.Arrays;
|
6
7
|
|
7
8
|
import org.jruby.Ruby;
|
8
9
|
import org.jruby.RubyObject;
|
@@ -124,14 +125,18 @@ public class Encoder {
|
|
124
125
|
}
|
125
126
|
|
126
127
|
private void appendBignum(RubyBignum object) {
|
127
|
-
BigInteger value =
|
128
|
-
if (value.
|
129
|
-
|
128
|
+
BigInteger value = object.getBigIntegerValue();
|
129
|
+
if (value.compareTo(RubyBignum.LONG_MIN) < 0 || value.compareTo(RubyBignum.LONG_MAX) > 0) {
|
130
|
+
if (value.bitLength() > 64 || (value.bitLength() > 63 && value.signum() < 0)) {
|
131
|
+
throw runtime.newArgumentError(String.format("Cannot pack big integer: %s", value));
|
132
|
+
}
|
133
|
+
ensureRemainingCapacity(9);
|
134
|
+
buffer.put(value.signum() < 0 ? INT64 : UINT64);
|
135
|
+
byte[] b = value.toByteArray();
|
136
|
+
buffer.put(b, b.length - 8, 8);
|
137
|
+
} else {
|
138
|
+
appendInteger(object);
|
130
139
|
}
|
131
|
-
ensureRemainingCapacity(9);
|
132
|
-
buffer.put(value.signum() < 0 ? INT64 : UINT64);
|
133
|
-
byte[] b = value.toByteArray();
|
134
|
-
buffer.put(b, b.length - 8, 8);
|
135
140
|
}
|
136
141
|
|
137
142
|
private void appendInteger(RubyInteger object) {
|
data/lib/msgpack/version.rb
CHANGED
data/spec/msgpack_spec.rb
CHANGED
@@ -159,4 +159,13 @@ describe MessagePack do
|
|
159
159
|
packed.should start_with("\xDA\x00\x20")
|
160
160
|
end
|
161
161
|
end
|
162
|
+
|
163
|
+
context 'when a Bignum has a small value' do
|
164
|
+
tests['numbers'].take(10).each do |desc, unpacked, packed|
|
165
|
+
it("encodes #{desc} to the smallest representation") do
|
166
|
+
bignum = (1 << 64).coerce(unpacked)[0]
|
167
|
+
MessagePack.pack(bignum).should eq(packed)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
162
171
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: msgpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.6
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-05-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -187,6 +187,7 @@ files:
|
|
187
187
|
- ext/msgpack/unpacker_ext_registry.c
|
188
188
|
- ext/msgpack/unpacker_ext_registry.h
|
189
189
|
- lib/msgpack.rb
|
190
|
+
- lib/msgpack/1.9/msgpack.so
|
190
191
|
- lib/msgpack/2.0/msgpack.so
|
191
192
|
- lib/msgpack/2.1/msgpack.so
|
192
193
|
- lib/msgpack/2.2/msgpack.so
|