bindata 2.4.10 → 2.4.15
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.rdoc +28 -0
- data/LICENSE +25 -0
- data/NEWS.rdoc +5 -0
- data/README.md +3 -3
- data/bindata.gemspec +7 -2
- data/examples/NBT.txt +1 -1
- data/lib/bindata/bits.rb +10 -10
- data/lib/bindata/delayed_io.rb +9 -1
- data/lib/bindata/dsl.rb +3 -3
- data/lib/bindata/int.rb +5 -7
- data/lib/bindata/params.rb +1 -1
- data/lib/bindata/struct.rb +9 -2
- data/lib/bindata/version.rb +1 -1
- data/test/alignment_test.rb +8 -8
- data/test/array_test.rb +88 -88
- data/test/base_primitive_test.rb +47 -47
- data/test/base_test.rb +24 -24
- data/test/bits_test.rb +15 -15
- data/test/buffer_test.rb +22 -22
- data/test/choice_test.rb +31 -31
- data/test/count_bytes_remaining_test.rb +8 -8
- data/test/delayed_io_test.rb +75 -30
- data/test/float_test.rb +8 -8
- data/test/int_test.rb +14 -14
- data/test/io_test.rb +105 -105
- data/test/lazy_test.rb +38 -38
- data/test/offset_test.rb +8 -8
- data/test/params_test.rb +19 -19
- data/test/primitive_test.rb +26 -26
- data/test/record_test.rb +99 -99
- data/test/registry_test.rb +42 -42
- data/test/rest_test.rb +5 -5
- data/test/skip_test.rb +17 -17
- data/test/string_test.rb +56 -56
- data/test/stringz_test.rb +26 -26
- data/test/struct_test.rb +85 -85
- data/test/system_test.rb +40 -40
- data/test/test_helper.rb +2 -2
- data/test/uint8_array_test.rb +6 -6
- data/test/virtual_test.rb +7 -7
- data/test/warnings_test.rb +2 -2
- metadata +6 -10
- data/.gitignore +0 -2
- data/.travis.yml +0 -15
- data/BSDL +0 -22
- data/COPYING +0 -52
- data/INSTALL +0 -12
data/test/system_test.rb
CHANGED
|
@@ -11,18 +11,18 @@ describe "lambdas with index" do
|
|
|
11
11
|
arr = BinData::Array.new(type:
|
|
12
12
|
[:uint8, { value: -> { index * 10 } }],
|
|
13
13
|
initial_length: 3)
|
|
14
|
-
arr.snapshot.must_equal [0, 10, 20]
|
|
14
|
+
_(arr.snapshot).must_equal [0, 10, 20]
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
it "uses index of nearest containing array" do
|
|
18
18
|
arr = BinData::Array.new(type: :nested_lambda_with_index,
|
|
19
19
|
initial_length: 3)
|
|
20
|
-
arr.snapshot.must_equal [{a: 0}, {a: 10}, {a: 20}]
|
|
20
|
+
_(arr.snapshot).must_equal [{a: 0}, {a: 10}, {a: 20}]
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
it "fails if there is no containing array" do
|
|
24
24
|
obj = NestedLambdaWithIndex.new
|
|
25
|
-
|
|
25
|
+
_ { obj.a.to_s }.must_raise NoMethodError
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
@@ -39,7 +39,7 @@ describe "lambdas with parent" do
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
obj = TestLambdaWithoutParent.new
|
|
42
|
-
obj.x.b.must_equal 5
|
|
42
|
+
_(obj.x.b).must_equal 5
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
it "accesses parent's parent when parent is specified" do
|
|
@@ -54,7 +54,7 @@ describe "lambdas with parent" do
|
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
obj = TestLambdaWithParent.new
|
|
57
|
-
obj.x.b.must_equal 3
|
|
57
|
+
_(obj.x.b).must_equal 3
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
|
|
@@ -82,18 +82,18 @@ describe BinData::Record, "with choice field" do
|
|
|
82
82
|
it "treats choice object transparently " do
|
|
83
83
|
obj = RecordWithChoiceField.new
|
|
84
84
|
|
|
85
|
-
obj.x.a.must_equal 3
|
|
85
|
+
_(obj.x.a).must_equal 3
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
it "treats nested choice object transparently " do
|
|
89
89
|
obj = RecordWithNestedChoiceField.new
|
|
90
90
|
|
|
91
|
-
obj.x.a.must_equal 3
|
|
91
|
+
_(obj.x.a).must_equal 3
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
it "has correct offset" do
|
|
95
95
|
obj = RecordWithNestedChoiceField.new
|
|
96
|
-
obj.x.b.abs_offset.must_equal 2
|
|
96
|
+
_(obj.x.b.abs_offset).must_equal 2
|
|
97
97
|
end
|
|
98
98
|
end
|
|
99
99
|
|
|
@@ -132,17 +132,17 @@ describe BinData::Record, "containing bitfields" do
|
|
|
132
132
|
let(:obj) { BitfieldRecord.new }
|
|
133
133
|
|
|
134
134
|
it "has correct num_bytes" do
|
|
135
|
-
obj.num_bytes.must_equal 5
|
|
135
|
+
_(obj.num_bytes).must_equal 5
|
|
136
136
|
end
|
|
137
137
|
|
|
138
138
|
it "reads across bitfield boundaries" do
|
|
139
139
|
obj.read [0b0111_0010, 0b0110_0101, 0b0010_1010, 0b1000_0101, 0b1000_0000].pack("CCCCC")
|
|
140
140
|
|
|
141
|
-
obj.a.w.must_equal 7
|
|
142
|
-
obj.b.must_equal [0, 0, 1, 0, 0, 1, 1, 0, 0]
|
|
143
|
-
obj.c.x.must_equal 2
|
|
144
|
-
obj.d.must_equal 954
|
|
145
|
-
obj.e.must_equal 11
|
|
141
|
+
_(obj.a.w).must_equal 7
|
|
142
|
+
_(obj.b).must_equal [0, 0, 1, 0, 0, 1, 1, 0, 0]
|
|
143
|
+
_(obj.c.x).must_equal 2
|
|
144
|
+
_(obj.d).must_equal 954
|
|
145
|
+
_(obj.e).must_equal 11
|
|
146
146
|
end
|
|
147
147
|
|
|
148
148
|
it "writes across bitfield boundaries" do
|
|
@@ -152,37 +152,37 @@ describe BinData::Record, "containing bitfields" do
|
|
|
152
152
|
obj.c.x = 1
|
|
153
153
|
obj.d = 850
|
|
154
154
|
obj.e = 35
|
|
155
|
-
obj.to_binary_s.must_equal_binary [0b0011_0010, 0b0100_0011, 0b0000_1010, 0b0001_0001, 0b1000_0000].pack("CCCCC")
|
|
155
|
+
_(obj.to_binary_s).must_equal_binary [0b0011_0010, 0b0100_0011, 0b0000_1010, 0b0001_0001, 0b1000_0000].pack("CCCCC")
|
|
156
156
|
end
|
|
157
157
|
end
|
|
158
158
|
|
|
159
159
|
describe "Objects with debug_name" do
|
|
160
160
|
it "haves default name of obj" do
|
|
161
161
|
el = BinData::Uint8.new
|
|
162
|
-
el.debug_name.must_equal "obj"
|
|
162
|
+
_(el.debug_name).must_equal "obj"
|
|
163
163
|
end
|
|
164
164
|
|
|
165
165
|
it "includes array index" do
|
|
166
166
|
arr = BinData::Array.new(type: :uint8, initial_length: 2)
|
|
167
|
-
arr[2].debug_name.must_equal "obj[2]"
|
|
167
|
+
_(arr[2].debug_name).must_equal "obj[2]"
|
|
168
168
|
end
|
|
169
169
|
|
|
170
170
|
it "includes field name" do
|
|
171
171
|
s = BinData::Struct.new(fields: [[:uint8, :a]])
|
|
172
|
-
s.a.debug_name.must_equal "obj.a"
|
|
172
|
+
_(s.a.debug_name).must_equal "obj.a"
|
|
173
173
|
end
|
|
174
174
|
|
|
175
175
|
it "delegates to choice" do
|
|
176
176
|
choice_params = {choices: [:uint8], selection: 0}
|
|
177
177
|
s = BinData::Struct.new(fields: [[:choice, :a, choice_params]])
|
|
178
|
-
s.a.debug_name.must_equal "obj.a"
|
|
178
|
+
_(s.a.debug_name).must_equal "obj.a"
|
|
179
179
|
end
|
|
180
180
|
|
|
181
181
|
it "nests" do
|
|
182
182
|
nested_struct_params = {fields: [[:uint8, :c]]}
|
|
183
183
|
struct_params = {fields: [[:struct, :b, nested_struct_params]]}
|
|
184
184
|
s = BinData::Struct.new(fields: [[:struct, :a, struct_params]])
|
|
185
|
-
s.a.b.c.debug_name.must_equal "obj.a.b.c"
|
|
185
|
+
_(s.a.b.c.debug_name).must_equal "obj.a.b.c"
|
|
186
186
|
end
|
|
187
187
|
end
|
|
188
188
|
|
|
@@ -194,7 +194,7 @@ describe "Tracing" do
|
|
|
194
194
|
BinData::trace_reading(io) { arr.read("\x01\x02\x03\x04\x05") }
|
|
195
195
|
|
|
196
196
|
expected = (0..4).collect { |i| "obj[#{i}] => #{i + 1}\n" }.join("")
|
|
197
|
-
io.value.must_equal expected
|
|
197
|
+
_(io.value).must_equal expected
|
|
198
198
|
end
|
|
199
199
|
|
|
200
200
|
it "traces custom single values" do
|
|
@@ -209,7 +209,7 @@ describe "Tracing" do
|
|
|
209
209
|
io = StringIO.new
|
|
210
210
|
BinData::trace_reading(io) { obj.read("\x01") }
|
|
211
211
|
|
|
212
|
-
io.value.must_equal ["obj-internal-.ex => 1\n", "obj => 1\n"].join("")
|
|
212
|
+
_(io.value).must_equal ["obj-internal-.ex => 1\n", "obj => 1\n"].join("")
|
|
213
213
|
end
|
|
214
214
|
|
|
215
215
|
it "traces choice selection" do
|
|
@@ -218,7 +218,7 @@ describe "Tracing" do
|
|
|
218
218
|
io = StringIO.new
|
|
219
219
|
BinData::trace_reading(io) { obj.read("\x01") }
|
|
220
220
|
|
|
221
|
-
io.value.must_equal ["obj-selection- => 0\n", "obj => 1\n"].join("")
|
|
221
|
+
_(io.value).must_equal ["obj-selection- => 0\n", "obj => 1\n"].join("")
|
|
222
222
|
end
|
|
223
223
|
|
|
224
224
|
it "trims long trace values" do
|
|
@@ -227,7 +227,7 @@ describe "Tracing" do
|
|
|
227
227
|
io = StringIO.new
|
|
228
228
|
BinData::trace_reading(io) { obj.read("0000000000111111111122222222223333333333") }
|
|
229
229
|
|
|
230
|
-
io.value.must_equal "obj => \"000000000011111111112222222222...\n"
|
|
230
|
+
_(io.value).must_equal "obj => \"000000000011111111112222222222...\n"
|
|
231
231
|
end
|
|
232
232
|
end
|
|
233
233
|
|
|
@@ -240,17 +240,17 @@ describe "Forward referencing with Primitive" do
|
|
|
240
240
|
let(:obj) { FRPrimitive.new }
|
|
241
241
|
|
|
242
242
|
it "initialises" do
|
|
243
|
-
obj.snapshot.must_equal({len: 0, data: ""})
|
|
243
|
+
_(obj.snapshot).must_equal({len: 0, data: ""})
|
|
244
244
|
end
|
|
245
245
|
|
|
246
246
|
it "reads" do
|
|
247
247
|
obj.read("\x04test")
|
|
248
|
-
obj.snapshot.must_equal({len: 4, data: "test"})
|
|
248
|
+
_(obj.snapshot).must_equal({len: 4, data: "test"})
|
|
249
249
|
end
|
|
250
250
|
|
|
251
251
|
it "sets value" do
|
|
252
252
|
obj.data = "hello"
|
|
253
|
-
obj.snapshot.must_equal({len: 5, data: "hello"})
|
|
253
|
+
_(obj.snapshot).must_equal({len: 5, data: "hello"})
|
|
254
254
|
end
|
|
255
255
|
end
|
|
256
256
|
|
|
@@ -263,17 +263,17 @@ describe "Forward referencing with Array" do
|
|
|
263
263
|
let(:obj) { FRArray.new }
|
|
264
264
|
|
|
265
265
|
it "initialises" do
|
|
266
|
-
obj.snapshot.must_equal({len: 0, data: []})
|
|
266
|
+
_(obj.snapshot).must_equal({len: 0, data: []})
|
|
267
267
|
end
|
|
268
268
|
|
|
269
269
|
it "reads" do
|
|
270
270
|
obj.read("\x04\x01\x02\x03\x04")
|
|
271
|
-
obj.snapshot.must_equal({len: 4, data: [1, 2, 3, 4]})
|
|
271
|
+
_(obj.snapshot).must_equal({len: 4, data: [1, 2, 3, 4]})
|
|
272
272
|
end
|
|
273
273
|
|
|
274
274
|
it "sets value" do
|
|
275
275
|
obj.data = [1, 2, 3]
|
|
276
|
-
obj.snapshot.must_equal({len: 3, data: [1, 2, 3]})
|
|
276
|
+
_(obj.snapshot).must_equal({len: 3, data: [1, 2, 3]})
|
|
277
277
|
end
|
|
278
278
|
end
|
|
279
279
|
|
|
@@ -288,7 +288,7 @@ describe "Evaluating custom parameters" do
|
|
|
288
288
|
|
|
289
289
|
it "recursively evaluates parameter" do
|
|
290
290
|
obj = CustomParameterRecord.new(zz: 5)
|
|
291
|
-
obj.c.eval_parameter(:custom).must_equal 5
|
|
291
|
+
_(obj.c.eval_parameter(:custom)).must_equal 5
|
|
292
292
|
end
|
|
293
293
|
end
|
|
294
294
|
|
|
@@ -299,7 +299,7 @@ describe BinData::Record, "with custom sized integers" do
|
|
|
299
299
|
|
|
300
300
|
it "reads as expected" do
|
|
301
301
|
str = "\x00\x00\x00\x00\x05"
|
|
302
|
-
CustomIntRecord.read(str).snapshot.must_equal({a: 5})
|
|
302
|
+
_(CustomIntRecord.read(str).snapshot).must_equal({a: 5})
|
|
303
303
|
end
|
|
304
304
|
end
|
|
305
305
|
|
|
@@ -330,11 +330,11 @@ describe BinData::Primitive, "representing a string" do
|
|
|
330
330
|
let(:obj) { PascalStringPrimitive.new("testing") }
|
|
331
331
|
|
|
332
332
|
it "compares to regexp" do
|
|
333
|
-
(obj =~ /es/).must_equal 1
|
|
333
|
+
_((obj =~ /es/)).must_equal 1
|
|
334
334
|
end
|
|
335
335
|
|
|
336
336
|
it "compares to regexp" do
|
|
337
|
-
(/es/ =~ obj).must_equal 1
|
|
337
|
+
_((/es/ =~ obj)).must_equal 1
|
|
338
338
|
end
|
|
339
339
|
end
|
|
340
340
|
|
|
@@ -347,17 +347,17 @@ describe BinData::Record, "with boolean parameters" do
|
|
|
347
347
|
|
|
348
348
|
it "uses default parameter" do
|
|
349
349
|
obj = BooleanParameterRecord.new
|
|
350
|
-
obj.a.must_equal 2
|
|
350
|
+
_(obj.a).must_equal 2
|
|
351
351
|
end
|
|
352
352
|
|
|
353
353
|
it "overrides parameter" do
|
|
354
354
|
obj = BooleanParameterRecord.new(flag: false)
|
|
355
|
-
obj.a.must_equal 3
|
|
355
|
+
_(obj.a).must_equal 3
|
|
356
356
|
end
|
|
357
357
|
|
|
358
358
|
it "overrides parameter with same value" do
|
|
359
359
|
obj = BooleanParameterRecord.new(flag: true)
|
|
360
|
-
obj.a.must_equal 2
|
|
360
|
+
_(obj.a).must_equal 2
|
|
361
361
|
end
|
|
362
362
|
end
|
|
363
363
|
|
|
@@ -372,12 +372,12 @@ describe BinData::Record, "encoding" do
|
|
|
372
372
|
|
|
373
373
|
it "returns binary encoded data" do
|
|
374
374
|
obj = EncodingTestBufferRecord.new(num: 3)
|
|
375
|
-
obj.to_binary_s.encoding.must_equal Encoding::ASCII_8BIT
|
|
375
|
+
_(obj.to_binary_s.encoding).must_equal Encoding::ASCII_8BIT
|
|
376
376
|
end
|
|
377
377
|
|
|
378
378
|
it "returns binary encoded data with utf-8 string" do
|
|
379
379
|
obj = EncodingTestBufferRecord.new(num: 3, str: "日本語")
|
|
380
|
-
obj.to_binary_s.encoding.must_equal Encoding::ASCII_8BIT
|
|
380
|
+
_(obj.to_binary_s.encoding).must_equal Encoding::ASCII_8BIT
|
|
381
381
|
end
|
|
382
382
|
|
|
383
383
|
it "returns binary encoded data despite Encoding.default_internal" do
|
|
@@ -387,7 +387,7 @@ describe BinData::Record, "encoding" do
|
|
|
387
387
|
begin
|
|
388
388
|
Encoding.default_internal = Encoding::UTF_8
|
|
389
389
|
obj = EncodingTestBufferRecord.new(num: 3, str: "日本語")
|
|
390
|
-
obj.to_binary_s.encoding.must_equal Encoding::ASCII_8BIT
|
|
390
|
+
_(obj.to_binary_s.encoding).must_equal Encoding::ASCII_8BIT
|
|
391
391
|
ensure
|
|
392
392
|
Encoding.default_internal = before_enc
|
|
393
393
|
$-w = w
|
data/test/test_helper.rb
CHANGED
|
@@ -37,7 +37,7 @@ module Kernel
|
|
|
37
37
|
|
|
38
38
|
def must_raise_on_line(exp, line, msg = nil)
|
|
39
39
|
ex = self.must_raise exp
|
|
40
|
-
ex.message.must_equal msg if msg
|
|
40
|
+
(ex.message).must_equal msg if msg
|
|
41
41
|
|
|
42
42
|
idx = ex.backtrace.find_index { |bt| /:in `must_raise_on_line'$/ =~ bt }
|
|
43
43
|
|
|
@@ -56,6 +56,6 @@ module Kernel
|
|
|
56
56
|
self.stub(:warn, callable) do
|
|
57
57
|
block.call
|
|
58
58
|
end
|
|
59
|
-
result.must_equal msg
|
|
59
|
+
(result).must_equal msg
|
|
60
60
|
end
|
|
61
61
|
end
|
data/test/uint8_array_test.rb
CHANGED
|
@@ -5,17 +5,17 @@ require File.expand_path(File.join(File.dirname(__FILE__), "test_helper"))
|
|
|
5
5
|
describe BinData::Uint8Array, "when initialising" do
|
|
6
6
|
it "with mutually exclusive parameters :initial_length and :read_until" do
|
|
7
7
|
params = {initial_length: 5, read_until: :eof}
|
|
8
|
-
|
|
8
|
+
_ { BinData::Uint8Array.new(params) }.must_raise ArgumentError
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
it "with :read_until" do
|
|
12
12
|
params = {read_until: :not_eof}
|
|
13
|
-
|
|
13
|
+
_ { BinData::Uint8Array.new(params) }.must_raise ArgumentError
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
it "with no parameters" do
|
|
17
17
|
arr = BinData::Uint8Array.new
|
|
18
|
-
arr.num_bytes.must_equal 0
|
|
18
|
+
_(arr.num_bytes).must_equal 0
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ describe BinData::Uint8Array, "with :read_until" do
|
|
|
23
23
|
it "reads until :eof" do
|
|
24
24
|
arr = BinData::Uint8Array.new(read_until: :eof)
|
|
25
25
|
arr.read("\xff\xfe\xfd\xfc")
|
|
26
|
-
arr.must_equal([255, 254, 253, 252])
|
|
26
|
+
_(arr).must_equal([255, 254, 253, 252])
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
@@ -31,7 +31,7 @@ describe BinData::Uint8Array, "with :initial_length" do
|
|
|
31
31
|
it "reads" do
|
|
32
32
|
arr = BinData::Uint8Array.new(initial_length: 3)
|
|
33
33
|
arr.read("\xff\xfe\xfd\xfc")
|
|
34
|
-
arr.must_equal([255, 254, 253])
|
|
34
|
+
_(arr).must_equal([255, 254, 253])
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
|
|
@@ -39,6 +39,6 @@ describe BinData::Uint8Array, "when assigning" do
|
|
|
39
39
|
it "copies data" do
|
|
40
40
|
arr = BinData::Uint8Array.new
|
|
41
41
|
arr.assign([1, 2, 3])
|
|
42
|
-
arr.must_equal([1, 2, 3])
|
|
42
|
+
_(arr).must_equal([1, 2, 3])
|
|
43
43
|
end
|
|
44
44
|
end
|
data/test/virtual_test.rb
CHANGED
|
@@ -7,17 +7,17 @@ describe BinData::Virtual do
|
|
|
7
7
|
|
|
8
8
|
it "must not read from any stream" do
|
|
9
9
|
BinData::Virtual.read(stream)
|
|
10
|
-
stream.pos.must_equal 0
|
|
10
|
+
_(stream.pos).must_equal 0
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
it "must not write to a stream" do
|
|
14
14
|
obj = BinData::Virtual.new
|
|
15
|
-
obj.to_binary_s.must_equal_binary ""
|
|
15
|
+
_(obj.to_binary_s).must_equal_binary ""
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
it "occupies no space" do
|
|
19
19
|
obj = BinData::Virtual.new
|
|
20
|
-
obj.num_bytes.must_equal 0
|
|
20
|
+
_(obj.num_bytes).must_equal 0
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
it "asserts on #read" do
|
|
@@ -25,7 +25,7 @@ describe BinData::Virtual do
|
|
|
25
25
|
obj = BinData::Virtual.new(assert: -> { data << 1; true })
|
|
26
26
|
|
|
27
27
|
obj.read ""
|
|
28
|
-
data.must_equal [1]
|
|
28
|
+
_(data).must_equal [1]
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
it "asserts on #assign" do
|
|
@@ -33,16 +33,16 @@ describe BinData::Virtual do
|
|
|
33
33
|
obj = BinData::Virtual.new(assert: -> { data << 1; true })
|
|
34
34
|
|
|
35
35
|
obj.assign("foo")
|
|
36
|
-
data.must_equal [1]
|
|
36
|
+
_(data).must_equal [1]
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
it "assigns a value" do
|
|
40
40
|
obj = BinData::Virtual.new(3)
|
|
41
|
-
obj.must_equal 3
|
|
41
|
+
_(obj).must_equal 3
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
it "accepts the :value parameter" do
|
|
45
45
|
obj = BinData::Virtual.new(value: 3)
|
|
46
|
-
obj.must_equal 3
|
|
46
|
+
_(obj).must_equal 3
|
|
47
47
|
end
|
|
48
48
|
end
|
data/test/warnings_test.rb
CHANGED
|
@@ -10,7 +10,7 @@ describe BinData::Base, "when defining" do
|
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
_ {
|
|
14
14
|
BaseWithInitialize.new
|
|
15
15
|
}.must_raise RuntimeError
|
|
16
16
|
end
|
|
@@ -22,7 +22,7 @@ describe BinData::Base, "when defining" do
|
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
_ {
|
|
26
26
|
BaseWithInitializeInstance.new
|
|
27
27
|
}.must_raise RuntimeError
|
|
28
28
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bindata
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.4.
|
|
4
|
+
version: 2.4.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dion Mendel
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-02-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -71,13 +71,9 @@ extensions: []
|
|
|
71
71
|
extra_rdoc_files:
|
|
72
72
|
- NEWS.rdoc
|
|
73
73
|
files:
|
|
74
|
-
- ".gitignore"
|
|
75
|
-
- ".travis.yml"
|
|
76
|
-
- BSDL
|
|
77
|
-
- COPYING
|
|
78
74
|
- ChangeLog.rdoc
|
|
79
75
|
- Gemfile
|
|
80
|
-
-
|
|
76
|
+
- LICENSE
|
|
81
77
|
- NEWS.rdoc
|
|
82
78
|
- README.md
|
|
83
79
|
- Rakefile
|
|
@@ -151,7 +147,7 @@ files:
|
|
|
151
147
|
- test/warnings_test.rb
|
|
152
148
|
homepage: https://github.com/dmendel/bindata
|
|
153
149
|
licenses:
|
|
154
|
-
-
|
|
150
|
+
- BSD-2-Clause
|
|
155
151
|
metadata: {}
|
|
156
152
|
post_install_message:
|
|
157
153
|
rdoc_options:
|
|
@@ -163,14 +159,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
163
159
|
requirements:
|
|
164
160
|
- - ">="
|
|
165
161
|
- !ruby/object:Gem::Version
|
|
166
|
-
version:
|
|
162
|
+
version: 2.4.0
|
|
167
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
164
|
requirements:
|
|
169
165
|
- - ">="
|
|
170
166
|
- !ruby/object:Gem::Version
|
|
171
167
|
version: '0'
|
|
172
168
|
requirements: []
|
|
173
|
-
rubygems_version: 3.
|
|
169
|
+
rubygems_version: 3.3.7
|
|
174
170
|
signing_key:
|
|
175
171
|
specification_version: 4
|
|
176
172
|
summary: A declarative way to read and write binary file formats
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
data/BSDL
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
Copyright (C) 2007-2012 Dion Mendel. All rights reserved.
|
|
2
|
-
|
|
3
|
-
Redistribution and use in source and binary forms, with or without
|
|
4
|
-
modification, are permitted provided that the following conditions
|
|
5
|
-
are met:
|
|
6
|
-
1. Redistributions of source code must retain the above copyright
|
|
7
|
-
notice, this list of conditions and the following disclaimer.
|
|
8
|
-
2. Redistributions in binary form must reproduce the above copyright
|
|
9
|
-
notice, this list of conditions and the following disclaimer in the
|
|
10
|
-
documentation and/or other materials provided with the distribution.
|
|
11
|
-
|
|
12
|
-
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
13
|
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
14
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
15
|
-
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
16
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
17
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
18
|
-
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
19
|
-
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
20
|
-
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
21
|
-
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
22
|
-
SUCH DAMAGE.
|
data/COPYING
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
BinData is copyrighted free software by Dion Mendel <bindata@dm9.info>.
|
|
2
|
-
You can redistribute it and/or modify it under either the terms of the
|
|
3
|
-
2-clause BSDL (see the file BSDL), or the conditions below:
|
|
4
|
-
|
|
5
|
-
1. You may make and give away verbatim copies of the source form of the
|
|
6
|
-
software without restriction, provided that you duplicate all of the
|
|
7
|
-
original copyright notices and associated disclaimers.
|
|
8
|
-
|
|
9
|
-
2. You may modify your copy of the software in any way, provided that
|
|
10
|
-
you do at least ONE of the following:
|
|
11
|
-
|
|
12
|
-
a) place your modifications in the Public Domain or otherwise
|
|
13
|
-
make them Freely Available, such as by posting said
|
|
14
|
-
modifications to Usenet or an equivalent medium, or by allowing
|
|
15
|
-
the author to include your modifications in the software.
|
|
16
|
-
|
|
17
|
-
b) use the modified software only within your corporation or
|
|
18
|
-
organization.
|
|
19
|
-
|
|
20
|
-
c) give non-standard binaries non-standard names, with
|
|
21
|
-
instructions on where to get the original software distribution.
|
|
22
|
-
|
|
23
|
-
d) make other distribution arrangements with the author.
|
|
24
|
-
|
|
25
|
-
3. You may distribute the software in object code or binary form,
|
|
26
|
-
provided that you do at least ONE of the following:
|
|
27
|
-
|
|
28
|
-
a) distribute the binaries and library files of the software,
|
|
29
|
-
together with instructions (in the manual page or equivalent)
|
|
30
|
-
on where to get the original distribution.
|
|
31
|
-
|
|
32
|
-
b) accompany the distribution with the machine-readable source of
|
|
33
|
-
the software.
|
|
34
|
-
|
|
35
|
-
c) give non-standard binaries non-standard names, with
|
|
36
|
-
instructions on where to get the original software distribution.
|
|
37
|
-
|
|
38
|
-
d) make other distribution arrangements with the author.
|
|
39
|
-
|
|
40
|
-
4. You may modify and include the part of the software into any other
|
|
41
|
-
software (possibly commercial).
|
|
42
|
-
|
|
43
|
-
5. The scripts and library files supplied as input to or produced as
|
|
44
|
-
output from the software do not automatically fall under the
|
|
45
|
-
copyright of the software, but belong to whomever generated them,
|
|
46
|
-
and may be sold commercially, and may be aggregated with this
|
|
47
|
-
software.
|
|
48
|
-
|
|
49
|
-
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
|
50
|
-
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
|
51
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
52
|
-
PURPOSE.
|
data/INSTALL
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
This package is designed to be installed with rubygems.
|
|
2
|
-
|
|
3
|
-
$ gem install bindata
|
|
4
|
-
|
|
5
|
-
If you are using ruby 1.8
|
|
6
|
-
|
|
7
|
-
$ gem install bindata -v '~> 1.8.0'
|
|
8
|
-
|
|
9
|
-
If you are not using rubygems, you may like to install BinData with
|
|
10
|
-
Minero Aoki's setup.rb found at:
|
|
11
|
-
|
|
12
|
-
https://github.com/rubyworks/setup
|