File Coverage

blib/lib/Protocol/DBus/Path.pm
Criterion Covered Total %
statement 12 14 85.7
branch n/a
condition 0 2 0.0
subroutine 4 6 66.6
pod 0 2 0.0
total 16 24 66.6


line stmt bran cond sub pod time code
1             package Protocol::DBus::Path;
2              
3 4     4   32 use strict;
  4         12  
  4         108  
4 4     4   20 use warnings;
  4         8  
  4         92  
5              
6 4     4   1640 use Protocol::DBus::Address ();
  4         12  
  4         88  
7              
8 4     4   32 use constant _DEFAULT_SYSTEM_MESSAGE_BUS => 'unix:path=/var/run/dbus/system_bus_socket';
  4         8  
  4         468  
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   return Protocol::DBus::Address::parse($ENV{'DBUS_SESSION_BUS_ADDRESS'});
15             }
16              
17             sub system_message_bus {
18 0   0 0 0   return Protocol::DBus::Address::parse( $ENV{'DBUS_SYSTEM_BUS_ADDRESS'} || _DEFAULT_SYSTEM_MESSAGE_BUS() );
19             }
20              
21             1;