Hello community,

here is the log from the commit of package rubygem-ruby-dbus for 
openSUSE:Factory checked in at 2016-09-17 14:38:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-ruby-dbus (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-ruby-dbus.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-ruby-dbus"

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-ruby-dbus/rubygem-ruby-dbus.changes      
2016-05-19 12:04:24.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.rubygem-ruby-dbus.new/rubygem-ruby-dbus.changes 
2016-09-17 14:38:50.000000000 +0200
@@ -1,0 +2,19 @@
+Mon Sep 12 19:51:17 UTC 2016 - mvid...@suse.com
+
+- 0.12.0
+ API:
+ * Added proxy objects whose methods return single values instead of arrays
+   (use Service#[] instead of Service#object; Issue#30).
+
+ Requirements:
+ * Require ruby 2.0.0, stopped supporting 1.9.3.
+
+-------------------------------------------------------------------
+Sun Sep 11 10:47:10 UTC 2016 - mvid...@suse.com
+
+- 0.11.2:
+ Bug fixes:
+ * Fixed reading a quoted session bus address, as written by dbus-1.10.10
+   (Yasuhiro Asaka)
+
+-------------------------------------------------------------------

Old:
----
  ruby-dbus-0.11.1.gem

New:
----
  ruby-dbus-0.12.0.gem

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

Other differences:
------------------
++++++ rubygem-ruby-dbus.spec ++++++
--- /var/tmp/diff_new_pack.RLqTig/_old  2016-09-17 14:38:51.000000000 +0200
+++ /var/tmp/diff_new_pack.RLqTig/_new  2016-09-17 14:38:51.000000000 +0200
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-ruby-dbus
-Version:        0.11.1
+Version:        0.12.0
 Release:        0
 %define mod_name ruby-dbus
 %define mod_full_name %{mod_name}-%{version}
@@ -37,7 +37,7 @@
 BuildRequires:  netcfg
 # /MANUAL
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-BuildRequires:  %{ruby >= 1.9.3}
+BuildRequires:  %{ruby >= 2.0.0}
 BuildRequires:  %{rubygem gem2rpm}
 BuildRequires:  ruby-macros >= 5
 Url:            https://trac.luon.net/ruby-dbus

++++++ ruby-dbus-0.11.1.gem -> ruby-dbus-0.12.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/NEWS new/NEWS
--- old/NEWS    2016-05-12 21:53:52.000000000 +0200
+++ new/NEWS    2016-09-12 21:59:59.000000000 +0200
@@ -5,6 +5,23 @@
  Issue#1  - http://github.com/mvidner/ruby-dbus/issues#issue/1
  bnc#1    - https://bugzilla.novell.com/show_bug.cgi?id=1
 
+== Unreleased
+
+== Ruby D-Bus 0.12.0 - 2016-09-12
+
+API:
+ * Added proxy objects whose methods return single values instead of arrays
+   (use Service#[] instead of Service#object; Issue#30).
+
+Requirements:
+ * Require ruby 2.0.0, stopped supporting 1.9.3.
+
+== Ruby D-Bus 0.11.2 - 2016-09-11
+
+Bug fixes:
+ * Fixed reading a quoted session bus address, as written by dbus-1.10.10
+   (Yasuhiro Asaka)
+
 == Ruby D-Bus 0.11.1 - 2016-05-12
 
 Bug fixes:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md       2016-05-12 21:53:52.000000000 +0200
+++ new/README.md       2016-09-12 21:59:59.000000000 +0200
@@ -31,7 +31,7 @@
     require "dbus"
     sysbus = DBus.system_bus
     upower_service   = sysbus["org.freedesktop.UPower"]
-    upower_object    = upower_service.object "/org/freedesktop/UPower"
+    upower_object    = upower_service["/org/freedesktop/UPower"]
     upower_object.introspect
     upower_interface = upower_object["org.freedesktop.UPower"]
     on_battery       = upower_interface["OnBattery"]
@@ -43,7 +43,7 @@
 
 ## Requirements
 
-- Ruby 1.9.3 or 2.0
+- Ruby 2.0 or newer.
 
 
 ## Installation
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/VERSION new/VERSION
--- old/VERSION 2016-05-12 21:53:52.000000000 +0200
+++ new/VERSION 2016-09-12 21:59:59.000000000 +0200
@@ -1 +1 @@
-0.11.1
+0.12.0
Files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/doc/Reference.md new/doc/Reference.md
--- old/doc/Reference.md        2016-05-12 21:53:52.000000000 +0200
+++ new/doc/Reference.md        2016-09-12 21:59:59.000000000 +0200
@@ -24,7 +24,7 @@
 
 1. {DBus.session_bus Connect to the session bus};
    {DBus::Connection#[] get the screensaver service}
-   {DBus::Service#object and its screensaver object}.
+   {DBus::Service#[] and its screensaver object}.
 2. Perform {DBus::ProxyObject#introspect explicit introspection}
    to define the interfaces and methods
    on the {DBus::ProxyObject object proxy}
@@ -32,9 +32,10 @@
 3. Call one of its methods in a loop, solving [xkcd#196](http://xkcd.com/196).
 
  
+
     mybus = DBus.session_bus
     service = mybus['org.freedesktop.ScreenSaver']
-    object = service.object '/ScreenSaver'
+    object = service['/ScreenSaver']
     object.introspect
     loop do
         object.SimulateUserActivity
@@ -43,20 +44,47 @@
 
 ##### Retrieving Return Values
 
-A method proxy always returns an array of values. This is to
+A method proxy simply returns a value.
+In this example SuspendAllowed returns a boolean:
+
+    mybus = DBus.session_bus
+    pm_s = mybus['org.freedesktop.PowerManagement']
+    pm_o = pm_s['/org/freedesktop/PowerManagement']
+    pm_o.introspect
+    pm_i = pm_o['org.freedesktop.PowerManagement']
+
+    if pm_i.CanSuspend
+      pm_i.Suspend
+    end
+
+###### Multiple Return Values
+
+In former versions of this library,
+a method proxy always returned an array of values. This was to
 accomodate the rare cases of a DBus method specifying more than one
-*out* parameter. For nearly all methods you should use `Method[0]` or
+*out* parameter. For compatibility, the behavior is preserved if you
+construct a {DBus::ProxyObject} with {DBus::ApiOptions::A0},
+which is what {DBus::Service#object} does.
+
+For nearly all methods you used `Method[0]` or
 `Method.first`
 ([I#30](https://github.com/mvidner/ruby-dbus/issues/30)).
     
+    mybus = DBus.session_bus
+    pm_s = mybus['org.freedesktop.PowerManagement']
+    # use legacy compatibility API
+    pm_o = pm_s.object['/org/freedesktop/PowerManagement']
+    pm_o.introspect
+    pm_i = pm_o['org.freedesktop.PowerManagement']
+
     # wrong
-    if upower_i.SuspendAllowed    # [false] is true!
-      upower_i.Suspend
-    end
+    # if pm_i.CanSuspend
+    #   pm_i.Suspend                # [false] is true!
+    # end
 
     # right
-    if upower_i.SuspendAllowed[0]
-      upower_i.Suspend
+    if pm_i.CanSuspend[0]
+      pm_i.Suspend
     end
 
 #### Accessing Properties
@@ -68,7 +96,7 @@
 
     sysbus = DBus.system_bus
     upower_s = sysbus['org.freedesktop.UPower']
-    upower_o = upower_s.object '/org/freedesktop/UPower'
+    upower_o = upower_s['/org/freedesktop/UPower']
     upower_o.introspect
     upower_i = upower_o['org.freedesktop.UPower']
 
@@ -112,6 +140,9 @@
     login_o.introspect
     login_o.default_iface = 'org.freedesktop.login1.Manager'
 
+    main = DBus::Main.new
+    main << sysbus
+
     # to trigger this signal, login on the Linux console
     login_o.on_signal("SessionNew") do |name, opath|
       puts "New session: #{name}"
@@ -121,10 +152,9 @@
       session_i = session_o['org.freedesktop.login1.Session']
       uid, user_opath = session_i['User']
       puts "Its UID: #{uid}"
+      main.quit
     end
 
-    main = DBus::Main.new
-    main << sysbus
     main.run
 
 ### Intermediate Concepts
@@ -174,7 +204,7 @@
 
 If a byte array (`ay`) is expected you can pass a String too.
 The bytes sent are according to the string's
-[encoding](http://ruby-doc.org/core-1.9.3/Encoding.html).
+[encoding](http://ruby-doc.org/core-2.0.0/Encoding.html).
 
 ##### nil
 
@@ -187,8 +217,11 @@
 D-Bus calls can reply with an error instead of a return value. An error is
 translated to a Ruby exception, an instance of {DBus::Error}.
 
+    nm_o = 
DBus.system_bus["org.freedesktop.NetworkManager"]["/org/freedesktop/NetworkManager"]
+    nm_o.introspect
+    nm = nm_o["org.freedesktop.NetworkManager"]
     begin
-        network_manager.sleep
+        nm.Sleep(false)
     rescue DBus::Error => e
         puts e unless e.name == 
"org.freedesktop.NetworkManager.AlreadyAsleepOrAwake"
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/examples/gdbus/gdbus new/examples/gdbus/gdbus
--- old/examples/gdbus/gdbus    2016-05-12 21:53:52.000000000 +0200
+++ new/examples/gdbus/gdbus    2016-09-12 21:59:59.000000000 +0200
@@ -6,7 +6,7 @@
 # -- Arnaud
 
 require 'dbus'
-require 'libglade2'
+require "gtk2"
 
 $enable_system = false
 
@@ -74,25 +74,26 @@
 
 class DBusUI
   def initialize
-    @glade = GladeXML.new("gdbus.glade") { |h| method(h) } # This block is like
-                                                           # black magic :)
-    @sessiontreeview = @glade.get_widget("sessiontreeview")
+    @glade = Gtk::Builder.new
+    @glade << "gdbus.glade"
+
+    @sessiontreeview = @glade.get_object("sessiontreeview")
     setup_treeview_renderer(@sessiontreeview, 'D-Bus Objects')
     @sessiontreeview.selection.signal_connect("changed") do |selection|
       on_treeview_selection_changed(selection)
     end
 
-    @systemtreeview = @glade.get_widget("systemtreeview")
+    @systemtreeview = @glade.get_object("systemtreeview")
     setup_treeview_renderer(@systemtreeview, 'D-Bus Objects')
     @systemtreeview.selection.signal_connect("changed") do |selection|
       on_treeview_selection_changed(selection)
     end
 
-    @methsigtreeview = @glade.get_widget("methsigtreeview")
+    @methsigtreeview = @glade.get_object("methsigtreeview")
     # ierk
     setup_methodview_renderer(@methsigtreeview)
 
-    @window = @glade.get_widget("window1")
+    @window = @glade.get_object("window1")
     @window.show_all
     start_buses
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/examples/gdbus/gdbus.glade 
new/examples/gdbus/gdbus.glade
--- old/examples/gdbus/gdbus.glade      2016-05-12 21:53:52.000000000 +0200
+++ new/examples/gdbus/gdbus.glade      2016-09-12 21:59:59.000000000 +0200
@@ -1,184 +1,98 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd";>
-
-<glade-interface>
-
-<widget class="GtkWindow" id="window1">
-  <property name="visible">True</property>
-  <property name="title" translatable="yes">GD-Bus</property>
-  <property name="type">GTK_WINDOW_TOPLEVEL</property>
-  <property name="window_position">GTK_WIN_POS_NONE</property>
-  <property name="modal">False</property>
-  <property name="default_width">500</property>
-  <property name="default_height">400</property>
-  <property name="resizable">True</property>
-  <property name="destroy_with_parent">False</property>
-  <property name="decorated">True</property>
-  <property name="skip_taskbar_hint">False</property>
-  <property name="skip_pager_hint">False</property>
-  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
-  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
-  <property name="focus_on_map">True</property>
-  <property name="urgency_hint">False</property>
-  <signal name="delete_event" handler="on_window_delete_event" 
last_modification_time="Sat, 17 Mar 2007 14:49:13 GMT"/>
-
-  <child>
-    <widget class="GtkHPaned" id="hpaned1">
-      <property name="visible">True</property>
-      <property name="can_focus">True</property>
-
-      <child>
-       <widget class="GtkNotebook" id="notebook1">
-         <property name="visible">True</property>
-         <property name="can_focus">True</property>
-         <property name="show_tabs">True</property>
-         <property name="show_border">True</property>
-         <property name="tab_pos">GTK_POS_TOP</property>
-         <property name="scrollable">False</property>
-         <property name="enable_popup">False</property>
-
-         <child>
-           <widget class="GtkScrolledWindow" id="scrolledwindow3">
-             <property name="visible">True</property>
-             <property name="can_focus">True</property>
-             <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
-             <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
-             <property name="shadow_type">GTK_SHADOW_IN</property>
-             <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
-             <child>
-               <widget class="GtkTreeView" id="sessiontreeview">
-                 <property name="visible">True</property>
-                 <property name="can_focus">True</property>
-                 <property name="headers_visible">True</property>
-                 <property name="rules_hint">False</property>
-                 <property name="reorderable">False</property>
-                 <property name="enable_search">True</property>
-                 <property name="fixed_height_mode">False</property>
-                 <property name="hover_selection">False</property>
-                 <property name="hover_expand">False</property>
-                 <signal name="row_activated" 
handler="on_sessiontreeview_row_activated" last_modification_time="Sat, 17 Mar 
2007 10:17:11 GMT"/>
-               </widget>
-             </child>
-           </widget>
-           <packing>
-             <property name="tab_expand">False</property>
-             <property name="tab_fill">True</property>
-           </packing>
-         </child>
-
-         <child>
-           <widget class="GtkLabel" id="label1">
-             <property name="visible">True</property>
-             <property name="label" translatable="yes">Session</property>
-             <property name="use_underline">False</property>
-             <property name="use_markup">False</property>
-             <property name="justify">GTK_JUSTIFY_LEFT</property>
-             <property name="wrap">False</property>
-             <property name="selectable">False</property>
-             <property name="xalign">0.5</property>
-             <property name="yalign">0.5</property>
-             <property name="xpad">0</property>
-             <property name="ypad">0</property>
-             <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-             <property name="width_chars">-1</property>
-             <property name="single_line_mode">False</property>
-             <property name="angle">0</property>
-           </widget>
-           <packing>
-             <property name="type">tab</property>
-           </packing>
-         </child>
-
-         <child>
-           <widget class="GtkScrolledWindow" id="scrolledwindow5">
-             <property name="visible">True</property>
-             <property name="can_focus">True</property>
-             <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
-             <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
-             <property name="shadow_type">GTK_SHADOW_IN</property>
-             <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
-             <child>
-               <widget class="GtkTreeView" id="systemtreeview">
-                 <property name="visible">True</property>
-                 <property name="can_focus">True</property>
-                 <property name="headers_visible">True</property>
-                 <property name="rules_hint">False</property>
-                 <property name="reorderable">False</property>
-                 <property name="enable_search">True</property>
-                 <property name="fixed_height_mode">False</property>
-                 <property name="hover_selection">False</property>
-                 <property name="hover_expand">False</property>
-               </widget>
-             </child>
-           </widget>
-           <packing>
-             <property name="tab_expand">False</property>
-             <property name="tab_fill">True</property>
-           </packing>
-         </child>
-
-         <child>
-           <widget class="GtkLabel" id="label2">
-             <property name="visible">True</property>
-             <property name="label" translatable="yes">System</property>
-             <property name="use_underline">False</property>
-             <property name="use_markup">False</property>
-             <property name="justify">GTK_JUSTIFY_LEFT</property>
-             <property name="wrap">False</property>
-             <property name="selectable">False</property>
-             <property name="xalign">0.5</property>
-             <property name="yalign">0.5</property>
-             <property name="xpad">0</property>
-             <property name="ypad">0</property>
-             <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-             <property name="width_chars">-1</property>
-             <property name="single_line_mode">False</property>
-             <property name="angle">0</property>
-           </widget>
-           <packing>
-             <property name="type">tab</property>
-           </packing>
-         </child>
-       </widget>
-       <packing>
-         <property name="shrink">True</property>
-         <property name="resize">False</property>
-       </packing>
-      </child>
-
-      <child>
-       <widget class="GtkScrolledWindow" id="scrolledwindow4">
-         <property name="visible">True</property>
-         <property name="can_focus">True</property>
-         <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
-         <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
-         <property name="shadow_type">GTK_SHADOW_IN</property>
-         <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
-         <child>
-           <widget class="GtkTreeView" id="methsigtreeview">
-             <property name="visible">True</property>
-             <property name="can_focus">True</property>
-             <property name="headers_visible">True</property>
-             <property name="rules_hint">False</property>
-             <property name="reorderable">False</property>
-             <property name="enable_search">True</property>
-             <property name="fixed_height_mode">False</property>
-             <property name="hover_selection">False</property>
-             <property name="hover_expand">False</property>
-              <signal name="row_activated" handler="on_method_activated" 
last_modification_time="Sat, 17 Mar 2007 14:49:13 GMT"/>
-           </widget>
-         </child>
-       </widget>
-       <packing>
-         <property name="shrink">True</property>
-         <property name="resize">False</property>
-       </packing>
-      </child>
-    </widget>
-  </child>
-</widget>
-
-</glade-interface>
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 2.6 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkWindow" id="window1">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">GD-Bus</property>
+    <property name="default_width">500</property>
+    <property name="default_height">400</property>
+    <signal name="delete-event" handler="on_window_delete_event" swapped="no"/>
+    <child>
+      <object class="GtkHPaned" id="hpaned1">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <child>
+          <object class="GtkNotebook" id="notebook1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <child>
+              <object class="GtkScrolledWindow" id="scrolledwindow3">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="shadow_type">in</property>
+                <child>
+                  <object class="GtkTreeView" id="sessiontreeview">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <signal name="row-activated" 
handler="on_sessiontreeview_row_activated" swapped="no"/>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Session</property>
+              </object>
+              <packing>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkScrolledWindow" id="scrolledwindow5">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="shadow_type">in</property>
+                <child>
+                  <object class="GtkTreeView" id="systemtreeview">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">System</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="resize">False</property>
+            <property name="shrink">True</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkScrolledWindow" id="scrolledwindow4">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="shadow_type">in</property>
+            <child>
+              <object class="GtkTreeView" id="methsigtreeview">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <signal name="row-activated" handler="on_method_activated" 
swapped="no"/>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="resize">False</property>
+            <property name="shrink">True</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/examples/simple/get_id.rb 
new/examples/simple/get_id.rb
--- old/examples/simple/get_id.rb       1970-01-01 01:00:00.000000000 +0100
+++ new/examples/simple/get_id.rb       2016-09-12 21:59:59.000000000 +0200
@@ -0,0 +1,19 @@
+#! /usr/bin/env ruby
+
+# find the library without external help
+$:.unshift File.expand_path("../../../lib", __FILE__)
+
+require "dbus"
+
+bus = DBus::SystemBus.instance
+driver_svc = bus["org.freedesktop.DBus"]
+# p driver_svc
+driver_obj = driver_svc["/"]
+# p driver_obj
+driver_obj.introspect
+
+driver_ifc = driver_obj["org.freedesktop.DBus"]
+# p driver_ifc
+
+bus_id = driver_ifc.GetId
+puts "The system bus id is #{bus_id}"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/dbus/api_options.rb new/lib/dbus/api_options.rb
--- old/lib/dbus/api_options.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/lib/dbus/api_options.rb 2016-09-12 21:59:59.000000000 +0200
@@ -0,0 +1,24 @@
+# This file is part of the ruby-dbus project
+# Copyright (C) 2016 Martin Vidner
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License, version 2.1 as published by the Free Software Foundation.
+# See the file "COPYING" for the exact licensing terms.
+
+module DBus
+  class ApiOptions
+    # https://github.com/mvidner/ruby-dbus/issues/30
+    attr_accessor :proxy_method_returns_array
+
+    A0 = ApiOptions.new
+    A0.proxy_method_returns_array = true
+    A0.freeze
+
+    A1 = ApiOptions.new
+    A1.proxy_method_returns_array = false
+    A1.freeze
+
+    CURRENT = A1
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/dbus/bus.rb new/lib/dbus/bus.rb
--- old/lib/dbus/bus.rb 2016-05-12 21:53:52.000000000 +0200
+++ new/lib/dbus/bus.rb 2016-09-12 21:59:59.000000000 +0200
@@ -50,10 +50,20 @@
 
     # Retrieves an object at the given _path_.
     # @return [ProxyObject]
-    def object(path)
-      node = get_node(path, true)
-      if node.object.nil?
-        node.object = ProxyObject.new(@bus, @name, path)
+    def [](path)
+      object(path, api: ApiOptions::A1)
+    end
+
+    # Retrieves an object at the given _path_
+    # whose methods always return an array.
+    # @return [ProxyObject]
+    def object(path, api: ApiOptions::A0)
+      node = get_node(path, _create = true)
+      if node.object.nil? || node.object.api != api
+        node.object = ProxyObject.new(
+          @bus, @name, path,
+          api: api
+          )
       end
       node.object
     end
@@ -417,12 +427,17 @@
     end
 
     # Set up a ProxyObject for the bus itself, since the bus is introspectable.
+    # @return [ProxyObject] that always returns an array
+    #   ({DBus::ApiOptions#proxy_method_returns_array})
     # Returns the object.
     def proxy
       if @proxy == nil
         path = "/org/freedesktop/DBus"
         dest = "org.freedesktop.DBus"
-        pof = DBus::ProxyObjectFactory.new(DBUSXMLINTRO, self, dest, path)
+        pof = DBus::ProxyObjectFactory.new(
+          DBUSXMLINTRO, self, dest, path,
+          api: ApiOptions::A0
+          )
         @proxy = pof.build["org.freedesktop.DBus"]
       end
       @proxy
@@ -621,7 +636,8 @@
 
       File.open(bus_file_path).each_line do |line|
         if line =~ /^DBUS_SESSION_BUS_ADDRESS=(.*)/
-          return $1
+          address = $1
+          return address[/\A'(.*)'\z/, 1] || address[/\A"(.*)"\z/, 1] || 
address
         end
       end
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/dbus/proxy_object.rb new/lib/dbus/proxy_object.rb
--- old/lib/dbus/proxy_object.rb        2016-05-12 21:53:52.000000000 +0200
+++ new/lib/dbus/proxy_object.rb        2016-09-12 21:59:59.000000000 +0200
@@ -27,13 +27,17 @@
     attr_reader :bus
     # @return [String] The name of the default interface of the object.
     attr_accessor :default_iface
+    # @api private
+    # @return [ApiOptions]
+    attr_reader :api
 
     # Creates a new proxy object living on the given _bus_ at destination 
_dest_
     # on the given _path_.
-    def initialize(bus, dest, path)
+    def initialize(bus, dest, path, api: ApiOptions::CURRENT)
       @bus, @destination, @path = bus, dest, path
       @interfaces = Hash.new
       @subnodes = Array.new
+      @api = api
     end
 
     # Returns the interfaces of the object.
@@ -140,10 +144,5 @@
         raise NoMethodError, "undefined method `#{name}' for DBus interface 
`#{@default_iface}' on object `#{@path}'"
       end
     end
-
-    # Returns the singleton class of the object.
-    def singleton_class
-      (class << self ; self ; end)
-    end
   end # class ProxyObject
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/dbus/proxy_object_factory.rb 
new/lib/dbus/proxy_object_factory.rb
--- old/lib/dbus/proxy_object_factory.rb        2016-05-12 21:53:52.000000000 
+0200
+++ new/lib/dbus/proxy_object_factory.rb        2016-09-12 21:59:59.000000000 
+0200
@@ -14,8 +14,9 @@
   class ProxyObjectFactory
     # Creates a new proxy object factory for the given introspection XML _xml_,
     # _bus_, destination _dest_, and _path_.
-    def initialize(xml, bus, dest, path)
+    def initialize(xml, bus, dest, path, api: ApiOptions::CURRENT)
       @xml, @bus, @path, @dest = xml, bus, path, dest
+      @api = api
     end
 
     # Investigates the sub-nodes of the proxy object _po_ based on the
@@ -33,7 +34,7 @@
 
     # Generates, sets up and returns the proxy object.
     def build
-      po = ProxyObject.new(@bus, @dest, @path)
+      po = ProxyObject.new(@bus, @dest, @path, api: @api)
       ProxyObjectFactory.introspect_into(po, @xml)
       po
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/dbus/proxy_object_interface.rb 
new/lib/dbus/proxy_object_interface.rb
--- old/lib/dbus/proxy_object_interface.rb      2016-05-12 21:53:52.000000000 
+0200
+++ new/lib/dbus/proxy_object_interface.rb      2016-09-12 21:59:59.000000000 
+0200
@@ -34,11 +34,6 @@
       @name
     end
 
-    # Returns the singleton class of the interface.
-    def singleton_class
-      (class << self ; self ; end)
-    end
-
     # Defines a method on the interface from the Method descriptor _m_.
     def define_method_from_descriptor(m)
       m.params.each do |fpar|
@@ -63,7 +58,12 @@
             par = fpar.type
             msg.add_param(par, args.shift)
           end
-          @object.bus.send_sync_or_async(msg, &reply_handler)
+          ret = @object.bus.send_sync_or_async(msg, &reply_handler)
+          if ret.nil? || @object.api.proxy_method_returns_array
+            ret
+          else
+            m.rets.size == 1 ? ret.first : ret
+          end
         end
       end
 
@@ -110,11 +110,20 @@
     PROPERTY_INTERFACE = "org.freedesktop.DBus.Properties"
 
     # Read a property.
+    # @param propname [String]
     def [](propname)
-      self.object[PROPERTY_INTERFACE].Get(self.name, propname)[0]
+      ret = self.object[PROPERTY_INTERFACE].Get(self.name, propname)
+      # this method always returns the single property
+      if @object.api.proxy_method_returns_array
+        ret[0]
+      else
+        ret
+      end
     end
 
     # Write a property.
+    # @param propname [String]
+    # @param value [Object]
     def []=(propname, value)
       self.object[PROPERTY_INTERFACE].Set(self.name, propname, value)
     end
@@ -122,7 +131,13 @@
     # Read all properties at once, as a hash.
     # @return [Hash{String}]
     def all_properties
-      self.object[PROPERTY_INTERFACE].GetAll(self.name)[0]
+      ret = self.object[PROPERTY_INTERFACE].GetAll(self.name)
+      # this method always returns the single property
+      if @object.api.proxy_method_returns_array
+        ret[0]
+      else
+        ret
+      end
     end
   end # class ProxyObjectInterface
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/dbus.rb new/lib/dbus.rb
--- old/lib/dbus.rb     2016-05-12 21:53:52.000000000 +0200
+++ new/lib/dbus.rb     2016-09-12 21:59:59.000000000 +0200
@@ -8,6 +8,7 @@
 # License, version 2.1 as published by the Free Software Foundation.
 # See the file "COPYING" for the exact licensing terms.
 
+require_relative "dbus/api_options"
 require_relative "dbus/auth"
 require_relative "dbus/bus"
 require_relative "dbus/core_ext/class/attribute"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2016-05-12 21:53:52.000000000 +0200
+++ new/metadata        2016-09-12 21:59:59.000000000 +0200
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: ruby-dbus
 version: !ruby/object:Gem::Version
-  version: 0.11.1
+  version: 0.12.0
 platform: ruby
 authors:
 - Ruby DBus Team
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2016-05-12 00:00:00.000000000 Z
+date: 2016-09-12 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: packaging_rake_tasks
@@ -63,10 +63,12 @@
 - examples/service/call_service.rb
 - examples/service/service_newapi.rb
 - examples/simple/call_introspect.rb
+- examples/simple/get_id.rb
 - examples/simple/properties.rb
 - examples/utils/listnames.rb
 - examples/utils/notify.rb
 - lib/dbus.rb
+- lib/dbus/api_options.rb
 - lib/dbus/auth.rb
 - lib/dbus/bus.rb
 - lib/dbus/core_ext/array/extract_options.rb
@@ -101,6 +103,7 @@
 - spec/server_robustness_spec.rb
 - spec/server_spec.rb
 - spec/service_newapi.rb
+- spec/session_bus_spec.rb
 - spec/session_bus_spec_manual.rb
 - spec/signal_spec.rb
 - spec/spec_helper.rb
@@ -124,7 +127,7 @@
   requirements:
   - - ">="
     - !ruby/object:Gem::Version
-      version: 1.9.3
+      version: 2.0.0
 required_rubygems_version: !ruby/object:Gem::Requirement
   requirements:
   - - ">="
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ruby-dbus.gemspec new/ruby-dbus.gemspec
--- old/ruby-dbus.gemspec       2016-05-12 21:53:52.000000000 +0200
+++ new/ruby-dbus.gemspec       2016-09-12 21:59:59.000000000 +0200
@@ -14,7 +14,7 @@
   s.homepage = "https://trac.luon.net/ruby-dbus";
   s.files = FileList["{doc,examples,lib,spec}/**/*", "COPYING", "NEWS", 
"Rakefile", "README.md", "ruby-dbus.gemspec", "VERSION", ".rspec"].to_a.sort
   s.require_path = "lib"
-  s.required_ruby_version = ">= 1.9.3"
+  s.required_ruby_version = ">= 2.0.0"
   s.add_development_dependency("packaging_rake_tasks")
   s.add_development_dependency("rspec")
 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   2016-05-12 21:53:52.000000000 +0200
+++ new/spec/property_spec.rb   2016-09-12 21:59:59.000000000 +0200
@@ -5,8 +5,8 @@
 describe "PropertyTest" do
   before(:each) do
     session_bus = DBus::ASessionBus.new
-    svc = session_bus.service("org.ruby.service")
-    @obj = svc.object("/org/ruby/MyInstance")
+    @svc = session_bus.service("org.ruby.service")
+    @obj = @svc.object("/org/ruby/MyInstance")
     @obj.introspect
     @iface = @obj["org.ruby.SampleInterface"]
   end
@@ -15,6 +15,14 @@
     expect(@iface["ReadMe"]).to eq("READ ME")
   end
 
+  it "tests property reading on a V1 object" do
+    obj = @svc["/org/ruby/MyInstance"]
+    obj.introspect
+    iface = obj["org.ruby.SampleInterface"]
+
+    expect(iface["ReadMe"]).to eq("READ ME")
+  end
+
   it "tests property nonreading" do
     expect { @iface["WriteMe"] }.to raise_error(DBus::Error, /not readable/)
   end
@@ -43,6 +51,15 @@
     expect(all.keys.sort).to eq(["ReadMe", "ReadOrWriteMe"])
   end
 
+  it "tests get all on a V1 object" do
+    obj = @svc["/org/ruby/MyInstance"]
+    obj.introspect
+    iface = obj["org.ruby.SampleInterface"]
+
+    all = iface.all_properties
+    expect(all.keys.sort).to eq(["ReadMe", "ReadOrWriteMe"])
+  end
+
   it "tests unknown property reading" do
     expect { @iface["Spoon"] }.to raise_error(DBus::Error, /not found/)
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/session_bus_spec.rb new/spec/session_bus_spec.rb
--- old/spec/session_bus_spec.rb        1970-01-01 01:00:00.000000000 +0100
+++ new/spec/session_bus_spec.rb        2016-09-12 21:59:59.000000000 +0200
@@ -0,0 +1,70 @@
+#!/usr/bin/env rspec
+require_relative "spec_helper"
+require "dbus"
+
+describe DBus::ASessionBus do
+  subject(:dbus_session_bus_address) { "unix:abstract=/tmp/dbus-foo,guid=123" }
+
+  describe "#session_bus_address" do
+    around(:each) do |example|
+      @original_dbus_session_bus_address = ENV["DBUS_SESSION_BUS_ADDRESS"]
+      example.call
+      ENV["DBUS_SESSION_BUS_ADDRESS"] = @original_dbus_session_bus_address
+    end
+
+    it "returns DBUS_SESSION_BUS_ADDRESS as it is" do
+      ENV["DBUS_SESSION_BUS_ADDRESS"] = dbus_session_bus_address
+      expect(DBus::ASessionBus.session_bus_address).to 
eq(dbus_session_bus_address)
+    end
+  end
+
+  describe "#address_from_file" do
+    let(:session_bus_file_path) { /\.dbus\/session-bus\/baz-\d/ }
+
+    before do
+      # mocks of files for address_from_file method
+      machine_id_path = File.expand_path("/etc/machine-id", __FILE__)
+      expect(Dir).to receive(:[]).with(any_args) {[machine_id_path] }
+      expect(File).to receive(:read).with(machine_id_path) { "baz" }
+      expect(File).to receive(:exists?).with(session_bus_file_path) { true }
+    end
+
+    around(:each) do |example|
+      with_env("DISPLAY", ":0.0") do
+        example.call
+      end
+    end
+
+    context "when DBUS_SESSION_BUS_ADDRESS from file is surrounded by 
quotation marks" do
+
+      it "returns session bus address without single quotation marks" do
+        expect(File).to receive(:open).with(session_bus_file_path) { 
<<-EOS.gsub(/^\s*/, '') }
+          DBUS_SESSION_BUS_ADDRESS='#{dbus_session_bus_address}'
+          DBUS_SESSION_BUS_PID=12345
+          DBUS_SESSION_BUS_WINDOWID=12345678
+        EOS
+        expect(DBus::ASessionBus.address_from_file).to 
eq(dbus_session_bus_address)
+      end
+
+      it "returns session bus address without double quotation marks" do
+        expect(File).to receive(:open).with(session_bus_file_path) { 
<<-EOS.gsub(/^\s*/, '') }
+          DBUS_SESSION_BUS_ADDRESS="#{dbus_session_bus_address}"
+          DBUS_SESSION_BUS_PID=12345
+          DBUS_SESSION_BUS_WINDOWID=12345678
+        EOS
+        expect(DBus::ASessionBus.address_from_file).to 
eq(dbus_session_bus_address)
+      end
+    end
+
+    context "when DBUS_SESSION_BUS_ADDRESS from file is not surrounded by any 
quotation marks" do
+      it "returns session bus address as it is" do
+        expect(File).to receive(:open).with(session_bus_file_path) { 
<<-EOS.gsub(/^\s*/, '') }
+          DBUS_SESSION_BUS_ADDRESS=#{dbus_session_bus_address}
+          DBUS_SESSION_BUS_PID=12345
+          DBUS_SESSION_BUS_WINDOWID=12345678
+        EOS
+        expect(DBus::ASessionBus.address_from_file).to 
eq(dbus_session_bus_address)
+      end
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/value_spec.rb new/spec/value_spec.rb
--- old/spec/value_spec.rb      2016-05-12 21:53:52.000000000 +0200
+++ new/spec/value_spec.rb      2016-09-12 21:59:59.000000000 +0200
@@ -6,8 +6,8 @@
 describe "ValueTest" do
   before(:each) do
     session_bus = DBus::ASessionBus.new
-    svc = session_bus.service("org.ruby.service")
-    @obj = svc.object("/org/ruby/MyInstance")
+    @svc = session_bus.service("org.ruby.service")
+    @obj = @svc.object("/org/ruby/MyInstance")
     @obj.introspect                  # necessary
     @obj.default_iface = "org.ruby.SampleInterface"
   end
@@ -36,7 +36,19 @@
     empty_hash = {}
     expect(@obj.bounce_variant(empty_hash)[0]).to eq(empty_hash)
   end
-  
+
+  it "retrieves a single return value with API V1" do
+    obj = @svc["/org/ruby/MyInstance"]
+    obj.introspect
+    obj.default_iface = "org.ruby.SampleInterface"
+
+    expect(obj.bounce_variant("cuckoo")).to eq("cuckoo")
+    expect(obj.bounce_variant(["coucou", "kuku"])).to eq(["coucou", "kuku"])
+    expect(obj.bounce_variant([])).to eq([])
+    empty_hash = {}
+    expect(obj.bounce_variant(empty_hash)).to eq(empty_hash)
+  end
+
   # these are ambiguous
   it "tests pairs with a string" do
     


Reply via email to