ruby-dbus icon indicating copy to clipboard operation
ruby-dbus copied to clipboard

NoMethodError when DISPLAY environment variable is not set

Open sos4nt opened this issue 10 years ago • 1 comments

A NoMethodError is raised when the DISPLAY environment variable is not set due to https://github.com/mvidner/ruby-dbus/blob/v0.11.0/lib/dbus/bus.rb#L611

undefined method '[]' for nil:NilClass (NoMethodError)

sos4nt avatar Jul 10 '14 13:07 sos4nt

Indeed. To reproduce it,

(unset DBUS_SESSION_BUS_ADDRESS DISPLAY; ruby -r dbus -e 'p DBus.session_bus')

I see, a bug fix broke a method that is not covered by tests: https://coveralls.io/files/138379387#L611

mvidner avatar Jul 10 '14 15:07 mvidner