msgpack 1.4.3 → 1.5.0
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/.github/workflows/ci.yaml +7 -6
- data/ChangeLog +18 -0
- data/README.md +22 -0
- data/Rakefile +1 -2
- data/doclib/msgpack/factory.rb +46 -3
- data/doclib/msgpack/packer.rb +5 -4
- data/doclib/msgpack/unpacker.rb +2 -2
- data/ext/java/org/msgpack/jruby/Buffer.java +6 -0
- data/ext/java/org/msgpack/jruby/Decoder.java +23 -19
- data/ext/java/org/msgpack/jruby/Encoder.java +45 -18
- data/ext/java/org/msgpack/jruby/ExtensionRegistry.java +28 -40
- data/ext/java/org/msgpack/jruby/Factory.java +40 -5
- data/ext/java/org/msgpack/jruby/Packer.java +21 -11
- data/ext/java/org/msgpack/jruby/Unpacker.java +44 -22
- data/ext/msgpack/buffer.h +2 -2
- data/ext/msgpack/buffer_class.c +23 -15
- data/ext/msgpack/factory_class.c +78 -16
- data/ext/msgpack/packer.c +42 -5
- data/ext/msgpack/packer.h +24 -0
- data/ext/msgpack/packer_class.c +29 -22
- data/ext/msgpack/packer_ext_registry.c +23 -9
- data/ext/msgpack/packer_ext_registry.h +38 -31
- data/ext/msgpack/unpacker.c +37 -19
- data/ext/msgpack/unpacker.h +2 -2
- data/ext/msgpack/unpacker_class.c +26 -45
- data/ext/msgpack/unpacker_ext_registry.c +40 -16
- data/ext/msgpack/unpacker_ext_registry.h +21 -14
- data/lib/msgpack/bigint.rb +69 -0
- data/lib/msgpack/factory.rb +103 -0
- data/lib/msgpack/symbol.rb +8 -1
- data/lib/msgpack/version.rb +1 -1
- data/lib/msgpack.rb +4 -5
- data/msgpack.gemspec +1 -2
- data/spec/bigint_spec.rb +26 -0
- data/spec/factory_spec.rb +263 -14
- data/spec/spec_helper.rb +3 -4
- data/spec/timestamp_spec.rb +0 -2
- data/spec/unpacker_spec.rb +22 -3
- metadata +7 -29
    
        data/spec/timestamp_spec.rb
    CHANGED
    
    
    
        data/spec/unpacker_spec.rb
    CHANGED
    
    | @@ -1,5 +1,3 @@ | |
| 1 | 
            -
            # encoding: ascii-8bit
         | 
| 2 | 
            -
             | 
| 3 1 | 
             
            require 'stringio'
         | 
| 4 2 | 
             
            require 'tempfile'
         | 
| 5 3 | 
             
            require 'zlib'
         | 
| @@ -302,6 +300,21 @@ describe MessagePack::Unpacker do | |
| 302 300 | 
             
                MessagePack.unpack(MessagePack.pack(symbolized_hash), :symbolize_keys => true).should == symbolized_hash
         | 
| 303 301 | 
             
              end
         | 
| 304 302 |  | 
| 303 | 
            +
              it 'MessagePack.unpack symbolize_keys preserve encoding' do
         | 
| 304 | 
            +
                hash = { :ascii => 1, :utf8_é => 2}
         | 
| 305 | 
            +
                loaded_hash = MessagePack.load(MessagePack.pack(hash), :symbolize_keys => true)
         | 
| 306 | 
            +
             | 
| 307 | 
            +
                hash.keys[0].encoding.should == Encoding::US_ASCII # Ruby coerce symbols to US-ASCII when possible.
         | 
| 308 | 
            +
                loaded_hash.keys[0].should == hash.keys[0]
         | 
| 309 | 
            +
                loaded_hash.keys[0].encoding.should == hash.keys[0].encoding
         | 
| 310 | 
            +
             | 
| 311 | 
            +
                hash.keys[1].encoding.should == Encoding::UTF_8
         | 
| 312 | 
            +
                loaded_hash.keys[1].should == hash.keys[1]
         | 
| 313 | 
            +
                loaded_hash.keys[1].encoding.should == hash.keys[1].encoding
         | 
| 314 | 
            +
             | 
| 315 | 
            +
                MessagePack.unpack(MessagePack.pack(hash), :symbolize_keys => true).should == hash
         | 
| 316 | 
            +
              end
         | 
| 317 | 
            +
             | 
| 305 318 | 
             
              it 'Unpacker#unpack symbolize_keys' do
         | 
| 306 319 | 
             
                unpacker = MessagePack::Unpacker.new(:symbolize_keys => true)
         | 
| 307 320 | 
             
                symbolized_hash = {:a => 'b', :c => 'd'}
         | 
| @@ -765,7 +778,13 @@ describe MessagePack::Unpacker do | |
| 765 778 |  | 
| 766 779 | 
             
                context 'binary encoding', :encodings do
         | 
| 767 780 | 
             
                  let :buffer do
         | 
| 768 | 
            -
                    MessagePack.pack({ | 
| 781 | 
            +
                    MessagePack.pack({
         | 
| 782 | 
            +
                      'hello'.b => 'world'.b,
         | 
| 783 | 
            +
                      'nested'.b => [
         | 
| 784 | 
            +
                        'object'.b,
         | 
| 785 | 
            +
                        {'structure'.b => true},
         | 
| 786 | 
            +
                      ]
         | 
| 787 | 
            +
                    })
         | 
| 769 788 | 
             
                  end
         | 
| 770 789 |  | 
| 771 790 | 
             
                  let :unpacker do
         | 
    
        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: 1. | 
| 4 | 
            +
              version: 1.5.0
         | 
| 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: 2022- | 
| 13 | 
            +
            date: 2022-04-06 00:00:00.000000000 Z
         | 
| 14 14 | 
             
            dependencies:
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 16 16 | 
             
              name: bundler
         | 
| @@ -46,14 +46,14 @@ dependencies: | |
| 46 46 | 
             
                requirements:
         | 
| 47 47 | 
             
                - - ">="
         | 
| 48 48 | 
             
                  - !ruby/object:Gem::Version
         | 
| 49 | 
            -
                    version:  | 
| 49 | 
            +
                    version: 1.1.9
         | 
| 50 50 | 
             
              type: :development
         | 
| 51 51 | 
             
              prerelease: false
         | 
| 52 52 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 53 53 | 
             
                requirements:
         | 
| 54 54 | 
             
                - - ">="
         | 
| 55 55 | 
             
                  - !ruby/object:Gem::Version
         | 
| 56 | 
            -
                    version:  | 
| 56 | 
            +
                    version: 1.1.9
         | 
| 57 57 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 58 58 | 
             
              name: rspec
         | 
| 59 59 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -176,6 +176,7 @@ files: | |
| 176 176 | 
             
            - ext/msgpack/unpacker_ext_registry.c
         | 
| 177 177 | 
             
            - ext/msgpack/unpacker_ext_registry.h
         | 
| 178 178 | 
             
            - lib/msgpack.rb
         | 
| 179 | 
            +
            - lib/msgpack/bigint.rb
         | 
| 179 180 | 
             
            - lib/msgpack/core_ext.rb
         | 
| 180 181 | 
             
            - lib/msgpack/factory.rb
         | 
| 181 182 | 
             
            - lib/msgpack/packer.rb
         | 
| @@ -186,6 +187,7 @@ files: | |
| 186 187 | 
             
            - lib/msgpack/version.rb
         | 
| 187 188 | 
             
            - msgpack.gemspec
         | 
| 188 189 | 
             
            - msgpack.org.md
         | 
| 190 | 
            +
            - spec/bigint_spec.rb
         | 
| 189 191 | 
             
            - spec/cases.json
         | 
| 190 192 | 
             
            - spec/cases.msg
         | 
| 191 193 | 
             
            - spec/cases_compact.msg
         | 
| @@ -233,28 +235,4 @@ rubygems_version: 3.3.3 | |
| 233 235 | 
             
            signing_key:
         | 
| 234 236 | 
             
            specification_version: 4
         | 
| 235 237 | 
             
            summary: MessagePack, a binary-based efficient data interchange format.
         | 
| 236 | 
            -
            test_files:
         | 
| 237 | 
            -
            - spec/cases.json
         | 
| 238 | 
            -
            - spec/cases.msg
         | 
| 239 | 
            -
            - spec/cases_compact.msg
         | 
| 240 | 
            -
            - spec/cases_spec.rb
         | 
| 241 | 
            -
            - spec/cruby/buffer_io_spec.rb
         | 
| 242 | 
            -
            - spec/cruby/buffer_packer.rb
         | 
| 243 | 
            -
            - spec/cruby/buffer_spec.rb
         | 
| 244 | 
            -
            - spec/cruby/buffer_unpacker.rb
         | 
| 245 | 
            -
            - spec/cruby/unpacker_spec.rb
         | 
| 246 | 
            -
            - spec/ext_value_spec.rb
         | 
| 247 | 
            -
            - spec/exttypes.rb
         | 
| 248 | 
            -
            - spec/factory_spec.rb
         | 
| 249 | 
            -
            - spec/format_spec.rb
         | 
| 250 | 
            -
            - spec/jruby/benchmarks/shootout_bm.rb
         | 
| 251 | 
            -
            - spec/jruby/benchmarks/symbolize_keys_bm.rb
         | 
| 252 | 
            -
            - spec/jruby/unpacker_spec.rb
         | 
| 253 | 
            -
            - spec/msgpack_spec.rb
         | 
| 254 | 
            -
            - spec/pack_spec.rb
         | 
| 255 | 
            -
            - spec/packer_spec.rb
         | 
| 256 | 
            -
            - spec/random_compat.rb
         | 
| 257 | 
            -
            - spec/spec_helper.rb
         | 
| 258 | 
            -
            - spec/timestamp_spec.rb
         | 
| 259 | 
            -
            - spec/unpack_spec.rb
         | 
| 260 | 
            -
            - spec/unpacker_spec.rb
         | 
| 238 | 
            +
            test_files: []
         |