Hello community,

here is the log from the commit of package rubygem-bindata for openSUSE:Factory 
checked in at 2018-02-10 17:59:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-bindata (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-bindata.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-bindata"

Sat Feb 10 17:59:43 2018 rev:2 rq:574924 version:2.4.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-bindata/rubygem-bindata.changes  
2018-01-10 23:30:42.192594613 +0100
+++ /work/SRC/openSUSE:Factory/.rubygem-bindata.new/rubygem-bindata.changes     
2018-02-10 17:59:46.292647549 +0100
@@ -1,0 +2,10 @@
+Thu Feb  8 05:54:05 UTC 2018 - co...@suse.com
+
+- updated to version 2.4.2
+ see installed ChangeLog.rdoc
+
+  == Version 2.4.2 (2018-01-31)
+  
+  * Allow boolean values as parameters.  Requested by Patrik Wenger.
+
+-------------------------------------------------------------------

Old:
----
  bindata-2.4.1.gem

New:
----
  bindata-2.4.2.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-bindata.spec ++++++
--- /var/tmp/diff_new_pack.MjgeHw/_old  2018-02-10 17:59:47.056619893 +0100
+++ /var/tmp/diff_new_pack.MjgeHw/_new  2018-02-10 17:59:47.060619748 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-bindata
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-bindata
-Version:        2.4.1
+Version:        2.4.2
 Release:        0
 %define mod_name bindata
 %define mod_full_name %{mod_name}-%{version}
@@ -34,7 +34,7 @@
 BuildRequires:  %{ruby}
 BuildRequires:  ruby-macros >= 5
 Url:            http://github.com/dmendel/bindata
-Source:         http://rubygems.org/gems/%{mod_full_name}.gem
+Source:         https://rubygems.org/gems/%{mod_full_name}.gem
 Source1:        gem2rpm.yml
 Summary:        A declarative way to read and write binary file formats
 License:        Ruby

++++++ bindata-2.4.1.gem -> bindata-2.4.2.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ChangeLog.rdoc new/ChangeLog.rdoc
--- old/ChangeLog.rdoc  2017-08-30 05:28:00.000000000 +0200
+++ new/ChangeLog.rdoc  2018-01-31 07:48:42.000000000 +0100
@@ -1,5 +1,9 @@
 = BinData Changelog
 
+== Version 2.4.2 (2018-01-31)
+
+* Allow boolean values as parameters.  Requested by Patrik Wenger.
+
 == Version 2.4.1 (2017-08-30)
 
 * Fix crash with String :length invoking :rel_offset.  Reported by Claudius
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/bindata/sanitize.rb new/lib/bindata/sanitize.rb
--- old/lib/bindata/sanitize.rb 2017-08-30 05:28:00.000000000 +0200
+++ new/lib/bindata/sanitize.rb 2018-01-31 07:48:42.000000000 +0100
@@ -306,9 +306,7 @@
     end
 
     def needs_sanitizing?(key)
-      parameter = self[key]
-
-      parameter && !parameter.is_a?(SanitizedParameter)
+      has_key?(key) && ! self[key].is_a?(SanitizedParameter)
     end
 
     def ensure_no_nil_values
@@ -322,7 +320,7 @@
 
     def merge_default_parameters!
       @the_class.default_parameters.each do |key, value|
-        self[key] ||= value
+        self[key] = value unless has_key?(key)
       end
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/bindata/struct.rb new/lib/bindata/struct.rb
--- old/lib/bindata/struct.rb   2017-08-30 05:28:00.000000000 +0200
+++ new/lib/bindata/struct.rb   2018-01-31 07:48:42.000000000 +0100
@@ -278,7 +278,7 @@
       end
 
       def method_missing(symbol, *args)
-        self[symbol] || super
+        key?(symbol) ? self[symbol] : super
       end
     end
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/bindata/version.rb new/lib/bindata/version.rb
--- old/lib/bindata/version.rb  2017-08-30 05:28:00.000000000 +0200
+++ new/lib/bindata/version.rb  2018-01-31 07:48:42.000000000 +0100
@@ -1,3 +1,3 @@
 module BinData
-  VERSION = "2.4.1"
+  VERSION = "2.4.2"
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2017-08-30 05:28:00.000000000 +0200
+++ new/metadata        2018-01-31 07:48:42.000000000 +0100
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: bindata
 version: !ruby/object:Gem::Version
-  version: 2.4.1
+  version: 2.4.2
 platform: ruby
 authors:
 - Dion Mendel
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2017-08-30 00:00:00.000000000 Z
+date: 2018-01-31 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: rake
@@ -163,7 +163,7 @@
       version: '0'
 requirements: []
 rubyforge_project: bindata
-rubygems_version: 2.6.8
+rubygems_version: 2.6.14
 signing_key: 
 specification_version: 4
 summary: A declarative way to read and write binary file formats
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/system_test.rb new/test/system_test.rb
--- old/test/system_test.rb     2017-08-30 05:28:00.000000000 +0200
+++ new/test/system_test.rb     2018-01-31 07:48:42.000000000 +0100
@@ -338,3 +338,25 @@
   end
 end
 
+describe BinData::Record, "with boolean parameters" do
+  class BooleanParameterRecord < BinData::Record
+    default_parameter flag: true
+
+    int8 :a, value: -> { flag ? 2 : 3 }
+  end
+
+  it "uses default parameter" do
+    obj = BooleanParameterRecord.new
+    obj.a.must_equal 2
+  end
+
+  it "overrides parameter" do
+    obj = BooleanParameterRecord.new(flag: false)
+    obj.a.must_equal 3
+  end
+
+  it "overrides parameter with same value" do
+    obj = BooleanParameterRecord.new(flag: true)
+    obj.a.must_equal 2
+  end
+end


Reply via email to