msgpack 0.7.0dev1-x64-mingw32 → 0.7.0-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +2 -0
- data/ChangeLog +8 -0
- data/README.rdoc +36 -2
- data/ext/java/org/msgpack/jruby/Decoder.java +55 -16
- data/ext/java/org/msgpack/jruby/Encoder.java +31 -8
- data/ext/java/org/msgpack/jruby/ExtensionRegistry.java +159 -0
- data/ext/java/org/msgpack/jruby/Factory.java +117 -0
- data/ext/java/org/msgpack/jruby/MessagePackLibrary.java +23 -6
- data/ext/java/org/msgpack/jruby/Packer.java +65 -6
- data/ext/java/org/msgpack/jruby/Unpacker.java +104 -22
- data/ext/msgpack/packer_class.c +7 -0
- data/ext/msgpack/packer_ext_registry.c +0 -8
- data/ext/msgpack/packer_ext_registry.h +0 -3
- data/ext/msgpack/unpacker_class.c +14 -0
- data/ext/msgpack/unpacker_ext_registry.c +0 -6
- data/ext/msgpack/unpacker_ext_registry.h +0 -3
- data/lib/msgpack/version.rb +1 -1
- data/msgpack.gemspec +5 -3
- data/spec/cruby/unpacker_spec.rb +0 -247
- data/spec/factory_spec.rb +0 -3
- data/spec/jruby/{msgpack/unpacker_spec.rb → unpacker_spec.rb} +30 -159
- data/spec/msgpack_spec.rb +1 -1
- data/spec/packer_spec.rb +135 -4
- data/spec/unpacker_spec.rb +465 -6
- metadata +9 -6
- data/spec/cruby/packer_spec.rb +0 -138
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
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.0
|
5
5
|
platform: x64-mingw32
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
- Theo Hultberg
|
9
|
+
- Satoshi Tagomori
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2015-
|
13
|
+
date: 2015-10-24 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: bundler
|
@@ -115,6 +116,7 @@ description: MessagePack is a binary-based efficient object serialization librar
|
|
115
116
|
email:
|
116
117
|
- frsyuki@gmail.com
|
117
118
|
- theo@iconara.net
|
119
|
+
- tagomoris@gmail.com
|
118
120
|
executables: []
|
119
121
|
extensions: []
|
120
122
|
extra_rdoc_files: []
|
@@ -147,7 +149,9 @@ files:
|
|
147
149
|
- ext/java/org/msgpack/jruby/Buffer.java
|
148
150
|
- ext/java/org/msgpack/jruby/Decoder.java
|
149
151
|
- ext/java/org/msgpack/jruby/Encoder.java
|
152
|
+
- ext/java/org/msgpack/jruby/ExtensionRegistry.java
|
150
153
|
- ext/java/org/msgpack/jruby/ExtensionValue.java
|
154
|
+
- ext/java/org/msgpack/jruby/Factory.java
|
151
155
|
- ext/java/org/msgpack/jruby/MessagePackLibrary.java
|
152
156
|
- ext/java/org/msgpack/jruby/Packer.java
|
153
157
|
- ext/java/org/msgpack/jruby/Types.java
|
@@ -200,7 +204,6 @@ files:
|
|
200
204
|
- spec/cruby/buffer_packer.rb
|
201
205
|
- spec/cruby/buffer_spec.rb
|
202
206
|
- spec/cruby/buffer_unpacker.rb
|
203
|
-
- spec/cruby/packer_spec.rb
|
204
207
|
- spec/cruby/unpacker_spec.rb
|
205
208
|
- spec/ext_value_spec.rb
|
206
209
|
- spec/exttypes.rb
|
@@ -208,7 +211,7 @@ files:
|
|
208
211
|
- spec/format_spec.rb
|
209
212
|
- spec/jruby/benchmarks/shootout_bm.rb
|
210
213
|
- spec/jruby/benchmarks/symbolize_keys_bm.rb
|
211
|
-
- spec/jruby/
|
214
|
+
- spec/jruby/unpacker_spec.rb
|
212
215
|
- spec/msgpack_spec.rb
|
213
216
|
- spec/pack_spec.rb
|
214
217
|
- spec/packer_spec.rb
|
@@ -231,9 +234,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
231
234
|
version: '0'
|
232
235
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
233
236
|
requirements:
|
234
|
-
- - "
|
237
|
+
- - ">="
|
235
238
|
- !ruby/object:Gem::Version
|
236
|
-
version:
|
239
|
+
version: '0'
|
237
240
|
requirements: []
|
238
241
|
rubyforge_project: msgpack
|
239
242
|
rubygems_version: 2.4.8
|
data/spec/cruby/packer_spec.rb
DELETED
@@ -1,138 +0,0 @@
|
|
1
|
-
# encoding: ascii-8bit
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
require 'stringio'
|
5
|
-
if defined?(Encoding)
|
6
|
-
Encoding.default_external = 'ASCII-8BIT'
|
7
|
-
end
|
8
|
-
|
9
|
-
describe Packer do
|
10
|
-
let :packer do
|
11
|
-
Packer.new
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'initialize' do
|
15
|
-
Packer.new
|
16
|
-
Packer.new(nil)
|
17
|
-
Packer.new(StringIO.new)
|
18
|
-
Packer.new({})
|
19
|
-
Packer.new(StringIO.new, {})
|
20
|
-
end
|
21
|
-
|
22
|
-
#it 'Packer' do
|
23
|
-
# Packer(packer).object_id.should == packer.object_id
|
24
|
-
# Packer(nil).class.should == Packer
|
25
|
-
# Packer('').class.should == Packer
|
26
|
-
# Packer('initbuf').to_s.should == 'initbuf'
|
27
|
-
#end
|
28
|
-
|
29
|
-
it 'write' do
|
30
|
-
packer.write([])
|
31
|
-
packer.to_s.should == "\x90"
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'write_nil' do
|
35
|
-
packer.write_nil
|
36
|
-
packer.to_s.should == "\xc0"
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'write_array_header 0' do
|
40
|
-
packer.write_array_header(0)
|
41
|
-
packer.to_s.should == "\x90"
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'write_array_header 1' do
|
45
|
-
packer.write_array_header(1)
|
46
|
-
packer.to_s.should == "\x91"
|
47
|
-
end
|
48
|
-
|
49
|
-
it 'write_map_header 0' do
|
50
|
-
packer.write_map_header(0)
|
51
|
-
packer.to_s.should == "\x80"
|
52
|
-
end
|
53
|
-
|
54
|
-
it 'write_map_header 1' do
|
55
|
-
packer.write_map_header(1)
|
56
|
-
packer.to_s.should == "\x81"
|
57
|
-
end
|
58
|
-
|
59
|
-
it 'flush' do
|
60
|
-
io = StringIO.new
|
61
|
-
pk = Packer.new(io)
|
62
|
-
pk.write_nil
|
63
|
-
pk.flush
|
64
|
-
pk.to_s.should == ''
|
65
|
-
io.string.should == "\xc0"
|
66
|
-
end
|
67
|
-
|
68
|
-
it 'to_msgpack returns String' do
|
69
|
-
nil.to_msgpack.class.should == String
|
70
|
-
true.to_msgpack.class.should == String
|
71
|
-
false.to_msgpack.class.should == String
|
72
|
-
1.to_msgpack.class.should == String
|
73
|
-
1.0.to_msgpack.class.should == String
|
74
|
-
"".to_msgpack.class.should == String
|
75
|
-
Hash.new.to_msgpack.class.should == String
|
76
|
-
Array.new.to_msgpack.class.should == String
|
77
|
-
end
|
78
|
-
|
79
|
-
class CustomPack01
|
80
|
-
def to_msgpack(pk=nil)
|
81
|
-
return MessagePack.pack(self, pk) unless pk.class == MessagePack::Packer
|
82
|
-
pk.write_array_header(2)
|
83
|
-
pk.write(1)
|
84
|
-
pk.write(2)
|
85
|
-
return pk
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
class CustomPack02
|
90
|
-
def to_msgpack(pk=nil)
|
91
|
-
[1,2].to_msgpack(pk)
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
it 'calls custom to_msgpack method' do
|
96
|
-
MessagePack.pack(CustomPack01.new).should == [1,2].to_msgpack
|
97
|
-
MessagePack.pack(CustomPack02.new).should == [1,2].to_msgpack
|
98
|
-
CustomPack01.new.to_msgpack.should == [1,2].to_msgpack
|
99
|
-
CustomPack02.new.to_msgpack.should == [1,2].to_msgpack
|
100
|
-
end
|
101
|
-
|
102
|
-
it 'calls custom to_msgpack method with io' do
|
103
|
-
s01 = StringIO.new
|
104
|
-
MessagePack.pack(CustomPack01.new, s01)
|
105
|
-
s01.string.should == [1,2].to_msgpack
|
106
|
-
|
107
|
-
s02 = StringIO.new
|
108
|
-
MessagePack.pack(CustomPack02.new, s02)
|
109
|
-
s02.string.should == [1,2].to_msgpack
|
110
|
-
|
111
|
-
s03 = StringIO.new
|
112
|
-
CustomPack01.new.to_msgpack(s03)
|
113
|
-
s03.string.should == [1,2].to_msgpack
|
114
|
-
|
115
|
-
s04 = StringIO.new
|
116
|
-
CustomPack02.new.to_msgpack(s04)
|
117
|
-
s04.string.should == [1,2].to_msgpack
|
118
|
-
end
|
119
|
-
|
120
|
-
context 'in compatibility mode' do
|
121
|
-
it 'does not use the bin types' do
|
122
|
-
packed = MessagePack.pack('hello'.force_encoding(Encoding::BINARY), compatibility_mode: true)
|
123
|
-
packed.should eq("\xA5hello")
|
124
|
-
packed = MessagePack.pack(('hello' * 100).force_encoding(Encoding::BINARY), compatibility_mode: true)
|
125
|
-
packed.should start_with("\xDA\x01\xF4")
|
126
|
-
|
127
|
-
packer = MessagePack::Packer.new(compatibility_mode: 1)
|
128
|
-
packed = packer.pack(('hello' * 100).force_encoding(Encoding::BINARY))
|
129
|
-
packed.to_str.should start_with("\xDA\x01\xF4")
|
130
|
-
end
|
131
|
-
|
132
|
-
it 'does not use the str8 type' do
|
133
|
-
packed = MessagePack.pack('x' * 32, compatibility_mode: true)
|
134
|
-
packed.should start_with("\xDA\x00\x20")
|
135
|
-
end
|
136
|
-
end
|
137
|
-
end
|
138
|
-
|