Mar 28, 2010

ruby-dbus 0.3.0 Works on Ubuntu

ruby-dbus has for a long time not worked on the default Ubuntu desktop. I thought I had fixed it in 0.2.12 but that was only for the server side. In fact, clients had another bug and I have released version 0.3.0 today to fix it.

NEWS:
Bug fixes:
  • Fixed "undefined method `get_node' for nil:NilClass" on Ubuntu Karmic (Ticket#34).
  • Get the session bus address even if unset in ENV (Issue#4).
  • Improved exceptions a bit: UndefinedInterface, InvalidMethodName, NoMethodError, no RuntimeException
These are by Klaus Kaempf:
  • Make the signal dispatcher call all handlers (Issue#3).
  • Run on Ruby < 1.8.7 (Issue#2).
  • Avoid needless DBus::IncompleteBufferException (Ticket#33).
  • Don't ignore DBus Errors in request_service, raise them (Ticket#32).
Features:
  • Automatic signature inference for variants.
  • Introduced FormalParameter where a plain pair had been used.
RPMs can be found via Webpin.

2 comments:

Anonymous said...

Awesome! Is there a way to install as a gem ?

Eduardo Mucelli R. Oliveira said...

Martin,

I'm using Ruby-dbus 0.3.0 and there is a bug when encoded strings are passed trough dbus. I'm interacting with Cairo-Dock, and when I'm using any method that uses a string parameter, e.g., SetQuickInfo("OpenSUSE \343\201\256\343\202\244\343\203") ruby-dbus crashes and stack is:

/usr/local/lib/site_ruby/1.8/dbus/bus.rb:432:in `read_nonblock': end of file reached (EOFError)
from /usr/local/lib/site_ruby/1.8/dbus/bus.rb:432:in `update_buffer'
from /usr/local/lib/site_ruby/1.8/dbus/bus.rb:478:in `wait_for_message'
from /usr/local/lib/site_ruby/1.8/dbus/bus.rb:492:in `send_sync'
from (eval):22:in `SetQuickInfo'

My workaround was to use Iconv like this:

s = "OpenSUSE \343\201\256\343\202\244\343\203"
result = Iconv.iconv('ascii//ignore//translit', 'utf-8', s).to_s
SetQuickInfo(result) # now it works flawless

(hoping the code format will be fine)

Cheers.