msgpack 0.7.3 → 0.7.4

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: 4cdb90287933e109cb65b2cfa74d7bd6818e040e
4
- data.tar.gz: 07461ed30e0f027158b3dc71f7abdaf08e45f2dd
3
+ metadata.gz: 452730fc6dbf9e301355b759c9f5ff7080bb88ad
4
+ data.tar.gz: 7bd19e617d2298a59be2505929f0888167c39d1c
5
5
  SHA512:
6
- metadata.gz: 4e625fd2e06ea1470f0e5b109460dc5206bdb408402a73a49040ec093e2c11b8f02f81beab8ee267875410acfe0f0cea72f88c74bb21a7bdaf5eb53e0db3ad16
7
- data.tar.gz: b1ab3226c75553fc3f8988b8b661965492c6f45ce2f7a68c4f4747e31a215c6c2f6bd56486483e9bfe3c101c62fccfbe783b8ed431b09440b2b66419cb116d6d
6
+ metadata.gz: f42256792f53a9188e688222f0f44c461bdc3849614bd155f0340a48de437fde596d294341a8b30de27269c69f4ef984da40cca12c76f76c312b83d08a8bf58d
7
+ data.tar.gz: eab376976af6d888b3422a25cd49a4a7dbbe9e11071a0b8ae40491700505cb10d7e5b7768fc8f459aa93e3a58d7f9fe940d0fb70e268244e76f67f3757dfad32
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ 2016-01-08 version 0.7.4:
2
+
3
+ * Improved compatibility of Packer between CRuby and JRuby about argument IO-ish object values.
4
+
1
5
  2016-01-07 version 0.7.3:
2
6
 
3
7
  * Add Packer#write_float32 method to pack floating point numbers into FLOAT of messagepack.
@@ -42,8 +42,9 @@ public class Buffer extends RubyObject {
42
42
  @JRubyMethod(name = "initialize", optional = 2)
43
43
  public IRubyObject initialize(ThreadContext ctx, IRubyObject[] args) {
44
44
  if (args.length > 0) {
45
- if (args[0].respondsTo("read") && args[0].respondsTo("write")) {
46
- this.io = args[0];
45
+ IRubyObject io = args[0];
46
+ if (io.respondsTo("close") && (io.respondsTo("read") || (io.respondsTo("write") && io.respondsTo("flush")))) {
47
+ this.io = io;
47
48
  }
48
49
  }
49
50
  this.buffer = ByteBuffer.allocate(CACHE_LINE_SIZE - ARRAY_HEADER_SIZE);
@@ -1,3 +1,3 @@
1
1
  module MessagePack
2
- VERSION = "0.7.3"
2
+ VERSION = "0.7.4"
3
3
  end
data/spec/packer_spec.rb CHANGED
@@ -44,21 +44,18 @@ describe MessagePack::Packer do
44
44
  dio.rewind
45
45
  expect(dio.string).to eql(sample_packed)
46
46
 
47
- unless defined? JRUBY_VERSION
48
- # JRuby seems to have bug not to flush GzipWriter buffer correctly (both of 1.7 and 9.0)
49
- dio = StringIO.new
50
- writer = Zlib::GzipWriter.new(dio)
51
- writer.sync = true
52
- p3 = MessagePack::Packer.new(writer)
53
- p3.write sample_data
54
- p3.flush
55
- writer.flush(Zlib::FINISH)
56
- writer.close
57
- dio.rewind
58
- compressed = dio.string
59
- str = Zlib::GzipReader.wrap(StringIO.new(compressed)){|gz| gz.read }
60
- expect(str).to eql(sample_packed)
61
- end
47
+ dio = StringIO.new
48
+ writer = Zlib::GzipWriter.new(dio)
49
+ writer.sync = true
50
+ p3 = MessagePack::Packer.new(writer)
51
+ p3.write sample_data
52
+ p3.flush
53
+ writer.flush(Zlib::FINISH)
54
+ writer.close
55
+ dio.rewind
56
+ compressed = dio.string
57
+ str = Zlib::GzipReader.wrap(StringIO.new(compressed)){|gz| gz.read }
58
+ expect(str).to eql(sample_packed)
62
59
 
63
60
  class DummyIO
64
61
  def initialize
@@ -87,6 +84,9 @@ describe MessagePack::Packer do
87
84
  def flush
88
85
  # nop
89
86
  end
87
+ def close
88
+ # nop
89
+ end
90
90
  end
91
91
 
92
92
  dio = DummyIO.new
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.3
4
+ version: 0.7.4
5
5
  platform: ruby
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-01-07 00:00:00.000000000 Z
13
+ date: 2016-01-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -237,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
237
  version: '0'
238
238
  requirements: []
239
239
  rubyforge_project: msgpack
240
- rubygems_version: 2.4.5.1
240
+ rubygems_version: 2.5.1
241
241
  signing_key:
242
242
  specification_version: 4
243
243
  summary: MessagePack, a binary-based efficient data interchange format.