Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package rubygem-ruby-dbus for 
openSUSE:Factory checked in at 2022-04-23 00:25:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-ruby-dbus (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-ruby-dbus.new.1538 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-ruby-dbus"

Sat Apr 23 00:25:07 2022 rev:26 rq:971689 version:0.18.0.beta4

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-ruby-dbus/rubygem-ruby-dbus.changes      
2022-04-12 21:43:25.883618186 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-ruby-dbus.new.1538/rubygem-ruby-dbus.changes
    2022-04-23 00:25:26.327755453 +0200
@@ -1,0 +2,11 @@
+Thu Apr 21 11:37:14 UTC 2022 - Martin Vidner <mvid...@suse.com>
+
+- 0.18.0.beta4
+ Bug fixes:
+ * Service-side properties: Fix Properties.Get, Properties.GetAll
+   for properties that contain arrays, on other than outermost
+   level (gh#mvidner/ruby-dbus#109).
+ * Sending variants: fixed make_variant to correctly guess the
+   signature for UInt64 and number-keyed hashes/dictionaries.
+
+-------------------------------------------------------------------

Old:
----
  ruby-dbus-0.18.0.beta3.gem

New:
----
  ruby-dbus-0.18.0.beta4.gem

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

Other differences:
------------------
++++++ rubygem-ruby-dbus.spec ++++++
--- /var/tmp/diff_new_pack.2WIwAn/_old  2022-04-23 00:25:26.943755782 +0200
+++ /var/tmp/diff_new_pack.2WIwAn/_new  2022-04-23 00:25:26.947755783 +0200
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-ruby-dbus
-Version:        0.18.0.beta3
+Version:        0.18.0.beta4
 Release:        0
 %define mod_name ruby-dbus
 %define mod_full_name %{mod_name}-%{version}

++++++ ruby-dbus-0.18.0.beta3.gem -> ruby-dbus-0.18.0.beta4.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/NEWS.md new/NEWS.md
--- old/NEWS.md 2022-04-10 19:57:37.000000000 +0200
+++ new/NEWS.md 2022-04-21 13:44:41.000000000 +0200
@@ -2,6 +2,16 @@
 
 ## Unreleased
 
+## Ruby D-Bus 0.18.0.beta4 - 2022-04-21
+
+Bug fixes:
+ * Service-side properties: Fix Properties.Get, Properties.GetAll for
+   properties that contain arrays, on other than outermost level ([#109][]).
+ * Sending variants: fixed make_variant to correctly guess the signature
+   for UInt64 and number-keyed hashes/dictionaries.
+
+[#109]: https://github.com/mvidner/ruby-dbus/pull/109
+
 ## Ruby D-Bus 0.18.0.beta3 - 2022-04-10
 
 Bug fixes:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/VERSION new/VERSION
--- old/VERSION 2022-04-10 19:57:37.000000000 +0200
+++ new/VERSION 2022-04-21 13:44:41.000000000 +0200
@@ -1 +1 @@
-0.18.0.beta3
+0.18.0.beta4
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/dbus/marshall.rb new/lib/dbus/marshall.rb
--- old/lib/dbus/marshall.rb    2022-04-10 19:57:37.000000000 +0200
+++ new/lib/dbus/marshall.rb    2022-04-21 13:44:41.000000000 +0200
@@ -250,6 +250,7 @@
         when Type::VARIANT
           append_variant(val)
         when Type::ARRAY
+          val = val.value if val.is_a?(Data::Array)
           append_array(type.child, val)
         when Type::STRUCT, Type::DICT_ENTRY
           val = val.value if val.is_a?(Data::Struct) || 
val.is_a?(Data::DictEntry)
@@ -353,15 +354,23 @@
       elsif value.is_a? Hash
         h = {}
         value.each_key { |k| h[k] = make_variant(value[k]) }
-        ["a{sv}", h]
+        key_type = if value.empty?
+                     "s"
+                   else
+                     t, = make_variant(value.first.first)
+                     t
+                   end
+        ["a{#{key_type}v}", h]
       elsif value.respond_to? :to_str
         ["s", value.to_str]
       elsif value.respond_to? :to_int
         i = value.to_int
-        if (-2_147_483_648...2_147_483_648).cover?(i)
+        if Data::Int32.range.cover?(i)
           ["i", i]
-        else
+        elsif Data::Int64.range.cover?(i)
           ["x", i]
+        else
+          ["t", i]
         end
       end
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2022-04-10 19:57:37.000000000 +0200
+++ new/metadata        2022-04-21 13:44:41.000000000 +0200
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: ruby-dbus
 version: !ruby/object:Gem::Version
-  version: 0.18.0.beta3
+  version: 0.18.0.beta4
 platform: ruby
 authors:
 - Ruby DBus Team
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2022-04-10 00:00:00.000000000 Z
+date: 2022-04-21 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: rexml
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/data/marshall.yaml new/spec/data/marshall.yaml
--- old/spec/data/marshall.yaml 2022-04-10 19:57:37.000000000 +0200
+++ new/spec/data/marshall.yaml 2022-04-21 13:44:41.000000000 +0200
@@ -1534,6 +1534,34 @@
   - [0xDE, 0xAD, 0xBE, 0xEF]
   exc: DBus::InvalidPacketException
   msg: ''
+- sig: a{oq}
+  end: little
+  buf:
+  # body size
+  - [0, 0, 0, 0]
+  # padding
+  - [0, 0, 0, 0]
+  val: {}
+- sig: a{oq}
+  end: little
+  buf:
+  # body size
+  - [26, 0, 0, 0]
+  # dict_entry padding
+  - [0, 0, 0, 0]
+  # key, padding, value
+  - [2, 0, 0, 0, "/7", 0]
+  - 0
+  - [7, 0]
+  # dict_entry padding
+  - [0, 0, 0, 0, 0, 0]
+  # key, padding, value
+  - [2, 0, 0, 0, "/9", 0]
+  - 0
+  - [9, 0]
+  val:
+    /7: 7
+    /9: 9
 - sig: "(qq)"
   end: little
   buf:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/packet_marshaller_spec.rb 
new/spec/packet_marshaller_spec.rb
--- old/spec/packet_marshaller_spec.rb  2022-04-10 19:57:37.000000000 +0200
+++ new/spec/packet_marshaller_spec.rb  2022-04-21 13:44:41.000000000 +0200
@@ -29,6 +29,13 @@
         subject.append(signature, t.val)
         expect(subject.packet).to eq(expected)
       end
+
+      it "writes a '#{signature}' with typed value #{t.val.inspect} 
(#{endianness})" do
+        subject = described_class.new(endianness: endianness)
+        typed_val = DBus::Data.make_typed(signature, t.val)
+        subject.append(signature, typed_val)
+        expect(subject.packet).to eq(expected)
+      end
     end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/property_spec.rb new/spec/property_spec.rb
--- old/spec/property_spec.rb   2022-04-10 19:57:37.000000000 +0200
+++ new/spec/property_spec.rb   2022-04-21 13:44:41.000000000 +0200
@@ -4,6 +4,14 @@
 require_relative "spec_helper"
 require "dbus"
 
+# FIXME: factor out DBus::TestFixtures::Value in spec_helper
+require "ostruct"
+require "yaml"
+
+data_dir = File.expand_path("data", __dir__)
+marshall_yaml_s = File.read("#{data_dir}/marshall.yaml")
+marshall_yaml = YAML.safe_load(marshall_yaml_s)
+
 describe "PropertyTest" do
   before(:each) do
     @session_bus = DBus::ASessionBus.new
@@ -168,8 +176,29 @@
 
   context "a variant-typed property" do
     it "gets read at all" do
-      val = @iface["MyVariant"]
+      obj = @svc.object("/org/ruby/MyDerivedInstance")
+      iface = obj["org.ruby.SampleInterface"]
+      val = iface["MyVariant"]
       expect(val).to eq([42, 43])
     end
   end
+
+  context "marshall.yaml round-trip via a VARIANT property" do
+    marshall_yaml.each do |test|
+      t = OpenStruct.new(test)
+      next if t.val.nil?
+
+      # Round trips do not work yet because the properties
+      # must present a plain Ruby value so the exact D-Bus type is lost.
+      # Round trips will work once users can declare accepting DBus::Data
+      # in properties and method arguments.
+      it "Sets #{t.sig.inspect}:#{t.val.inspect} and Gets something back" do
+        before = DBus::Data.make_typed(t.sig, t.val)
+        expect { @iface["MyVariant"] = before }.to_not raise_error
+        expect { _after = @iface["MyVariant"] }.to_not raise_error
+        # round-trip:
+        # expect(after).to eq(before.value)
+      end
+    end
+  end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/service_newapi.rb new/spec/service_newapi.rb
--- old/spec/service_newapi.rb  2022-04-10 19:57:37.000000000 +0200
+++ new/spec/service_newapi.rb  2022-04-21 13:44:41.000000000 +0200
@@ -107,10 +107,10 @@
     end
     dbus_reader :explosive, "s"
 
-    dbus_attr_reader :my_struct, "(sss)"
-    dbus_attr_reader :my_array, "aq"
-    dbus_attr_reader :my_dict, "a{sv}"
-    dbus_attr_reader :my_variant, "v"
+    dbus_attr_accessor :my_struct, "(sss)"
+    dbus_attr_accessor :my_array, "aq"
+    dbus_attr_accessor :my_dict, "a{sv}"
+    dbus_attr_accessor :my_variant, "v"
   end
 
   # closing and reopening the same interface

Reply via email to