Hello community,
here is the log from the commit of package rubygem-bindata for openSUSE:Factory
checked in at 2018-11-26 10:28:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-bindata (Old)
and /work/SRC/openSUSE:Factory/.rubygem-bindata.new.19453 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-bindata"
Mon Nov 26 10:28:18 2018 rev:4 rq:651092 version:2.4.4
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-bindata/rubygem-bindata.changes
2018-07-18 22:48:43.227999279 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-bindata.new.19453/rubygem-bindata.changes
2018-11-26 10:28:54.981125793 +0100
@@ -1,0 +2,12 @@
+Thu Nov 22 05:00:06 UTC 2018 - Stephan Kulow <[email protected]>
+
+- updated to version 2.4.4
+ see installed ChangeLog.rdoc
+
+ == Version 2.4.4 (2018-10-03)
+
+ * Display a hint when endian is omitted. Requested by Tails.
+ * Add thread safety to Integer/BitField creation. Requested by jbpeirce.
+ * Ensure windows sockets are unseekable. Thanks to Brent Cook.
+
+-------------------------------------------------------------------
Old:
----
bindata-2.4.3.gem
New:
----
bindata-2.4.4.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-bindata.spec ++++++
--- /var/tmp/diff_new_pack.rEZdr7/_old 2018-11-26 10:28:55.585125084 +0100
+++ /var/tmp/diff_new_pack.rEZdr7/_new 2018-11-26 10:28:55.585125084 +0100
@@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
@@ -24,7 +24,7 @@
#
Name: rubygem-bindata
-Version: 2.4.3
+Version: 2.4.4
Release: 0
%define mod_name bindata
%define mod_full_name %{mod_name}-%{version}
++++++ bindata-2.4.3.gem -> bindata-2.4.4.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ChangeLog.rdoc new/ChangeLog.rdoc
--- old/ChangeLog.rdoc 2018-03-09 17:32:08.000000000 +0100
+++ new/ChangeLog.rdoc 2018-10-03 07:36:25.000000000 +0200
@@ -1,5 +1,11 @@
= BinData Changelog
+== Version 2.4.4 (2018-10-03)
+
+* Display a hint when endian is omitted. Requested by Tails.
+* Add thread safety to Integer/BitField creation. Requested by jbpeirce.
+* Ensure windows sockets are unseekable. Thanks to Brent Cook.
+
== Version 2.4.3 (2018-03-10)
* Add Uint8Arrays. Requested by masarakki.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2018-03-09 17:32:08.000000000 +0100
+++ new/README.md 2018-10-03 07:36:25.000000000 +0200
@@ -2,7 +2,6 @@
[
](https://rubygems.org/gems/bindata)
[
](https://travis-ci.org/dmendel/bindata)
-[](https://codeclimate.com/github/dmendel/bindata)
[
](https://coveralls.io/r/dmendel/bindata)
Do you ever find yourself writing code like this?
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/bits.rb new/lib/bindata/bits.rb
--- old/lib/bindata/bits.rb 2018-03-09 17:32:08.000000000 +0100
+++ new/lib/bindata/bits.rb 2018-10-03 07:36:25.000000000 +0200
@@ -1,3 +1,4 @@
+require 'thread'
require 'bindata/base_primitive'
module BinData
@@ -5,15 +6,18 @@
# The integer is defined by endian and number of bits.
module BitField #:nodoc: all
+ @@mutex = Mutex.new
+
class << self
def define_class(name, nbits, endian, signed = :unsigned)
- unless BinData.const_defined?(name)
- BinData.module_eval <<-END
- class #{name} < BinData::BasePrimitive
- # nbits is either an integer or the symbol `:nbits`
- BitField.define_methods(self, #{nbits.inspect}, :#{endian},
:#{signed})
- end
- END
+ @@mutex.synchronize do
+ unless BinData.const_defined?(name)
+ new_class = Class.new(BinData::BasePrimitive)
+ BitField.define_methods(new_class, nbits, endian.to_sym,
signed.to_sym)
+ RegisteredClasses.register(name, new_class)
+
+ BinData.const_set(name, new_class)
+ end
end
BinData.const_get(name)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/bindata/int.rb new/lib/bindata/int.rb
--- old/lib/bindata/int.rb 2018-03-09 17:32:08.000000000 +0100
+++ new/lib/bindata/int.rb 2018-10-03 07:36:25.000000000 +0200
@@ -1,3 +1,4 @@
+require 'thread'
require 'bindata/base_primitive'
module BinData
@@ -5,14 +6,18 @@
# is defined by endian, signedness and number of bytes.
module Int #:nodoc: all
+ @@mutex = Mutex.new
+
class << self
def define_class(name, nbits, endian, signed)
- unless BinData.const_defined?(name)
- BinData.module_eval <<-END
- class #{name} < BinData::BasePrimitive
- Int.define_methods(self, #{nbits}, :#{endian}, :#{signed})
- end
- END
+ @@mutex.synchronize do
+ unless BinData.const_defined?(name)
+ new_class = Class.new(BinData::BasePrimitive)
+ Int.define_methods(new_class, nbits, endian.to_sym, signed.to_sym)
+ RegisteredClasses.register(name, new_class)
+
+ BinData.const_set(name, new_class)
+ end
end
BinData.const_get(name)
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-03-09 17:32:08.000000000 +0100
+++ new/lib/bindata/io.rb 2018-10-03 07:36:25.000000000 +0200
@@ -29,7 +29,7 @@
def seekable?
@raw_io.pos
- rescue NoMethodError, Errno::ESPIPE, Errno::EPIPE
+ rescue NoMethodError, Errno::ESPIPE, Errno::EPIPE, Errno::EINVAL
nil
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/bindata/registry.rb new/lib/bindata/registry.rb
--- old/lib/bindata/registry.rb 2018-03-09 17:32:08.000000000 +0100
+++ new/lib/bindata/registry.rb 2018-10-03 07:36:25.000000000 +0200
@@ -24,7 +24,7 @@
end
def register(name, class_to_register)
- return if class_to_register.nil?
+ return if name.nil? || class_to_register.nil?
formatted_name = underscore_name(name)
warn_if_name_is_already_registered(formatted_name, class_to_register)
@@ -37,8 +37,14 @@
end
def lookup(name, hints = {})
- key = normalize_name(name, hints)
- @registry[key] || raise(UnRegisteredTypeError, name.to_s)
+ the_class = @registry[normalize_name(name, hints)]
+ if the_class
+ the_class
+ elsif @registry[normalize_name(name, hints.merge(endian: :big))]
+ raise(UnRegisteredTypeError, "#{name}, do you need to specify endian?")
+ else
+ raise(UnRegisteredTypeError, name)
+ end
end
# Convert CamelCase +name+ to underscore style.
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-03-09 17:32:08.000000000 +0100
+++ new/lib/bindata/version.rb 2018-10-03 07:36:25.000000000 +0200
@@ -1,3 +1,3 @@
module BinData
- VERSION = "2.4.3"
+ VERSION = "2.4.4"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/bindata.rb new/lib/bindata.rb
--- old/lib/bindata.rb 2018-03-09 17:32:08.000000000 +0100
+++ new/lib/bindata.rb 2018-10-03 07:36:25.000000000 +0200
@@ -1,13 +1,5 @@
# BinData -- Binary data manipulator.
-# Copyright (c) 2007 - 2016 Dion Mendel.
-
-if RUBY_VERSION <= "1.9"
- fail "BinData requires ruby >= 1.9.3. Use BinData version 1.8.x instead"
-end
-
-if RUBY_VERSION == "2.1.0" and RUBY_PATCHLEVEL == "0"
- fail "Ruby 2.1.0p0 has a bug that causes BinData to fail. Upgrade your ruby
version"
-end
+# Copyright (c) 2007 - 2018 Dion Mendel.
require 'bindata/version'
require 'bindata/array'
@@ -36,10 +28,10 @@
# A declarative way to read and write structured binary data.
#
# A full reference manual is available online at
-# http://bindata.rubyforge.org/manual.html
+# https://github.com/dmendel/bindata/wiki
#
# == License
#
# BinData is released under the same license as Ruby.
#
-# Copyright (c) 2007 - 2016 Dion Mendel.
+# Copyright (c) 2007 - 2018 Dion Mendel.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2018-03-09 17:32:08.000000000 +0100
+++ new/metadata 2018-10-03 07:36:25.000000000 +0200
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: bindata
version: !ruby/object:Gem::Version
- version: 2.4.3
+ version: 2.4.4
platform: ruby
authors:
- Dion Mendel
autorequire:
bindir: bin
cert_chain: []
-date: 2018-03-09 00:00:00.000000000 Z
+date: 2018-10-03 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: rake
@@ -165,7 +165,7 @@
version: '0'
requirements: []
rubyforge_project: bindata
-rubygems_version: 2.6.14
+rubygems_version: 2.7.6
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/registry_test.rb new/test/registry_test.rb
--- old/test/registry_test.rb 2018-03-09 17:32:08.000000000 +0100
+++ new/test/registry_test.rb 2018-10-03 07:36:25.000000000 +0200
@@ -71,6 +71,14 @@
}.must_raise BinData::UnRegisteredTypeError
end
+ it "provides a nice error message when endian is omitted" do
+ begin
+ r.lookup("int24")
+ rescue BinData::UnRegisteredTypeError => e
+ e.message.must_equal "int24, do you need to specify endian?"
+ end
+ end
+
it "does not lookup non byte based integers" do
lambda {
r.lookup("int3")