bindata 2.4.1 → 2.4.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bindata might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/ChangeLog.rdoc +4 -0
- data/lib/bindata/sanitize.rb +2 -4
- data/lib/bindata/struct.rb +1 -1
- data/lib/bindata/version.rb +1 -1
- data/test/system_test.rb +22 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 660228b3b8cdee82618401590015a45820a422fae8e0789d8bf4eceb89df3ee7
|
4
|
+
data.tar.gz: db1dfef8d5942a56d5a31a25fba27b28a4169433669cb3e910a3fb7236ba8a0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4ba761be1d6e109d30961cffa4c92774fafd05fad047aa710f335d1cbd25a02c81a252e06e187ccf3864fd0453e49f2c58de4abac3504762fd60db5e32e962f
|
7
|
+
data.tar.gz: b442381a7d7a04e930edcbad4e42269d88477e8223d26dbd81a57f0620fbe325299445d06ff1ea80e9ebf11a049e99f5e38e75d1a452a68d34ca8708e1b59441
|
data/ChangeLog.rdoc
CHANGED
data/lib/bindata/sanitize.rb
CHANGED
@@ -306,9 +306,7 @@ module BinData
|
|
306
306
|
end
|
307
307
|
|
308
308
|
def needs_sanitizing?(key)
|
309
|
-
|
310
|
-
|
311
|
-
parameter && !parameter.is_a?(SanitizedParameter)
|
309
|
+
has_key?(key) && ! self[key].is_a?(SanitizedParameter)
|
312
310
|
end
|
313
311
|
|
314
312
|
def ensure_no_nil_values
|
@@ -322,7 +320,7 @@ module BinData
|
|
322
320
|
|
323
321
|
def merge_default_parameters!
|
324
322
|
@the_class.default_parameters.each do |key, value|
|
325
|
-
self[key]
|
323
|
+
self[key] = value unless has_key?(key)
|
326
324
|
end
|
327
325
|
end
|
328
326
|
|
data/lib/bindata/struct.rb
CHANGED
data/lib/bindata/version.rb
CHANGED
data/test/system_test.rb
CHANGED
@@ -338,3 +338,25 @@ describe BinData::Primitive, "representing a string" do
|
|
338
338
|
end
|
339
339
|
end
|
340
340
|
|
341
|
+
describe BinData::Record, "with boolean parameters" do
|
342
|
+
class BooleanParameterRecord < BinData::Record
|
343
|
+
default_parameter flag: true
|
344
|
+
|
345
|
+
int8 :a, value: -> { flag ? 2 : 3 }
|
346
|
+
end
|
347
|
+
|
348
|
+
it "uses default parameter" do
|
349
|
+
obj = BooleanParameterRecord.new
|
350
|
+
obj.a.must_equal 2
|
351
|
+
end
|
352
|
+
|
353
|
+
it "overrides parameter" do
|
354
|
+
obj = BooleanParameterRecord.new(flag: false)
|
355
|
+
obj.a.must_equal 3
|
356
|
+
end
|
357
|
+
|
358
|
+
it "overrides parameter with same value" do
|
359
|
+
obj = BooleanParameterRecord.new(flag: true)
|
360
|
+
obj.a.must_equal 2
|
361
|
+
end
|
362
|
+
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.2
|
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: 2018-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
163
|
version: '0'
|
164
164
|
requirements: []
|
165
165
|
rubyforge_project: bindata
|
166
|
-
rubygems_version: 2.6.
|
166
|
+
rubygems_version: 2.6.14
|
167
167
|
signing_key:
|
168
168
|
specification_version: 4
|
169
169
|
summary: A declarative way to read and write binary file formats
|