Browse files

fixing: private method `split' called for #<Enumerable::Enumerator>

On ruby-1.8.7,
commit 48c4ba3 breaks
because [IO#lines](http://www.ruby-doc.org/core-1.8.7/IO.html#method-i-lines)
does not accept a block and simply returns an enumerator.

Found by RUBYLIB=lib ruby test/session_bus_test_manual.rb
  • Loading branch information...
1 parent 65634ac commit f25a6953df050ea53dd3bd455660ffabaa5dae75 @mvidner committed Nov 20, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/dbus/bus.rb
View
2 lib/dbus/bus.rb
@@ -746,7 +746,7 @@ def address_from_file
bus_file_path = File.join(ENV["HOME"], "/.dbus/session-bus/#{machine_id}-#{display}")
return nil unless File.exists?(bus_file_path)
- File.open(bus_file_path).lines do |line|
+ File.open(bus_file_path).each_line do |line|
if line =~ /^DBUS_SESSION_BUS_ADDRESS=(.*)/
return $1
end

0 comments on commit f25a695

Please sign in to comment.