msgpack 1.5.6 → 1.8.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/ChangeLog +50 -0
- data/README.md +48 -12
- data/ext/java/org/msgpack/jruby/Buffer.java +3 -3
- data/ext/java/org/msgpack/jruby/ExtensionRegistry.java +11 -20
- data/ext/java/org/msgpack/jruby/ExtensionValue.java +1 -1
- data/ext/java/org/msgpack/jruby/Factory.java +11 -50
- data/ext/java/org/msgpack/jruby/Packer.java +9 -24
- data/ext/java/org/msgpack/jruby/Unpacker.java +15 -32
- data/ext/msgpack/buffer.c +69 -56
- data/ext/msgpack/buffer.h +138 -44
- data/ext/msgpack/buffer_class.c +132 -31
- data/ext/msgpack/buffer_class.h +1 -0
- data/ext/msgpack/extconf.rb +20 -30
- data/ext/msgpack/factory_class.c +75 -86
- data/ext/msgpack/packer.c +13 -16
- data/ext/msgpack/packer.h +24 -21
- data/ext/msgpack/packer_class.c +72 -98
- data/ext/msgpack/packer_class.h +11 -0
- data/ext/msgpack/packer_ext_registry.c +31 -28
- data/ext/msgpack/packer_ext_registry.h +10 -14
- data/ext/msgpack/rbinit.c +1 -1
- data/ext/msgpack/rmem.c +3 -4
- data/ext/msgpack/sysdep.h +5 -2
- data/ext/msgpack/unpacker.c +201 -113
- data/ext/msgpack/unpacker.h +22 -15
- data/ext/msgpack/unpacker_class.c +87 -92
- data/ext/msgpack/unpacker_class.h +11 -0
- data/ext/msgpack/unpacker_ext_registry.c +4 -16
- data/ext/msgpack/unpacker_ext_registry.h +3 -7
- data/lib/msgpack/buffer.rb +9 -0
- data/lib/msgpack/factory.rb +90 -63
- data/lib/msgpack/packer.rb +10 -1
- data/lib/msgpack/unpacker.rb +14 -1
- data/lib/msgpack/version.rb +1 -1
- data/lib/msgpack.rb +1 -0
- data/msgpack.gemspec +8 -3
- metadata +21 -51
- data/.github/workflows/ci.yaml +0 -57
- data/.gitignore +0 -23
- data/.rubocop.yml +0 -36
- data/Gemfile +0 -9
- data/Rakefile +0 -70
- data/appveyor.yml +0 -18
- data/bench/bench.rb +0 -78
- data/doclib/msgpack/buffer.rb +0 -193
- data/doclib/msgpack/core_ext.rb +0 -101
- data/doclib/msgpack/error.rb +0 -19
- data/doclib/msgpack/extension_value.rb +0 -9
- data/doclib/msgpack/factory.rb +0 -145
- data/doclib/msgpack/packer.rb +0 -209
- data/doclib/msgpack/time.rb +0 -22
- data/doclib/msgpack/timestamp.rb +0 -44
- data/doclib/msgpack/unpacker.rb +0 -183
- data/doclib/msgpack.rb +0 -87
- data/msgpack.org.md +0 -46
- data/spec/bigint_spec.rb +0 -26
- data/spec/cases.json +0 -1
- data/spec/cases.msg +0 -0
- data/spec/cases_compact.msg +0 -0
- data/spec/cases_spec.rb +0 -39
- data/spec/cruby/buffer_io_spec.rb +0 -255
- data/spec/cruby/buffer_packer.rb +0 -29
- data/spec/cruby/buffer_spec.rb +0 -575
- data/spec/cruby/buffer_unpacker.rb +0 -19
- data/spec/cruby/unpacker_spec.rb +0 -70
- data/spec/ext_value_spec.rb +0 -99
- data/spec/exttypes.rb +0 -51
- data/spec/factory_spec.rb +0 -688
- data/spec/format_spec.rb +0 -301
- data/spec/jruby/benchmarks/shootout_bm.rb +0 -73
- data/spec/jruby/benchmarks/symbolize_keys_bm.rb +0 -25
- data/spec/jruby/unpacker_spec.rb +0 -186
- data/spec/msgpack_spec.rb +0 -214
- data/spec/pack_spec.rb +0 -61
- data/spec/packer_spec.rb +0 -575
- data/spec/random_compat.rb +0 -24
- data/spec/spec_helper.rb +0 -71
- data/spec/timestamp_spec.rb +0 -159
- data/spec/unpack_spec.rb +0 -57
- data/spec/unpacker_spec.rb +0 -859
data/lib/msgpack/factory.rb
CHANGED
@@ -2,11 +2,46 @@ module MessagePack
|
|
2
2
|
class Factory
|
3
3
|
# see ext for other methods
|
4
4
|
|
5
|
+
def register_type(type, klass, options = { packer: :to_msgpack_ext, unpacker: :from_msgpack_ext })
|
6
|
+
raise FrozenError, "can't modify frozen MessagePack::Factory" if frozen?
|
7
|
+
|
8
|
+
if options
|
9
|
+
options = options.dup
|
10
|
+
case packer = options[:packer]
|
11
|
+
when nil, Proc
|
12
|
+
# all good
|
13
|
+
when String, Symbol
|
14
|
+
options[:packer] = packer.to_sym.to_proc
|
15
|
+
when Method
|
16
|
+
options[:packer] = packer.to_proc
|
17
|
+
when packer.respond_to?(:call)
|
18
|
+
options[:packer] = packer.method(:call).to_proc
|
19
|
+
else
|
20
|
+
raise ::TypeError, "expected :packer argument to be a callable object, got: #{packer.inspect}"
|
21
|
+
end
|
22
|
+
|
23
|
+
case unpacker = options[:unpacker]
|
24
|
+
when nil, Proc
|
25
|
+
# all good
|
26
|
+
when String, Symbol
|
27
|
+
options[:unpacker] = klass.method(unpacker).to_proc
|
28
|
+
when Method
|
29
|
+
options[:unpacker] = unpacker.to_proc
|
30
|
+
when packer.respond_to?(:call)
|
31
|
+
options[:unpacker] = unpacker.method(:call).to_proc
|
32
|
+
else
|
33
|
+
raise ::TypeError, "expected :unpacker argument to be a callable object, got: #{unpacker.inspect}"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
register_type_internal(type, klass, options)
|
38
|
+
end
|
39
|
+
|
5
40
|
# [ {type: id, class: Class(or nil), packer: arg, unpacker: arg}, ... ]
|
6
41
|
def registered_types(selector=:both)
|
7
42
|
packer, unpacker = registered_types_internal
|
8
|
-
# packer: Class -> [tid, proc,
|
9
|
-
# unpacker: tid -> [klass, proc,
|
43
|
+
# packer: Class -> [tid, proc, _flags]
|
44
|
+
# unpacker: tid -> [klass, proc, _flags]
|
10
45
|
|
11
46
|
list = []
|
12
47
|
|
@@ -14,27 +49,31 @@ module MessagePack
|
|
14
49
|
when :both
|
15
50
|
packer.each_pair do |klass, ary|
|
16
51
|
type = ary[0]
|
17
|
-
|
18
|
-
|
19
|
-
if unpacker.has_key?(type)
|
20
|
-
|
52
|
+
packer_proc = ary[1]
|
53
|
+
unpacker_proc = nil
|
54
|
+
if unpacker.has_key?(type)
|
55
|
+
unpacker_proc = unpacker.delete(type)[1]
|
21
56
|
end
|
22
|
-
list << {type: type, class: klass, packer:
|
57
|
+
list << {type: type, class: klass, packer: packer_proc, unpacker: unpacker_proc}
|
23
58
|
end
|
24
59
|
|
25
60
|
# unpacker definition only
|
26
61
|
unpacker.each_pair do |type, ary|
|
27
|
-
list << {type: type, class: ary[0], packer: nil, unpacker: ary[
|
62
|
+
list << {type: type, class: ary[0], packer: nil, unpacker: ary[1]}
|
28
63
|
end
|
29
64
|
|
30
65
|
when :packer
|
31
66
|
packer.each_pair do |klass, ary|
|
32
|
-
|
67
|
+
if ary[1]
|
68
|
+
list << {type: ary[0], class: klass, packer: ary[1]}
|
69
|
+
end
|
33
70
|
end
|
34
71
|
|
35
72
|
when :unpacker
|
36
73
|
unpacker.each_pair do |type, ary|
|
37
|
-
|
74
|
+
if ary[1]
|
75
|
+
list << {type: type, class: ary[0], unpacker: ary[1]}
|
76
|
+
end
|
38
77
|
end
|
39
78
|
|
40
79
|
else
|
@@ -88,33 +127,34 @@ module MessagePack
|
|
88
127
|
|
89
128
|
class Pool
|
90
129
|
if RUBY_ENGINE == "ruby"
|
91
|
-
class
|
130
|
+
class MemberPool
|
92
131
|
def initialize(size, &block)
|
93
132
|
@size = size
|
94
133
|
@new_member = block
|
95
134
|
@members = []
|
96
135
|
end
|
97
136
|
|
98
|
-
def
|
99
|
-
@members.pop || @new_member.call
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
137
|
+
def with
|
138
|
+
member = @members.pop || @new_member.call
|
139
|
+
begin
|
140
|
+
yield member
|
141
|
+
ensure
|
142
|
+
# If the pool is already full, we simply drop the extra member.
|
143
|
+
# This is because contrary to a connection pool, creating an extra instance
|
144
|
+
# is extremely unlikely to cause some kind of resource exhaustion.
|
145
|
+
#
|
146
|
+
# We could cycle the members (keep the newer one) but first It's more work and second
|
147
|
+
# the older member might have been created pre-fork, so it might be at least partially
|
148
|
+
# in shared memory.
|
149
|
+
if member && @members.size < @size
|
150
|
+
member.reset
|
151
|
+
@members << member
|
152
|
+
end
|
113
153
|
end
|
114
154
|
end
|
115
155
|
end
|
116
156
|
else
|
117
|
-
class
|
157
|
+
class MemberPool
|
118
158
|
def initialize(size, &block)
|
119
159
|
@size = size
|
120
160
|
@new_member = block
|
@@ -122,63 +162,50 @@ module MessagePack
|
|
122
162
|
@mutex = Mutex.new
|
123
163
|
end
|
124
164
|
|
125
|
-
def
|
126
|
-
@mutex.synchronize { @members.pop } || @new_member.call
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
member.
|
133
|
-
|
165
|
+
def with
|
166
|
+
member = @mutex.synchronize { @members.pop } || @new_member.call
|
167
|
+
begin
|
168
|
+
yield member
|
169
|
+
ensure
|
170
|
+
member.reset
|
171
|
+
@mutex.synchronize do
|
172
|
+
if member && @members.size < @size
|
173
|
+
@members << member
|
174
|
+
end
|
134
175
|
end
|
135
176
|
end
|
136
177
|
end
|
137
178
|
end
|
138
179
|
end
|
139
180
|
|
140
|
-
class PackerPool < AbstractPool
|
141
|
-
private
|
142
|
-
|
143
|
-
def reset(packer)
|
144
|
-
packer.clear
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
class UnpackerPool < AbstractPool
|
149
|
-
private
|
150
|
-
|
151
|
-
def reset(unpacker)
|
152
|
-
unpacker.reset
|
153
|
-
end
|
154
|
-
end
|
155
|
-
|
156
181
|
def initialize(factory, size, options = nil)
|
157
182
|
options = nil if !options || options.empty?
|
158
183
|
@factory = factory
|
159
|
-
@packers =
|
160
|
-
@unpackers =
|
184
|
+
@packers = MemberPool.new(size) { factory.packer(options).freeze }
|
185
|
+
@unpackers = MemberPool.new(size) { factory.unpacker(options).freeze }
|
161
186
|
end
|
162
187
|
|
163
188
|
def load(data)
|
164
|
-
|
165
|
-
|
166
|
-
unpacker.feed_reference(data)
|
189
|
+
@unpackers.with do |unpacker|
|
190
|
+
unpacker.feed(data)
|
167
191
|
unpacker.full_unpack
|
168
|
-
ensure
|
169
|
-
@unpackers.checkin(unpacker)
|
170
192
|
end
|
171
193
|
end
|
172
194
|
|
173
195
|
def dump(object)
|
174
|
-
|
175
|
-
begin
|
196
|
+
@packers.with do |packer|
|
176
197
|
packer.write(object)
|
177
198
|
packer.full_pack
|
178
|
-
ensure
|
179
|
-
@packers.checkin(packer)
|
180
199
|
end
|
181
200
|
end
|
201
|
+
|
202
|
+
def unpacker(&block)
|
203
|
+
@unpackers.with(&block)
|
204
|
+
end
|
205
|
+
|
206
|
+
def packer(&block)
|
207
|
+
@packers.with(&block)
|
208
|
+
end
|
182
209
|
end
|
183
210
|
end
|
184
211
|
end
|
data/lib/msgpack/packer.rb
CHANGED
@@ -2,11 +2,20 @@ module MessagePack
|
|
2
2
|
class Packer
|
3
3
|
# see ext for other methods
|
4
4
|
|
5
|
+
# The semantic of duping a packer is just too weird.
|
6
|
+
undef_method :dup
|
7
|
+
undef_method :clone
|
8
|
+
|
9
|
+
def register_type(type, klass, method_name = nil, &block)
|
10
|
+
raise ArgumentError, "expected Module/Class got: #{klass.inspect}" unless klass.is_a?(Module)
|
11
|
+
register_type_internal(type, klass, block || method_name.to_proc)
|
12
|
+
end
|
13
|
+
|
5
14
|
def registered_types
|
6
15
|
list = []
|
7
16
|
|
8
17
|
registered_types_internal.each_pair do |klass, ary|
|
9
|
-
list << {type: ary[0], class: klass, packer: ary[
|
18
|
+
list << {type: ary[0], class: klass, packer: ary[1]}
|
10
19
|
end
|
11
20
|
|
12
21
|
list.sort{|a, b| a[:type] <=> b[:type] }
|
data/lib/msgpack/unpacker.rb
CHANGED
@@ -2,11 +2,24 @@ module MessagePack
|
|
2
2
|
class Unpacker
|
3
3
|
# see ext for other methods
|
4
4
|
|
5
|
+
# The semantic of duping an unpacker is just too weird.
|
6
|
+
undef_method :dup
|
7
|
+
undef_method :clone
|
8
|
+
|
9
|
+
def register_type(type, klass = nil, method_name = nil, &block)
|
10
|
+
if klass && method_name
|
11
|
+
block = klass.method(method_name).to_proc
|
12
|
+
elsif !block_given?
|
13
|
+
raise ArgumentError, "register_type takes either 3 arguments or a block"
|
14
|
+
end
|
15
|
+
register_type_internal(type, klass, block)
|
16
|
+
end
|
17
|
+
|
5
18
|
def registered_types
|
6
19
|
list = []
|
7
20
|
|
8
21
|
registered_types_internal.each_pair do |type, ary|
|
9
|
-
list << {type: type, class: ary[0], unpacker: ary[
|
22
|
+
list << {type: type, class: ary[0], unpacker: ary[1]}
|
10
23
|
end
|
11
24
|
|
12
25
|
list.sort{|a, b| a[:type] <=> b[:type] }
|
data/lib/msgpack/version.rb
CHANGED
data/lib/msgpack.rb
CHANGED
data/msgpack.gemspec
CHANGED
@@ -12,20 +12,25 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.homepage = "http://msgpack.org/"
|
13
13
|
s.require_paths = ["lib"]
|
14
14
|
if /java/ =~ RUBY_PLATFORM
|
15
|
-
s.files = Dir['lib/**/*.rb', 'lib/**/*.jar']
|
15
|
+
s.files = Dir['lib/**/*.rb', 'lib/**/*.jar', 'LICENSE']
|
16
16
|
s.platform = Gem::Platform.new('java')
|
17
17
|
else
|
18
|
-
s.files = `git ls-files`.split("\
|
18
|
+
s.files = `git ls-files -z`.split("\x0").reject do |f|
|
19
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features|bench|doclib|msgpack.org.md|Gemfile|Rakefile)|\.(?:git|circleci|rubocop)|appveyor)})
|
20
|
+
end
|
19
21
|
s.extensions = ["ext/msgpack/extconf.rb"]
|
20
22
|
end
|
21
23
|
|
22
|
-
s.required_ruby_version = ">= 2.
|
24
|
+
s.required_ruby_version = ">= 2.5"
|
23
25
|
|
24
26
|
s.add_development_dependency 'bundler'
|
25
27
|
s.add_development_dependency 'rake'
|
26
28
|
s.add_development_dependency 'rake-compiler', ['>= 1.1.9']
|
27
29
|
s.add_development_dependency 'rspec', ['~> 3.3']
|
30
|
+
s.add_development_dependency 'ruby_memcheck'
|
28
31
|
s.add_development_dependency 'yard'
|
29
32
|
s.add_development_dependency 'json'
|
30
33
|
s.add_development_dependency 'benchmark-ips', ['~> 2.10.0']
|
34
|
+
|
35
|
+
s.metadata["changelog_uri"] = "https://github.com/msgpack/msgpack-ruby/blob/master/ChangeLog"
|
31
36
|
end
|
metadata
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: msgpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
- Theo Hultberg
|
9
9
|
- Satoshi Tagomori
|
10
|
-
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2025-02-06 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: bundler
|
@@ -68,6 +67,20 @@ dependencies:
|
|
68
67
|
- - "~>"
|
69
68
|
- !ruby/object:Gem::Version
|
70
69
|
version: '3.3'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: ruby_memcheck
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
71
84
|
- !ruby/object:Gem::Dependency
|
72
85
|
name: yard
|
73
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,26 +135,9 @@ extensions:
|
|
122
135
|
- ext/msgpack/extconf.rb
|
123
136
|
extra_rdoc_files: []
|
124
137
|
files:
|
125
|
-
- ".github/workflows/ci.yaml"
|
126
|
-
- ".gitignore"
|
127
|
-
- ".rubocop.yml"
|
128
138
|
- ChangeLog
|
129
|
-
- Gemfile
|
130
139
|
- LICENSE
|
131
140
|
- README.md
|
132
|
-
- Rakefile
|
133
|
-
- appveyor.yml
|
134
|
-
- bench/bench.rb
|
135
|
-
- doclib/msgpack.rb
|
136
|
-
- doclib/msgpack/buffer.rb
|
137
|
-
- doclib/msgpack/core_ext.rb
|
138
|
-
- doclib/msgpack/error.rb
|
139
|
-
- doclib/msgpack/extension_value.rb
|
140
|
-
- doclib/msgpack/factory.rb
|
141
|
-
- doclib/msgpack/packer.rb
|
142
|
-
- doclib/msgpack/time.rb
|
143
|
-
- doclib/msgpack/timestamp.rb
|
144
|
-
- doclib/msgpack/unpacker.rb
|
145
141
|
- ext/java/org/msgpack/jruby/Buffer.java
|
146
142
|
- ext/java/org/msgpack/jruby/Decoder.java
|
147
143
|
- ext/java/org/msgpack/jruby/Encoder.java
|
@@ -182,6 +178,7 @@ files:
|
|
182
178
|
- ext/msgpack/unpacker_ext_registry.h
|
183
179
|
- lib/msgpack.rb
|
184
180
|
- lib/msgpack/bigint.rb
|
181
|
+
- lib/msgpack/buffer.rb
|
185
182
|
- lib/msgpack/core_ext.rb
|
186
183
|
- lib/msgpack/factory.rb
|
187
184
|
- lib/msgpack/packer.rb
|
@@ -191,37 +188,11 @@ files:
|
|
191
188
|
- lib/msgpack/unpacker.rb
|
192
189
|
- lib/msgpack/version.rb
|
193
190
|
- msgpack.gemspec
|
194
|
-
- msgpack.org.md
|
195
|
-
- spec/bigint_spec.rb
|
196
|
-
- spec/cases.json
|
197
|
-
- spec/cases.msg
|
198
|
-
- spec/cases_compact.msg
|
199
|
-
- spec/cases_spec.rb
|
200
|
-
- spec/cruby/buffer_io_spec.rb
|
201
|
-
- spec/cruby/buffer_packer.rb
|
202
|
-
- spec/cruby/buffer_spec.rb
|
203
|
-
- spec/cruby/buffer_unpacker.rb
|
204
|
-
- spec/cruby/unpacker_spec.rb
|
205
|
-
- spec/ext_value_spec.rb
|
206
|
-
- spec/exttypes.rb
|
207
|
-
- spec/factory_spec.rb
|
208
|
-
- spec/format_spec.rb
|
209
|
-
- spec/jruby/benchmarks/shootout_bm.rb
|
210
|
-
- spec/jruby/benchmarks/symbolize_keys_bm.rb
|
211
|
-
- spec/jruby/unpacker_spec.rb
|
212
|
-
- spec/msgpack_spec.rb
|
213
|
-
- spec/pack_spec.rb
|
214
|
-
- spec/packer_spec.rb
|
215
|
-
- spec/random_compat.rb
|
216
|
-
- spec/spec_helper.rb
|
217
|
-
- spec/timestamp_spec.rb
|
218
|
-
- spec/unpack_spec.rb
|
219
|
-
- spec/unpacker_spec.rb
|
220
191
|
homepage: http://msgpack.org/
|
221
192
|
licenses:
|
222
193
|
- Apache 2.0
|
223
|
-
metadata:
|
224
|
-
|
194
|
+
metadata:
|
195
|
+
changelog_uri: https://github.com/msgpack/msgpack-ruby/blob/master/ChangeLog
|
225
196
|
rdoc_options: []
|
226
197
|
require_paths:
|
227
198
|
- lib
|
@@ -229,15 +200,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
229
200
|
requirements:
|
230
201
|
- - ">="
|
231
202
|
- !ruby/object:Gem::Version
|
232
|
-
version: '2.
|
203
|
+
version: '2.5'
|
233
204
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
234
205
|
requirements:
|
235
206
|
- - ">="
|
236
207
|
- !ruby/object:Gem::Version
|
237
208
|
version: '0'
|
238
209
|
requirements: []
|
239
|
-
rubygems_version: 3.
|
240
|
-
signing_key:
|
210
|
+
rubygems_version: 3.6.2
|
241
211
|
specification_version: 4
|
242
212
|
summary: MessagePack, a binary-based efficient data interchange format.
|
243
213
|
test_files: []
|
data/.github/workflows/ci.yaml
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
name: ci
|
2
|
-
|
3
|
-
on:
|
4
|
-
pull_request:
|
5
|
-
branches: '*'
|
6
|
-
push:
|
7
|
-
branches:
|
8
|
-
- master
|
9
|
-
- main
|
10
|
-
- 'release-*'
|
11
|
-
|
12
|
-
jobs:
|
13
|
-
mri:
|
14
|
-
strategy:
|
15
|
-
fail-fast: false
|
16
|
-
matrix:
|
17
|
-
os: [ubuntu, macos, windows]
|
18
|
-
ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1']
|
19
|
-
runs-on: ${{ matrix.os }}-latest
|
20
|
-
steps:
|
21
|
-
- uses: actions/checkout@v2
|
22
|
-
- uses: ruby/setup-ruby@v1
|
23
|
-
with:
|
24
|
-
ruby-version: ${{ matrix.ruby }}
|
25
|
-
bundler-cache: true # 'bundle install' and cache
|
26
|
-
- run: bundle exec rake
|
27
|
-
|
28
|
-
other:
|
29
|
-
strategy:
|
30
|
-
fail-fast: false
|
31
|
-
matrix:
|
32
|
-
os: [ubuntu]
|
33
|
-
ruby: ['jruby-9.2.19.0', 'jruby-9.3.3.0', 'truffleruby']
|
34
|
-
runs-on: ${{ matrix.os }}-latest
|
35
|
-
steps:
|
36
|
-
- uses: actions/checkout@v2
|
37
|
-
- uses: ruby/setup-ruby@v1
|
38
|
-
with:
|
39
|
-
ruby-version: ${{ matrix.ruby }}
|
40
|
-
bundler-cache: true # 'bundle install' and cache
|
41
|
-
- run: bundle exec rake spec
|
42
|
-
|
43
|
-
head-versions:
|
44
|
-
continue-on-error: true
|
45
|
-
strategy:
|
46
|
-
fail-fast: false
|
47
|
-
matrix:
|
48
|
-
os: [ubuntu]
|
49
|
-
ruby: ['ruby-head', 'jruby-head']
|
50
|
-
runs-on: ${{ matrix.os }}-latest
|
51
|
-
steps:
|
52
|
-
- uses: actions/checkout@v2
|
53
|
-
- uses: ruby/setup-ruby@v1
|
54
|
-
with:
|
55
|
-
ruby-version: ${{ matrix.ruby }}
|
56
|
-
bundler-cache: true # 'bundle install' and cache
|
57
|
-
- run: bundle exec rake spec || echo "failed, but ignore it"
|
data/.gitignore
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
*.o
|
2
|
-
*.so
|
3
|
-
*.bundle
|
4
|
-
*.gem
|
5
|
-
*.class
|
6
|
-
*.jar
|
7
|
-
doc
|
8
|
-
.yardoc
|
9
|
-
.bundle
|
10
|
-
Gemfile*
|
11
|
-
pkg
|
12
|
-
test/debug.log
|
13
|
-
*~
|
14
|
-
*.swp
|
15
|
-
/rdoc
|
16
|
-
tmp
|
17
|
-
.classpath
|
18
|
-
.project
|
19
|
-
.settings
|
20
|
-
/nbproject/private/
|
21
|
-
coverage/
|
22
|
-
.idea/
|
23
|
-
.ruby-version
|
data/.rubocop.yml
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
-
# on 2015-03-09 17:42:55 +0100 using RuboCop version 0.29.1.
|
3
|
-
# The point is for the user to remove these configuration records
|
4
|
-
# one by one as the offenses are removed from the code base.
|
5
|
-
# Note that changes in the inspected code, or installation of new
|
6
|
-
# versions of RuboCop, may require this file to be generated again.
|
7
|
-
|
8
|
-
AllCops:
|
9
|
-
TargetRubyVersion: 2.4
|
10
|
-
|
11
|
-
# Offense count: 3
|
12
|
-
Lint/AmbiguousOperator:
|
13
|
-
Enabled: false
|
14
|
-
|
15
|
-
# Offense count: 1
|
16
|
-
# Configuration parameters: AllowSafeAssignment.
|
17
|
-
Lint/AssignmentInCondition:
|
18
|
-
Enabled: false
|
19
|
-
|
20
|
-
# Offense count: 1
|
21
|
-
Security/Eval:
|
22
|
-
Enabled: false
|
23
|
-
|
24
|
-
# Offense count: 3
|
25
|
-
# Cop supports --auto-correct.
|
26
|
-
Lint/UnusedBlockArgument:
|
27
|
-
Enabled: false
|
28
|
-
|
29
|
-
# Offense count: 35
|
30
|
-
# Cop supports --auto-correct.
|
31
|
-
Lint/UnusedMethodArgument:
|
32
|
-
Enabled: false
|
33
|
-
|
34
|
-
# Offense count: 128
|
35
|
-
Lint/Void:
|
36
|
-
Enabled: false
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'bundler'
|
3
|
-
Bundler::GemHelper.install_tasks
|
4
|
-
|
5
|
-
require 'fileutils'
|
6
|
-
|
7
|
-
require 'rspec/core'
|
8
|
-
require 'rspec/core/rake_task'
|
9
|
-
require 'yard'
|
10
|
-
|
11
|
-
task :spec => :compile
|
12
|
-
|
13
|
-
desc 'Run RSpec code examples and measure coverage'
|
14
|
-
task :coverage do |t|
|
15
|
-
ENV['SIMPLE_COV'] = '1'
|
16
|
-
Rake::Task["spec"].invoke
|
17
|
-
end
|
18
|
-
|
19
|
-
desc 'Generate YARD document'
|
20
|
-
YARD::Rake::YardocTask.new(:doc) do |t|
|
21
|
-
t.files = ['lib/msgpack/version.rb','doclib/**/*.rb']
|
22
|
-
t.options = []
|
23
|
-
t.options << '--debug' << '--verbose' if $trace
|
24
|
-
end
|
25
|
-
|
26
|
-
spec = eval File.read("msgpack.gemspec")
|
27
|
-
|
28
|
-
if RUBY_PLATFORM =~ /java/
|
29
|
-
require 'rake/javaextensiontask'
|
30
|
-
|
31
|
-
Rake::JavaExtensionTask.new('msgpack', spec) do |ext|
|
32
|
-
ext.ext_dir = 'ext/java'
|
33
|
-
jruby_home = RbConfig::CONFIG['prefix']
|
34
|
-
jars = ["#{jruby_home}/lib/jruby.jar"]
|
35
|
-
ext.classpath = jars.map { |x| File.expand_path(x) }.join(':')
|
36
|
-
ext.lib_dir = File.join(*['lib', 'msgpack', ENV['FAT_DIR']].compact)
|
37
|
-
ext.release = '8'
|
38
|
-
end
|
39
|
-
else
|
40
|
-
require 'rake/extensiontask'
|
41
|
-
|
42
|
-
Rake::ExtensionTask.new('msgpack', spec) do |ext|
|
43
|
-
ext.ext_dir = 'ext/msgpack'
|
44
|
-
ext.cross_compile = true
|
45
|
-
ext.lib_dir = File.join(*['lib', 'msgpack', ENV['FAT_DIR']].compact)
|
46
|
-
# cross_platform names are of MRI's platform name
|
47
|
-
ext.cross_platform = ['x86-mingw32', 'x64-mingw32']
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
test_pattern = case
|
52
|
-
when RUBY_PLATFORM =~ /java/ then 'spec/{,jruby/}*_spec.rb'
|
53
|
-
when RUBY_ENGINE =~ /rbx/ then 'spec/*_spec.rb'
|
54
|
-
else 'spec/{,cruby/}*_spec.rb' # MRI
|
55
|
-
end
|
56
|
-
RSpec::Core::RakeTask.new(:spec) do |t|
|
57
|
-
t.rspec_opts = ["-c", "-f progress"]
|
58
|
-
t.rspec_opts << "-Ilib"
|
59
|
-
t.pattern = test_pattern
|
60
|
-
t.verbose = true
|
61
|
-
end
|
62
|
-
|
63
|
-
namespace :build do
|
64
|
-
desc 'Build gem for JRuby after cleaning'
|
65
|
-
task :java => [:clean, :spec, :build]
|
66
|
-
end
|
67
|
-
|
68
|
-
CLEAN.include('lib/msgpack/msgpack.*')
|
69
|
-
|
70
|
-
task :default => [:spec, :build, :doc]
|
data/appveyor.yml
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
---
|
2
|
-
install:
|
3
|
-
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
|
4
|
-
- ruby --version
|
5
|
-
- gem --version
|
6
|
-
- bundle install
|
7
|
-
build: off
|
8
|
-
test_script:
|
9
|
-
- bundle exec rake -rdevkit
|
10
|
-
|
11
|
-
environment:
|
12
|
-
matrix:
|
13
|
-
- ruby_version: "200"
|
14
|
-
- ruby_version: "200-x64"
|
15
|
-
- ruby_version: "21"
|
16
|
-
- ruby_version: "21-x64"
|
17
|
-
- ruby_version: "22"
|
18
|
-
- ruby_version: "22-x64"
|