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 2021-01-25 18:22:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-ruby-dbus (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-ruby-dbus.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-ruby-dbus"

Mon Jan 25 18:22:45 2021 rev:22 rq:865300 version:0.16.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-ruby-dbus/rubygem-ruby-dbus.changes      
2018-07-13 10:14:03.781936674 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-ruby-dbus.new.28504/rubygem-ruby-dbus.changes
   2021-01-25 18:22:46.136355880 +0100
@@ -2 +2 @@
-Mon Apr 30 16:14:23 UTC 2018 - factory-a...@kulow.org
+Tue Oct 15 19:08:27 UTC 2019 - Martin Vidner <mvid...@suse.com>
@@ -4,2 +4,5 @@
-- updated to version 0.15.0
- see installed NEWS.md
+- 0.16.0
+ API:
+ * An invalid service name or an invalid object path will raise
+   instead of being sent to the bus. The bus would then drop the
+   connection, producing EOFError here (gh#mvidner/ruby-dbus#80).
@@ -7 +10,2 @@
-  ## Ruby D-Bus 0.15.0 - 2018-04-30
+-------------------------------------------------------------------
+Mon Apr 30 14:58:32 UTC 2018 - mvid...@suse.com
@@ -8,0 +13 @@
+- 0.15.0
@@ -10,2 +15,2 @@
-   * Accessing an unknown interface will raise instead of returning nil 
([#74]).
-  
+ * Accessing an unknown interface will raise instead of
+   returning nil (gh#mvidner/ruby-dbus#74).
@@ -13 +18 @@
-   * Fixed a conflict with activesupport 5.2 ([#71])
+ * Fixed a conflict with activesupport 5.2 (gh#mvidner/ruby-dbus#71)
@@ -15,2 +19,0 @@
-  [#71]: https://github.com/mvidner/ruby-dbus/issues/71
-  [#74]: https://github.com/mvidner/ruby-dbus/pull/74

Old:
----
  ruby-dbus-0.15.0.gem

New:
----
  ruby-dbus-0.16.0.gem

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

Other differences:
------------------
++++++ rubygem-ruby-dbus.spec ++++++
--- /var/tmp/diff_new_pack.Hdx8JE/_old  2021-01-25 18:22:47.144357318 +0100
+++ /var/tmp/diff_new_pack.Hdx8JE/_new  2021-01-25 18:22:47.148357324 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-ruby-dbus
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -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,12 +24,12 @@
 #
 
 Name:           rubygem-ruby-dbus
-Version:        0.15.0
+Version:        0.16.0
 Release:        0
 %define mod_name ruby-dbus
 %define mod_full_name %{mod_name}-%{version}
 # MANUAL
-BuildRequires:  %{rubygem nokogiri > 1.6}
+BuildRequires:  %{rubygem nokogiri >= 1.10.4}
 BuildRequires:  %{rubygem packaging_rake_tasks}
 BuildRequires:  %{rubygem rake}
 BuildRequires:  %{rubygem rspec}
@@ -40,7 +40,7 @@
 BuildRequires:  %{ruby >= 2.0.0}
 BuildRequires:  %{rubygem gem2rpm}
 BuildRequires:  ruby-macros >= 5
-Url:            https://github.com/mvidner/ruby-dbus
+URL:            https://github.com/mvidner/ruby-dbus
 Source:         https://rubygems.org/gems/%{mod_full_name}.gem
 Source1:        gem2rpm.yml
 Summary:        Ruby module for interaction with D-Bus

++++++ gem2rpm.yml ++++++
--- /var/tmp/diff_new_pack.Hdx8JE/_old  2021-01-25 18:22:47.180357370 +0100
+++ /var/tmp/diff_new_pack.Hdx8JE/_new  2021-01-25 18:22:47.180357370 +0100
@@ -73,7 +73,7 @@
     Provides:       ruby-dbus = %{version}
     Obsoletes:      ruby-dbus < %{version}
 :preamble: |-
-  BuildRequires:  %{rubygem nokogiri > 1.6}
+  BuildRequires:  %{rubygem nokogiri >= 1.10.4}
   BuildRequires:  %{rubygem packaging_rake_tasks}
   BuildRequires:  %{rubygem rake}
   BuildRequires:  %{rubygem rspec}

++++++ ruby-dbus-0.15.0.gem -> ruby-dbus-0.16.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/NEWS.md new/NEWS.md
--- old/NEWS.md 2018-04-30 17:10:48.000000000 +0200
+++ new/NEWS.md 2019-10-15 21:16:41.000000000 +0200
@@ -2,10 +2,19 @@
 
 ## Unreleased
 
+## Ruby D-Bus 0.16.0 - 2019-10-15
+
+API:
+ * An invalid service name or an invalid object path will raise
+   instead of being sent to the bus. The bus would then drop the connection,
+   producing EOFError here ([#80][]).
+
+[#80]: https://github.com/mvidner/ruby-dbus/issues/80
+
 ## Ruby D-Bus 0.15.0 - 2018-04-30
 
 API:
- * Accessing an unknown interface will raise instead of returning nil ([#74]).
+ * Accessing an unknown interface will raise instead of returning nil 
([#74][]).
 
 Bug fixes:
  * Fixed a conflict with activesupport 5.2 ([#71])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/VERSION new/VERSION
--- old/VERSION 2018-04-30 17:10:48.000000000 +0200
+++ new/VERSION 2019-10-15 21:16:41.000000000 +0200
@@ -1 +1 @@
-0.15.0
+0.16.0
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/bus.rb new/lib/dbus/bus.rb
--- old/lib/dbus/bus.rb 2018-04-30 17:10:48.000000000 +0200
+++ new/lib/dbus/bus.rb 2019-10-15 21:16:41.000000000 +0200
@@ -17,7 +17,7 @@
 # Module containing all the D-Bus modules and classes.
 module DBus
   # This represents a remote service. It should not be instantiated directly
-  # Use Bus::service()
+  # Use {Bus#service}
   class Service
     # The service name.
     attr_reader :name
@@ -28,7 +28,7 @@
 
     # Create a new service with a given _name_ on a given _bus_.
     def initialize(name, bus)
-      @name = name
+      @name = BusName.new(name)
       @bus = bus
       @root = Node.new("/")
     end
@@ -458,6 +458,9 @@
         retm = wait_for_message
         process(retm)
       end
+    rescue EOFError
+      new_err = DBus::Error.new("Connection dropped after we sent 
#{m.inspect}")
+      raise new_err
     end
 
     # @api private
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/dbus/bus_name.rb new/lib/dbus/bus_name.rb
--- old/lib/dbus/bus_name.rb    1970-01-01 01:00:00.000000000 +0100
+++ new/lib/dbus/bus_name.rb    2019-10-15 21:16:41.000000000 +0200
@@ -0,0 +1,27 @@
+# This file is part of the ruby-dbus project
+# Copyright (C) 2019 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
+  # A {::String} that validates at initialization time
+  # @see 
https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-bus
+  class BusName < String
+    # @raise Error if not a valid bus name
+    def initialize(s)
+      unless self.class.valid?(s)
+        raise DBus::Error, "Invalid bus name #{s.inspect}"
+      end
+      super
+    end
+
+    def self.valid?(s)
+      s.size <= 255 &&
+        (s =~ /\A:[A-Za-z0-9_-]+(\.[A-Za-z0-9_-]+)+\z/ ||
+         s =~ /\A[A-Za-z_-][A-Za-z0-9_-]*(\.[A-Za-z_-][A-Za-z0-9_-]*)+\z/)
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/dbus/export.rb new/lib/dbus/export.rb
--- old/lib/dbus/export.rb      2018-04-30 17:10:48.000000000 +0200
+++ new/lib/dbus/export.rb      1970-01-01 01:00:00.000000000 +0100
@@ -1,131 +0,0 @@
-# dbus/introspection.rb - module containing a low-level D-Bus introspection 
implementation
-#
-# This file is part of the ruby-dbus project
-# Copyright (C) 2007 Arnaud Cornet and Paul van Tilburg
-#
-# 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.
-
-require "thread"
-require "dbus/core_ext/class/attribute"
-
-module DBus
-  # Exported object type
-  # = Exportable D-Bus object class
-  #
-  # Objects that are going to be exported by a D-Bus service
-  # should inherit from this class. At the client side, use ProxyObject.
-  class Object
-    # The path of the object.
-    attr_reader :path
-    # The interfaces that the object supports. Hash: String => Interface
-    my_class_attribute :intfs
-    self.intfs = {}
-
-    # The service that the object is exported by.
-    attr_writer :service
-
-    @@cur_intf = nil # Interface
-    @@intfs_mutex = Mutex.new
-
-    # Create a new object with a given _path_.
-    # Use Service#export to export it.
-    def initialize(path)
-      @path = path
-      @service = nil
-    end
-
-    # Dispatch a message _msg_ to call exported methods
-    def dispatch(msg)
-      case msg.message_type
-      when Message::METHOD_CALL
-        reply = nil
-        begin
-          if !intfs[msg.interface]
-            raise DBus.error("org.freedesktop.DBus.Error.UnknownMethod"),
-                  "Interface \"#{msg.interface}\" of object \"#{msg.path}\" 
doesn't exist"
-          end
-          meth = intfs[msg.interface].methods[msg.member.to_sym]
-          if !meth
-            raise DBus.error("org.freedesktop.DBus.Error.UnknownMethod"),
-                  "Method \"#{msg.member}\" on interface \"#{msg.interface}\" 
of object \"#{msg.path}\" doesn't exist"
-          end
-          methname = Object.make_method_name(msg.interface, msg.member)
-          retdata = method(methname).call(*msg.params)
-          retdata = [*retdata]
-
-          reply = Message.method_return(msg)
-          meth.rets.zip(retdata).each do |rsig, rdata|
-            reply.add_param(rsig.type, rdata)
-          end
-        rescue => ex
-          dbus_msg_exc = msg.annotate_exception(ex)
-          reply = ErrorMessage.from_exception(dbus_msg_exc).reply_to(msg)
-        end
-        @service.bus.message_queue.push(reply)
-      end
-    end
-
-    # Select (and create) the interface that the following defined methods
-    # belong to.
-    def self.dbus_interface(s)
-      @@intfs_mutex.synchronize do
-        @@cur_intf = intfs[s]
-        if !@@cur_intf
-          @@cur_intf = Interface.new(s)
-          # As this is a mutable class_attr, we cannot use
-          #   self.intfs[s] = @@cur_intf                      # Hash#[]=
-          # as that would modify parent class attr in place.
-          # Using the setter lets a subclass have the new value
-          # while the superclass keeps the old one.
-          self.intfs = intfs.merge(s => @@cur_intf)
-        end
-        yield
-        @@cur_intf = nil
-      end
-    end
-
-    # Dummy undefined interface class.
-    class UndefinedInterface < ScriptError
-      def initialize(sym)
-        super "No interface specified for #{sym}"
-      end
-    end
-
-    # Defines an exportable method on the object with the given name _sym_,
-    # _prototype_ and the code in a block.
-    def self.dbus_method(sym, protoype = "", &block)
-      raise UndefinedInterface, sym if @@cur_intf.nil?
-      @@cur_intf.define(Method.new(sym.to_s).from_prototype(protoype))
-      define_method(Object.make_method_name(@@cur_intf.name, sym.to_s), &block)
-    end
-
-    # Emits a signal from the object with the given _interface_, signal
-    # _sig_ and arguments _args_.
-    def emit(intf, sig, *args)
-      @service.bus.emit(@service, self, intf, sig, *args)
-    end
-
-    # Defines a signal for the object with a given name _sym_ and _prototype_.
-    def self.dbus_signal(sym, protoype = "")
-      raise UndefinedInterface, sym if @@cur_intf.nil?
-      cur_intf = @@cur_intf
-      signal = Signal.new(sym.to_s).from_prototype(protoype)
-      cur_intf.define(Signal.new(sym.to_s).from_prototype(protoype))
-      define_method(sym.to_s) do |*args|
-        emit(cur_intf, signal, *args)
-      end
-    end
-
-    ####################################################################
-
-    # Helper method that returns a method name generated from the interface
-    # name _intfname_ and method name _methname_.
-    # @api private
-    def self.make_method_name(intfname, methname)
-      "#{intfname}%%#{methname}"
-    end
-  end # class Object
-end # module DBus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/dbus/introspect.rb new/lib/dbus/introspect.rb
--- old/lib/dbus/introspect.rb  2018-04-30 17:10:48.000000000 +0200
+++ new/lib/dbus/introspect.rb  2019-10-15 21:16:41.000000000 +0200
@@ -14,10 +14,6 @@
   # Regular expressions that should match all interface names.
   INTERFACE_ELEMENT_RE = /^[A-Za-z][A-Za-z0-9_]*$/
 
-  # Exception raised when an unknown signal is used.
-  class UnknownSignal < Exception
-  end
-
   # Exception raised when an invalid class definition is encountered.
   class InvalidClassDefinition < Exception
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/dbus/message_queue.rb 
new/lib/dbus/message_queue.rb
--- old/lib/dbus/message_queue.rb       2018-04-30 17:10:48.000000000 +0200
+++ new/lib/dbus/message_queue.rb       2019-10-15 21:16:41.000000000 +0200
@@ -11,6 +11,7 @@
 require "socket"
 
 module DBus
+  # Encapsulates a socket so that we can {#push} and {#pop} {Message}s.
   class MessageQueue
     # The socket that is used to connect with the bus.
     attr_reader :socket
@@ -22,10 +23,10 @@
       connect
     end
 
-    # TODO: failure modes
-    #
-    # If _non_block_ is true, return nil instead of waiting
-    # EOFError may be raised
+    # @param non_block [Boolean] if true, return nil instead of waiting
+    # @return [Message,nil] one message or nil if unavailable
+    # @raise EOFError
+    # @todo failure modes
     def pop(non_block = false)
       buffer_from_socket_nonblock
       message = message_from_buffer_nonblock
@@ -124,14 +125,14 @@
 
     # Initialize the connection to the bus.
     def init_connection
-      @client = Client.new(@socket)
-      @client.authenticate
+      client = Client.new(@socket)
+      client.authenticate
     end
 
     public # FIXME: fix Main loop instead
 
     # Get and remove one message from the buffer.
-    # Return the message or nil.
+    # @return [Message,nil] the message or nil if unavailable
     def message_from_buffer_nonblock
       return nil if @buffer.empty?
       ret = nil
@@ -139,7 +140,7 @@
         ret, size = Message.new.unmarshall_buffer(@buffer)
         @buffer.slice!(0, size)
       rescue IncompleteBufferException
-        # fall through, let ret be null
+        # fall through, let ret remain nil
       end
       ret
     end
@@ -149,7 +150,8 @@
 
     # Fill (append) the buffer from data that might be available on the
     # socket.
-    # EOFError may be raised
+    # @return [void]
+    # @raise EOFError
     def buffer_from_socket_nonblock
       @buffer += @socket.read_nonblock(MSG_BUF_SIZE)
     rescue EOFError
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/dbus/object.rb new/lib/dbus/object.rb
--- old/lib/dbus/object.rb      1970-01-01 01:00:00.000000000 +0100
+++ new/lib/dbus/object.rb      2019-10-15 21:16:41.000000000 +0200
@@ -0,0 +1,129 @@
+# This file is part of the ruby-dbus project
+# Copyright (C) 2007 Arnaud Cornet and Paul van Tilburg
+#
+# 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.
+
+require "thread"
+require "dbus/core_ext/class/attribute"
+
+module DBus
+  # Exported object type
+  # = Exportable D-Bus object class
+  #
+  # Objects that are going to be exported by a D-Bus service
+  # should inherit from this class. At the client side, use {ProxyObject}.
+  class Object
+    # The path of the object.
+    attr_reader :path
+    # The interfaces that the object supports. Hash: String => Interface
+    my_class_attribute :intfs
+    self.intfs = {}
+
+    # The service that the object is exported by.
+    attr_writer :service
+
+    @@cur_intf = nil # Interface
+    @@intfs_mutex = Mutex.new
+
+    # Create a new object with a given _path_.
+    # Use Service#export to export it.
+    def initialize(path)
+      @path = path
+      @service = nil
+    end
+
+    # Dispatch a message _msg_ to call exported methods
+    def dispatch(msg)
+      case msg.message_type
+      when Message::METHOD_CALL
+        reply = nil
+        begin
+          if !intfs[msg.interface]
+            raise DBus.error("org.freedesktop.DBus.Error.UnknownMethod"),
+                  "Interface \"#{msg.interface}\" of object \"#{msg.path}\" 
doesn't exist"
+          end
+          meth = intfs[msg.interface].methods[msg.member.to_sym]
+          if !meth
+            raise DBus.error("org.freedesktop.DBus.Error.UnknownMethod"),
+                  "Method \"#{msg.member}\" on interface \"#{msg.interface}\" 
of object \"#{msg.path}\" doesn't exist"
+          end
+          methname = Object.make_method_name(msg.interface, msg.member)
+          retdata = method(methname).call(*msg.params)
+          retdata = [*retdata]
+
+          reply = Message.method_return(msg)
+          meth.rets.zip(retdata).each do |rsig, rdata|
+            reply.add_param(rsig.type, rdata)
+          end
+        rescue => ex
+          dbus_msg_exc = msg.annotate_exception(ex)
+          reply = ErrorMessage.from_exception(dbus_msg_exc).reply_to(msg)
+        end
+        @service.bus.message_queue.push(reply)
+      end
+    end
+
+    # Select (and create) the interface that the following defined methods
+    # belong to.
+    def self.dbus_interface(s)
+      @@intfs_mutex.synchronize do
+        @@cur_intf = intfs[s]
+        if !@@cur_intf
+          @@cur_intf = Interface.new(s)
+          # As this is a mutable class_attr, we cannot use
+          #   self.intfs[s] = @@cur_intf                      # Hash#[]=
+          # as that would modify parent class attr in place.
+          # Using the setter lets a subclass have the new value
+          # while the superclass keeps the old one.
+          self.intfs = intfs.merge(s => @@cur_intf)
+        end
+        yield
+        @@cur_intf = nil
+      end
+    end
+
+    # Dummy undefined interface class.
+    class UndefinedInterface < ScriptError
+      def initialize(sym)
+        super "No interface specified for #{sym}"
+      end
+    end
+
+    # Defines an exportable method on the object with the given name _sym_,
+    # _prototype_ and the code in a block.
+    def self.dbus_method(sym, protoype = "", &block)
+      raise UndefinedInterface, sym if @@cur_intf.nil?
+      @@cur_intf.define(Method.new(sym.to_s).from_prototype(protoype))
+      define_method(Object.make_method_name(@@cur_intf.name, sym.to_s), &block)
+    end
+
+    # Emits a signal from the object with the given _interface_, signal
+    # _sig_ and arguments _args_.
+    def emit(intf, sig, *args)
+      @service.bus.emit(@service, self, intf, sig, *args)
+    end
+
+    # Defines a signal for the object with a given name _sym_ and _prototype_.
+    def self.dbus_signal(sym, protoype = "")
+      raise UndefinedInterface, sym if @@cur_intf.nil?
+      cur_intf = @@cur_intf
+      signal = Signal.new(sym.to_s).from_prototype(protoype)
+      cur_intf.define(Signal.new(sym.to_s).from_prototype(protoype))
+      define_method(sym.to_s) do |*args|
+        emit(cur_intf, signal, *args)
+      end
+    end
+
+    ####################################################################
+
+    # Helper method that returns a method name generated from the interface
+    # name _intfname_ and method name _methname_.
+    # @api private
+    def self.make_method_name(intfname, methname)
+      "#{intfname}%%#{methname}"
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/dbus/object_path.rb new/lib/dbus/object_path.rb
--- old/lib/dbus/object_path.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/lib/dbus/object_path.rb 2019-10-15 21:16:41.000000000 +0200
@@ -0,0 +1,24 @@
+# This file is part of the ruby-dbus project
+# Copyright (C) 2019 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
+  # A {::String} that validates at initialization time
+  class ObjectPath < String
+    # @raise Error if not a valid object path
+    def initialize(s)
+      unless self.class.valid?(s)
+        raise DBus::Error, "Invalid object path #{s.inspect}"
+      end
+      super
+    end
+
+    def self.valid?(s)
+      s == "/" || s =~ %r{\A(/[A-Za-z0-9_]+)+\z}
+    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        2018-04-30 17:10:48.000000000 +0200
+++ new/lib/dbus/proxy_object.rb        2019-10-15 21:16:41.000000000 +0200
@@ -36,7 +36,7 @@
     def initialize(bus, dest, path, api: ApiOptions::CURRENT)
       @bus = bus
       @destination = dest
-      @path = path
+      @path = ObjectPath.new(path)
       @introspected = false
       @interfaces = {}
       @subnodes = []
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/dbus.rb new/lib/dbus.rb
--- old/lib/dbus.rb     2018-04-30 17:10:48.000000000 +0200
+++ new/lib/dbus.rb     2019-10-15 21:16:41.000000000 +0200
@@ -11,14 +11,16 @@
 require_relative "dbus/api_options"
 require_relative "dbus/auth"
 require_relative "dbus/bus"
+require_relative "dbus/bus_name"
 require_relative "dbus/error"
-require_relative "dbus/export"
 require_relative "dbus/introspect"
 require_relative "dbus/logger"
 require_relative "dbus/marshall"
 require_relative "dbus/matchrule"
 require_relative "dbus/message"
 require_relative "dbus/message_queue"
+require_relative "dbus/object"
+require_relative "dbus/object_path"
 require_relative "dbus/proxy_object"
 require_relative "dbus/proxy_object_factory"
 require_relative "dbus/proxy_object_interface"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2018-04-30 17:10:48.000000000 +0200
+++ new/metadata        2019-10-15 21:16:42.000000000 +0200
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: ruby-dbus
 version: !ruby/object:Gem::Version
-  version: 0.15.0
+  version: 0.16.0
 platform: ruby
 authors:
 - Ruby DBus Team
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2018-04-30 00:00:00.000000000 Z
+date: 2019-10-15 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: coveralls
@@ -127,16 +127,18 @@
 - lib/dbus/api_options.rb
 - lib/dbus/auth.rb
 - lib/dbus/bus.rb
+- lib/dbus/bus_name.rb
 - lib/dbus/core_ext/class/attribute.rb
 - lib/dbus/core_ext/module/redefine_method.rb
 - lib/dbus/error.rb
-- lib/dbus/export.rb
 - lib/dbus/introspect.rb
 - lib/dbus/logger.rb
 - lib/dbus/marshall.rb
 - lib/dbus/matchrule.rb
 - lib/dbus/message.rb
 - lib/dbus/message_queue.rb
+- lib/dbus/object.rb
+- lib/dbus/object_path.rb
 - lib/dbus/proxy_object.rb
 - lib/dbus/proxy_object_factory.rb
 - lib/dbus/proxy_object_interface.rb
@@ -147,12 +149,15 @@
 - spec/binding_spec.rb
 - spec/bus_and_xml_backend_spec.rb
 - spec/bus_driver_spec.rb
+- spec/bus_name_spec.rb
 - spec/bus_spec.rb
 - spec/byte_array_spec.rb
+- spec/client_robustness_spec.rb
 - spec/err_msg_spec.rb
 - spec/introspect_xml_parser_spec.rb
 - spec/introspection_spec.rb
 - spec/main_loop_spec.rb
+- spec/object_path_spec.rb
 - spec/property_spec.rb
 - spec/proxy_object_spec.rb
 - spec/server_robustness_spec.rb
@@ -172,7 +177,7 @@
 - spec/variant_spec.rb
 homepage: https://github.com/mvidner/ruby-dbus
 licenses:
-- LGPL v2.1
+- LGPL-2.1
 metadata: {}
 post_install_message: 
 rdoc_options: []
@@ -190,7 +195,7 @@
       version: '0'
 requirements: []
 rubyforge_project: 
-rubygems_version: 2.2.5
+rubygems_version: 2.7.6
 signing_key: 
 specification_version: 4
 summary: Ruby module for interaction with D-Bus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ruby-dbus.gemspec new/ruby-dbus.gemspec
--- old/ruby-dbus.gemspec       2018-04-30 17:10:48.000000000 +0200
+++ new/ruby-dbus.gemspec       2019-10-15 21:16:41.000000000 +0200
@@ -7,7 +7,7 @@
   s.summary = "Ruby module for interaction with D-Bus"
   s.description = "Pure Ruby module for interaction with D-Bus IPC system"
   s.version = File.read("VERSION").strip
-  s.license = "LGPL v2.1"
+  s.license = "LGPL-2.1"
   s.author = "Ruby DBus Team"
   s.email = "martin.git...@vidner.net"
   s.homepage = "https://github.com/mvidner/ruby-dbus";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/bus_name_spec.rb new/spec/bus_name_spec.rb
--- old/spec/bus_name_spec.rb   1970-01-01 01:00:00.000000000 +0100
+++ new/spec/bus_name_spec.rb   2019-10-15 21:16:41.000000000 +0200
@@ -0,0 +1,25 @@
+#!/usr/bin/env rspec
+require_relative "spec_helper"
+require "dbus"
+
+describe DBus::BusName do
+  describe ".valid?" do
+    it "recognizes valid bus names" do
+      expect(described_class.valid?("org.freedesktop.DBus")).to be_truthy
+      expect(described_class.valid?(":1.42")).to be_truthy
+      expect(described_class.valid?("org._7_zip.Archiver")).to be_truthy
+    end
+
+    it "recognizes invalid bus names" do
+      expect(described_class.valid?("")).to be_falsey
+      expect(described_class.valid?("Empty..Component")).to be_falsey
+      expect(described_class.valid?(".Empty.First.Component")).to be_falsey
+      expect(described_class.valid?("Empty.Last.Component.")).to be_falsey
+      expect(described_class.valid?("Invalid.Ch@r@cter")).to be_falsey
+      expect(described_class.valid?("/Invalid-Character")).to be_falsey
+      long_name = "a." + ("long." * 100) + "name"
+      expect(described_class.valid?(long_name)).to be_falsey
+      expect(described_class.valid?("org.7_zip.Archiver")).to be_falsey
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/client_robustness_spec.rb 
new/spec/client_robustness_spec.rb
--- old/spec/client_robustness_spec.rb  1970-01-01 01:00:00.000000000 +0100
+++ new/spec/client_robustness_spec.rb  2019-10-15 21:16:41.000000000 +0200
@@ -0,0 +1,25 @@
+#!/usr/bin/env rspec
+# Test that a client survives various error cases
+require_relative "spec_helper"
+require "dbus"
+
+describe "ClientRobustnessTest" do
+  before(:each) do
+    @bus = DBus::ASessionBus.new
+    @svc = @bus.service("org.ruby.service")
+  end
+
+  context "when the bus name is invalid" do
+    it "tells the user the bus name is invalid" do
+      # user mistake, should be "org.ruby.service"
+      expect { @bus.service(".org.ruby.service") }.to raise_error(DBus::Error)
+    end
+  end
+
+  context "when the object path is invalid" do
+    it "tells the user the path is invalid" do
+      # user mistake, should be "/org/ruby/MyInstance"
+      expect { @svc.object("org.ruby.MyInstance") }.to raise_error(DBus::Error)
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/object_path_spec.rb new/spec/object_path_spec.rb
--- old/spec/object_path_spec.rb        1970-01-01 01:00:00.000000000 +0100
+++ new/spec/object_path_spec.rb        2019-10-15 21:16:41.000000000 +0200
@@ -0,0 +1,23 @@
+#!/usr/bin/env rspec
+require_relative "spec_helper"
+require "dbus"
+
+describe DBus::ObjectPath do
+  describe ".valid?" do
+    it "recognizes valid paths" do
+      expect(described_class.valid?("/")).to be_truthy
+      
expect(described_class.valid?("/99Numbers/_And_Underscores/anywhere")).to 
be_truthy
+      long_name = "/A23456789" * 42
+      # no 255 character limit for object paths
+      expect(described_class.valid?(long_name)).to be_truthy
+    end
+
+    it "recognizes invalid paths" do
+      expect(described_class.valid?("")).to be_falsey
+      expect(described_class.valid?("/Empty//Component")).to be_falsey
+      expect(described_class.valid?("/EmptyLastComponent/")).to be_falsey
+      expect(described_class.valid?("/Invalid Character")).to be_falsey
+      expect(described_class.valid?("/Invalid-Character")).to be_falsey
+    end
+  end
+end

Reply via email to