msgpack 1.3.3 → 1.4.0.pre1

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
  SHA256:
3
- metadata.gz: 40d206a80a2ab99957b78f2d054417dc273933da4accf5f39a25ff4b16ec30ce
4
- data.tar.gz: e39c06187017d057a44e71d3690662455934c2c1acafc667d49e91aaf626fbd9
3
+ metadata.gz: dce37069bf08ffa0b29a76363cee45e3d8e19188236d673dc1c9b4172727738c
4
+ data.tar.gz: 3c30d3ac0b3a3b4f5432e958935370f2e55d16ce516bf6a91eb12382aad38d8b
5
5
  SHA512:
6
- metadata.gz: d20c8da71f90435f264c0e1c9c90e4a5c8c09c014d33076149e6e5faa3b849ac5192d2f086b917f09eb199bcfd8cc748093d6f59e3f5fcb7c228199f549c23c5
7
- data.tar.gz: dd5c662d5abbf45901d59a7400f2b92a6c296b2298035fecc55a31f82b19b4e9206ca3b0a7cab090d9cc9768bea015b74ad9bf5a997a763eb6ba3387b6a7fc30
6
+ metadata.gz: 53d062f57dcd7324a04224c16dedbe7aa0188515d595f5a38ca543e0b956db8bbd3906a59cf3faceb5c0fb3b23d10be47bb34d19146c61923818f8f856c0a726
7
+ data.tar.gz: 408bcb8f9cde8c88ac6a0620a8a64c746e34723b582aa160b53687f7b5206a9cdcf97efb97eafcf6357cee6412ae3d0346a952e97b979f7c4eeffe23150d7ec4
@@ -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.3
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
- Lint/Eval:
21
+ Security/Eval:
22
22
  Enabled: false
23
23
 
24
24
  # Offense count: 3
@@ -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.3
20
+ - rvm: 2.5.8
25
21
  os: linux
26
- - rvm: 2.6.1
22
+ - rvm: 2.6.6
27
23
  os: linux
28
- - rvm: 2.6.1
24
+ - rvm: 2.6.6
29
25
  os: osx
30
- - rvm: ruby-head
26
+ - rvm: 2.7.1
31
27
  os: linux
32
- - rvm: jruby-9.1.9.0
28
+ - rvm: ruby-head
33
29
  os: linux
34
30
  - rvm: jruby-head
35
31
  os: linux
@@ -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
@@ -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
  }
@@ -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
- begin
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"
@@ -1,5 +1,5 @@
1
1
  module MessagePack
2
- VERSION = "1.3.3"
2
+ VERSION = "1.4.0.pre1"
3
3
 
4
4
  # NOTE for msgpack-ruby maintainer:
5
5
  # Check these things to release new binaryes for new Ruby versions (especially for Windows):
@@ -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
@@ -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.3.3
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-02-05 00:00:00.000000000 Z
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: '0'
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: