Hello community,

here is the log from the commit of package rubygem-bindata for openSUSE:Factory 
checked in at 2020-05-11 13:40:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-bindata (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-bindata.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-bindata"

Mon May 11 13:40:25 2020 rev:5 rq:802327 version:2.4.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-bindata/rubygem-bindata.changes  
2018-11-26 10:28:54.981125793 +0100
+++ 
/work/SRC/openSUSE:Factory/.rubygem-bindata.new.2738/rubygem-bindata.changes    
    2020-05-11 13:40:28.593007784 +0200
@@ -1,0 +2,20 @@
+Thu May  7 20:26:56 UTC 2020 - Stephan Kulow <co...@suse.com>
+
+- updated to version 2.4.7
+ see installed ChangeLog.rdoc
+
+  == Version 2.4.7 (2020-03-31)
+  
+  * Fix choice assignment inside arrays.  Reported by Spencer McIntyre.
+  
+  == Version 2.4.6 (2020-02-27)
+  
+  * More encoding fixes.  Thanks to Aaron Patterson.
+  
+  == Version 2.4.5 (2020-02-21)
+  
+  * Small typo fixes to examples.
+  * Fix encoding issue for ruby 2.7.  Thanks to Aaron Patterson.
+  * Quieter test output.
+
+-------------------------------------------------------------------

Old:
----
  bindata-2.4.4.gem

New:
----
  bindata-2.4.7.gem

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

Other differences:
------------------
++++++ rubygem-bindata.spec ++++++
--- /var/tmp/diff_new_pack.2iqESh/_old  2020-05-11 13:40:29.661010051 +0200
+++ /var/tmp/diff_new_pack.2iqESh/_new  2020-05-11 13:40:29.665010059 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-bindata
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # 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.4
+Version:        2.4.7
 Release:        0
 %define mod_name bindata
 %define mod_full_name %{mod_name}-%{version}
@@ -33,7 +33,7 @@
 BuildRequires:  %{rubygem rdoc > 3.10}
 BuildRequires:  %{ruby}
 BuildRequires:  ruby-macros >= 5
-Url:            http://github.com/dmendel/bindata
+URL:            http://github.com/dmendel/bindata
 Source:         https://rubygems.org/gems/%{mod_full_name}.gem
 Source1:        gem2rpm.yml
 Summary:        A declarative way to read and write binary file formats

++++++ bindata-2.4.4.gem -> bindata-2.4.7.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/.travis.yml new/.travis.yml
--- old/.travis.yml     2018-10-03 07:36:25.000000000 +0200
+++ new/.travis.yml     2020-03-30 19:26:03.000000000 +0200
@@ -1,9 +1,11 @@
 language: ruby
 rvm:
-  - 2.0
-  - 2.1.10
   - 2.2
   - 2.3
+  - 2.4
+  - 2.5
+  - 2.6
+  - 2.7
   - jruby
   - ruby-head
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ChangeLog.rdoc new/ChangeLog.rdoc
--- old/ChangeLog.rdoc  2018-10-03 07:36:25.000000000 +0200
+++ new/ChangeLog.rdoc  2020-03-30 19:26:03.000000000 +0200
@@ -1,5 +1,19 @@
 = BinData Changelog
 
+== Version 2.4.7 (2020-03-31)
+
+* Fix choice assignment inside arrays.  Reported by Spencer McIntyre.
+
+== Version 2.4.6 (2020-02-27)
+
+* More encoding fixes.  Thanks to Aaron Patterson.
+
+== Version 2.4.5 (2020-02-21)
+
+* Small typo fixes to examples.
+* Fix encoding issue for ruby 2.7.  Thanks to Aaron Patterson.
+* Quieter test output.
+
 == Version 2.4.4 (2018-10-03)
 
 * Display a hint when endian is omitted.  Requested by Tails.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/bindata.gemspec new/bindata.gemspec
--- old/bindata.gemspec 2018-10-03 07:36:25.000000000 +0200
+++ new/bindata.gemspec 2020-03-30 19:26:03.000000000 +0200
@@ -9,16 +9,14 @@
   s.author = 'Dion Mendel'
   s.email = 'bind...@dm9.info'
   s.homepage = 'http://github.com/dmendel/bindata'
-  s.rubyforge_project = 'bindata'
   s.require_path = 'lib'
-  s.has_rdoc = true
   s.extra_rdoc_files = ['NEWS.rdoc']
   s.rdoc_options << '--main' << 'NEWS.rdoc'
   s.files = `git ls-files`.split("\n")
   s.license = 'Ruby'
 
   s.add_development_dependency('rake')
-  s.add_development_dependency('minitest', "> 5.0.0")
+  s.add_development_dependency('minitest', "> 5.0.0", "< 5.12.0")
   s.add_development_dependency('coveralls')
   s.description = <<-END.gsub(/^ +/, "")
     BinData is a declarative way to read and write binary file formats.
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/examples/tcp_ip.rb new/examples/tcp_ip.rb
--- old/examples/tcp_ip.rb      2018-10-03 07:36:25.000000000 +0200
+++ new/examples/tcp_ip.rb      2020-03-30 19:26:03.000000000 +0200
@@ -14,7 +14,7 @@
   array :octets, type: :uint8, initial_length: 6
 
   def set(val)
-    self.octets = val.split(/\./).collect(&:to_i)
+    self.octets = val.split(/:/).collect(&:to_i)
   end
 
   def get
@@ -23,7 +23,7 @@
 end
 
 # Present IP addresses in a human readable way
-class IPAddr < BinData::Primitive
+class IP_Addr < BinData::Primitive
   array :octets, type: :uint8, initial_length: 4
 
   def set(val)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/bindata/array.rb new/lib/bindata/array.rb
--- old/lib/bindata/array.rb    2018-10-03 07:36:25.000000000 +0200
+++ new/lib/bindata/array.rb    2020-03-30 19:26:03.000000000 +0200
@@ -82,7 +82,8 @@
     def assign(array)
       raise ArgumentError, "can't set a nil value for #{debug_name}" if 
array.nil?
 
-      @element_list = to_storage_formats(array.to_ary)
+      @element_list = []
+      concat(array)
     end
 
     def snapshot
@@ -119,7 +120,17 @@
 
     def insert(index, *objs)
       extend_array(index - 1)
-      elements.insert(index, *to_storage_formats(objs))
+      abs_index = (index >= 0) ? index : index + 1 + length
+
+      # insert elements before...
+      new_elements = objs.map { new_element }
+      elements.insert(index, *new_elements)
+
+      # ...assigning values
+      objs.each_with_index do |obj, i|
+        self[abs_index + i] = obj
+      end
+
       self
     end
 
@@ -238,10 +249,6 @@
       end
     end
 
-    def to_storage_formats(els)
-      els.collect { |el| new_element(el) }
-    end
-
     def elements
       @element_list ||= []
     end
@@ -252,8 +259,8 @@
       element
     end
 
-    def new_element(value = nil)
-      @element_prototype.instantiate(value, self)
+    def new_element
+      @element_prototype.instantiate(nil, self)
     end
 
     def sum_num_bytes_for_all_elements
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/bindata/base.rb new/lib/bindata/base.rb
--- old/lib/bindata/base.rb     2018-10-03 07:36:25.000000000 +0200
+++ new/lib/bindata/base.rb     2020-03-30 19:26:03.000000000 +0200
@@ -172,8 +172,7 @@
     def to_binary_s(&block)
       io = BinData::IO.create_string_io
       write(io, &block)
-      io.rewind
-      io.read
+      io.string
     end
 
     # Returns the hexadecimal string representation of this data object.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/bindata/io.rb new/lib/bindata/io.rb
--- old/lib/bindata/io.rb       2018-10-03 07:36:25.000000000 +0200
+++ new/lib/bindata/io.rb       2020-03-30 19:26:03.000000000 +0200
@@ -213,7 +213,9 @@
 
     # Creates a StringIO around +str+.
     def self.create_string_io(str = "")
-      StringIO.new(str.dup.force_encoding(Encoding::BINARY))
+      s = StringIO.new(str.dup.force_encoding(Encoding::BINARY))
+      s.binmode
+      s
     end
 
     # Create a new IO Read wrapper around +io+.  +io+ must provide #read,
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  2018-10-03 07:36:25.000000000 +0200
+++ new/lib/bindata/version.rb  2020-03-30 19:26:03.000000000 +0200
@@ -1,3 +1,3 @@
 module BinData
-  VERSION = "2.4.4"
+  VERSION = "2.4.7"
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2018-10-03 07:36:25.000000000 +0200
+++ new/metadata        2020-03-30 19:26:03.000000000 +0200
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: bindata
 version: !ruby/object:Gem::Version
-  version: 2.4.4
+  version: 2.4.7
 platform: ruby
 authors:
 - Dion Mendel
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2018-10-03 00:00:00.000000000 Z
+date: 2020-03-30 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: rake
@@ -31,6 +31,9 @@
     - - ">"
       - !ruby/object:Gem::Version
         version: 5.0.0
+    - - "<"
+      - !ruby/object:Gem::Version
+        version: 5.12.0
   type: :development
   prerelease: false
   version_requirements: !ruby/object:Gem::Requirement
@@ -38,6 +41,9 @@
     - - ">"
       - !ruby/object:Gem::Version
         version: 5.0.0
+    - - "<"
+      - !ruby/object:Gem::Version
+        version: 5.12.0
 - !ruby/object:Gem::Dependency
   name: coveralls
   requirement: !ruby/object:Gem::Requirement
@@ -164,8 +170,7 @@
     - !ruby/object:Gem::Version
       version: '0'
 requirements: []
-rubyforge_project: bindata
-rubygems_version: 2.7.6
+rubygems_version: 3.1.2
 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/buffer_test.rb new/test/buffer_test.rb
--- old/test/buffer_test.rb     2018-10-03 07:36:25.000000000 +0200
+++ new/test/buffer_test.rb     2020-03-30 19:26:03.000000000 +0200
@@ -153,4 +153,3 @@
     obj.to_binary_s.must_equal_binary "abcdeABCDE12345"
   end
 end
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/offset_test.rb new/test/offset_test.rb
--- old/test/offset_test.rb     2018-10-03 07:36:25.000000000 +0200
+++ new/test/offset_test.rb     2020-03-30 19:26:03.000000000 +0200
@@ -74,9 +74,15 @@
     end
 
     it "adjust offset when incorrect" do
-      io.seek(2)
-      obj = TenByteOffsetBase.create(adjust_offset: 13)
-      obj.read(io).snapshot.must_equal data[2 + 13, 3]
+      w, $-w = $-w, false
+
+      begin
+        io.seek(2)
+        obj = TenByteOffsetBase.create(adjust_offset: 13)
+        obj.read(io).snapshot.must_equal data[2 + 13, 3]
+      ensure
+        $-w = w
+      end
     end
 
     it "succeeds when offset is correct" do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/registry_test.rb new/test/registry_test.rb
--- old/test/registry_test.rb   2018-10-03 07:36:25.000000000 +0200
+++ new/test/registry_test.rb   2020-03-30 19:26:03.000000000 +0200
@@ -36,10 +36,16 @@
   end
 
   it "allows overriding of registered classes" do
-    r.register('A', A)
-    r.register('A', B)
+    w, $-w = $-w, false
 
-    r.lookup('a').must_equal B
+    begin
+      r.register('A', A)
+      r.register('A', B)
+
+      r.lookup('a').must_equal B
+    ensure
+      $-w = w
+    end
   end
 
   it "converts CamelCase to underscores" do
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     2018-10-03 07:36:25.000000000 +0200
+++ new/test/system_test.rb     2020-03-30 19:26:03.000000000 +0200
@@ -360,3 +360,37 @@
     obj.a.must_equal 2
   end
 end
+
+describe BinData::Record, "encoding" do
+  class EncodingTestBufferRecord < BinData::Record
+    endian :big
+    default_parameter length: 5
+
+    uint16 :num
+    string :str, length: 10
+  end
+
+  it "returns binary encoded data" do
+    obj = EncodingTestBufferRecord.new(num: 3)
+    obj.to_binary_s.encoding.must_equal Encoding::ASCII_8BIT
+  end
+
+  it "returns binary encoded data with utf-8 string" do
+    obj = EncodingTestBufferRecord.new(num: 3, str: "日本語")
+    obj.to_binary_s.encoding.must_equal Encoding::ASCII_8BIT
+  end
+
+  it "returns binary encoded data despite Encoding.default_internal" do
+    w, $-w = $-w, false
+    before_enc = Encoding.default_internal
+
+    begin
+      Encoding.default_internal = Encoding::UTF_8
+      obj = EncodingTestBufferRecord.new(num: 3, str: "日本語")
+      obj.to_binary_s.encoding.must_equal Encoding::ASCII_8BIT
+    ensure
+      Encoding.default_internal = before_enc
+      $-w = w
+    end
+  end
+end


Reply via email to