msgpack 1.3.3 → 1.4.0.pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -2
- data/.travis.yml +5 -9
- data/ext/msgpack/extconf.rb +12 -0
- data/ext/msgpack/unpacker.c +3 -0
- data/lib/msgpack.rb +1 -5
- data/lib/msgpack/version.rb +1 -1
- data/spec/spec_helper.rb +11 -0
- data/spec/unpacker_spec.rb +11 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dce37069bf08ffa0b29a76363cee45e3d8e19188236d673dc1c9b4172727738c
|
4
|
+
data.tar.gz: 3c30d3ac0b3a3b4f5432e958935370f2e55d16ce516bf6a91eb12382aad38d8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53d062f57dcd7324a04224c16dedbe7aa0188515d595f5a38ca543e0b956db8bbd3906a59cf3faceb5c0fb3b23d10be47bb34d19146c61923818f8f856c0a726
|
7
|
+
data.tar.gz: 408bcb8f9cde8c88ac6a0620a8a64c746e34723b582aa160b53687f7b5206a9cdcf97efb97eafcf6357cee6412ae3d0346a952e97b979f7c4eeffe23150d7ec4
|
data/.rubocop.yml
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
# versions of RuboCop, may require this file to be generated again.
|
7
7
|
|
8
8
|
AllCops:
|
9
|
-
TargetRubyVersion: 2.
|
9
|
+
TargetRubyVersion: 2.4
|
10
10
|
|
11
11
|
# Offense count: 3
|
12
12
|
Lint/AmbiguousOperator:
|
@@ -18,7 +18,7 @@ Lint/AssignmentInCondition:
|
|
18
18
|
Enabled: false
|
19
19
|
|
20
20
|
# Offense count: 1
|
21
|
-
|
21
|
+
Security/Eval:
|
22
22
|
Enabled: false
|
23
23
|
|
24
24
|
# Offense count: 3
|
data/.travis.yml
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
language: ruby
|
2
2
|
|
3
|
-
sudo: false
|
4
|
-
|
5
3
|
branches:
|
6
4
|
only:
|
7
5
|
- master
|
@@ -17,19 +15,17 @@ before_install:
|
|
17
15
|
# http://rubies.travis-ci.org/
|
18
16
|
matrix:
|
19
17
|
include:
|
20
|
-
- rvm: 2.3.8
|
21
|
-
os: linux
|
22
18
|
- rvm: 2.4.5
|
23
19
|
os: linux
|
24
|
-
- rvm: 2.5.
|
20
|
+
- rvm: 2.5.8
|
25
21
|
os: linux
|
26
|
-
- rvm: 2.6.
|
22
|
+
- rvm: 2.6.6
|
27
23
|
os: linux
|
28
|
-
- rvm: 2.6.
|
24
|
+
- rvm: 2.6.6
|
29
25
|
os: osx
|
30
|
-
- rvm:
|
26
|
+
- rvm: 2.7.1
|
31
27
|
os: linux
|
32
|
-
- rvm:
|
28
|
+
- rvm: ruby-head
|
33
29
|
os: linux
|
34
30
|
- rvm: jruby-head
|
35
31
|
os: linux
|
data/ext/msgpack/extconf.rb
CHANGED
@@ -25,6 +25,18 @@ if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
|
|
25
25
|
$CFLAGS << %[ -DDISABLE_RMEM]
|
26
26
|
end
|
27
27
|
|
28
|
+
# checking if Hash#[]= (rb_hash_aset) dedupes string keys
|
29
|
+
h = {}
|
30
|
+
x = {}
|
31
|
+
r = rand.to_s
|
32
|
+
h[%W(#{r}).join('')] = :foo
|
33
|
+
x[%W(#{r}).join('')] = :foo
|
34
|
+
if x.keys[0].equal?(h.keys[0])
|
35
|
+
$CFLAGS << ' -DHASH_ASET_DEDUPE=1 '
|
36
|
+
else
|
37
|
+
$CFLAGS << ' -DHASH_ASET_DEDUPE=0 '
|
38
|
+
end
|
39
|
+
|
28
40
|
if warnflags = CONFIG['warnflags']
|
29
41
|
warnflags.slice!(/ -Wdeclaration-after-statement/)
|
30
42
|
end
|
data/ext/msgpack/unpacker.c
CHANGED
@@ -300,9 +300,12 @@ static inline int read_raw_body_begin(msgpack_unpacker_t* uk, int raw_type)
|
|
300
300
|
} else {
|
301
301
|
ret = object_complete_ext(uk, raw_type, string);
|
302
302
|
}
|
303
|
+
|
304
|
+
# if !HASH_ASET_DEDUPE
|
303
305
|
if(will_freeze) {
|
304
306
|
rb_obj_freeze(string);
|
305
307
|
}
|
308
|
+
# endif
|
306
309
|
uk->reading_raw_remaining = 0;
|
307
310
|
return ret;
|
308
311
|
}
|
data/lib/msgpack.rb
CHANGED
@@ -5,11 +5,7 @@ if defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby" # This is same with `/java/ =
|
|
5
5
|
require "msgpack/msgpack.jar"
|
6
6
|
org.msgpack.jruby.MessagePackLibrary.new.load(JRuby.runtime, false)
|
7
7
|
else
|
8
|
-
|
9
|
-
require "msgpack/#{RUBY_VERSION[/\d+.\d+/]}/msgpack"
|
10
|
-
rescue LoadError
|
11
|
-
require "msgpack/msgpack"
|
12
|
-
end
|
8
|
+
require "msgpack/msgpack"
|
13
9
|
end
|
14
10
|
|
15
11
|
require "msgpack/packer"
|
data/lib/msgpack/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -19,6 +19,17 @@ def java?
|
|
19
19
|
/java/ =~ RUBY_PLATFORM
|
20
20
|
end
|
21
21
|
|
22
|
+
# checking if Hash#[]= (rb_hash_aset) dedupes string keys
|
23
|
+
def automatic_string_keys_deduplication?
|
24
|
+
h = {}
|
25
|
+
x = {}
|
26
|
+
r = rand.to_s
|
27
|
+
h[%W(#{r}).join('')] = :foo
|
28
|
+
x[%W(#{r}).join('')] = :foo
|
29
|
+
|
30
|
+
x.keys[0].equal?(h.keys[0])
|
31
|
+
end
|
32
|
+
|
22
33
|
if java?
|
23
34
|
RSpec.configure do |c|
|
24
35
|
c.treat_symbols_as_metadata_keys_with_true_values = true
|
data/spec/unpacker_spec.rb
CHANGED
@@ -25,6 +25,17 @@ describe MessagePack::Unpacker do
|
|
25
25
|
u2.allow_unknown_ext?.should == true
|
26
26
|
end
|
27
27
|
|
28
|
+
if automatic_string_keys_deduplication?
|
29
|
+
it 'ensure string hash keys are deduplicated' do
|
30
|
+
sample_data = [{"foo" => 1}, {"foo" => 2}]
|
31
|
+
sample_packed = MessagePack.pack(sample_data).force_encoding('ASCII-8BIT')
|
32
|
+
unpacker.feed(sample_packed)
|
33
|
+
hashes = nil
|
34
|
+
unpacker.each { |obj| hashes = obj }
|
35
|
+
expect(hashes[0].keys.first).to equal(hashes[1].keys.first)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
28
39
|
it 'gets IO or object which has #read to read data from it' do
|
29
40
|
sample_data = {"message" => "morning!", "num" => 1}
|
30
41
|
sample_packed = MessagePack.pack(sample_data).force_encoding('ASCII-8BIT')
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: msgpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
- Theo Hultberg
|
9
9
|
- Satoshi Tagomori
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-
|
13
|
+
date: 2020-09-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -228,7 +228,7 @@ homepage: http://msgpack.org/
|
|
228
228
|
licenses:
|
229
229
|
- Apache 2.0
|
230
230
|
metadata: {}
|
231
|
-
post_install_message:
|
231
|
+
post_install_message:
|
232
232
|
rdoc_options: []
|
233
233
|
require_paths:
|
234
234
|
- lib
|
@@ -239,12 +239,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
239
239
|
version: '0'
|
240
240
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
241
241
|
requirements:
|
242
|
-
- - "
|
242
|
+
- - ">"
|
243
243
|
- !ruby/object:Gem::Version
|
244
|
-
version:
|
244
|
+
version: 1.3.1
|
245
245
|
requirements: []
|
246
246
|
rubygems_version: 3.1.2
|
247
|
-
signing_key:
|
247
|
+
signing_key:
|
248
248
|
specification_version: 4
|
249
249
|
summary: MessagePack, a binary-based efficient data interchange format.
|
250
250
|
test_files:
|