File Coverage

blib/lib/Protocol/DBus/Path.pm
Criterion Covered Total %
statement 13 14 92.8
branch n/a
condition 1 2 50.0
subroutine 5 6 83.3
pod 0 2 0.0
total 19 24 79.1


line stmt bran cond sub pod time code
1             package Protocol::DBus::Path;
2              
3 5     5   34 use strict;
  5         10  
  5         141  
4 5     5   25 use warnings;
  5         10  
  5         120  
5              
6 5     5   1969 use Protocol::DBus::Address ();
  5         15  
  5         111  
7              
8 5     5   35 use constant _DEFAULT_SYSTEM_MESSAGE_BUS => 'unix:path=/var/run/dbus/system_bus_socket';
  5         10  
  5         580  
9              
10             # NB: If this returns “autolaunch:”, then the system should use
11             # platform-specific methods of locating a running D-Bus session server,
12             # or starting one if a running instance cannot be found.
13             sub login_session_message_bus {
14 0     0 0 0 return Protocol::DBus::Address::parse($ENV{'DBUS_SESSION_BUS_ADDRESS'});
15             }
16              
17             sub system_message_bus {
18 1   50 1 0 11 return Protocol::DBus::Address::parse( $ENV{'DBUS_SYSTEM_BUS_ADDRESS'} || _DEFAULT_SYSTEM_MESSAGE_BUS() );
19             }
20              
21             1;