msgpack 0.7.5-x64-mingw32 → 0.7.6-x64-mingw32

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: 87acc2b6a7ffab87082a0ce54dd314889ca53355
4
- data.tar.gz: bc8db2d4b84b68f740d361cd8578507dc3d1478b
3
+ metadata.gz: 7944969d2f07c9241d76086d6fd6530502939e16
4
+ data.tar.gz: f14bfc95cf633b41d8aed27e5276cc9528af7efe
5
5
  SHA512:
6
- metadata.gz: 7de362993d2b36445db1bd2233565c9a08781d1370ba3a4e0b2469c1995aafa0d575779416024d86b055e7a3127218f17c3b6b27ec69a00a80c28126bc99baef
7
- data.tar.gz: 836e279f6c8e3cc88eec152ae30838f14b242444e6ff8f5925a3a31414d04e0ac064b9c210449f99e4e843f1f932471f4b315397e9673c88aa0e0e100ca04ac3
6
+ metadata.gz: 3cf9f8ae071ad62407ab4a9272d6e6b1767e4a378797dfe716eacc43310175e7ee6434a11237cb9ca911761c0196903b9e6479fe15e9b6bf7f881441b52e721f
7
+ data.tar.gz: 5f100e66beb86a6ca8c33f3378e15915602b3eefd8d4060fa7ef642d735f6e3d536b4e44a6934c12c059a7b9a35b757b561a374768a9d5d0f72c7bae11b2d33d
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 = ((RubyBignum) object).getBigIntegerValue();
128
- if (value.bitLength() > 64 || (value.bitLength() > 63 && value.signum() < 0)) {
129
- throw runtime.newArgumentError(String.format("Cannot pack big integer: %s", value));
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) {
@@ -1,3 +1,3 @@
1
1
  module MessagePack
2
- VERSION = "0.7.5"
2
+ VERSION = "0.7.6"
3
3
  end
@@ -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.5
4
+ version: 0.7.6
5
5
  platform: x64-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-04-06 00:00:00.000000000 Z
13
+ date: 2016-05-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler