blib/lib/App/Env/Login.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 96.6% 29 / 30 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 # --8<--8<--8<--8<--
2 #
3 # Copyright (C) 2016 Smithsonian Astrophysical Observatory
4 #
5 # This file is part of App::Env::Login
6 #
7 # App::Env::Login is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or (at
10 # your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #
20 # -->8-->8-->8-->8--
21  
22 package App::Env::Login;
23  
24 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 1 our $VERSION = '0.01';
29  
30 1 ▶use File::Spec::Functions qw[ splitpath ];
Subroutine BEGIN: called CC=1 SCAR=0.0
31 1 ▶use Shell::GetEnv '0.08_03';
Subroutine BEGIN: called CC=1 SCAR=0.0
32  
33 sub envs
34 1 ▶{
Subroutine envs: called CC=1 SCAR=0.0
Pod undocumented
35 1 my ( $opt ) = @_;
36  
37 1 my %opt = ( Shell => $ENV{SHELL}, %$opt );
38  
39 1 my $shell = ( splitpath( $opt{Shell} ) )[-1];
40  
41 1 local %ENV = map { $_ => $ENV{$_} } grep { exists $ENV{$_} }qw[ HOME LOGNAME ];
42  
43 1 return Shell::GetEnv->new( $shell, { Login => 1 } )->envs;
44 }
45  
46  
47 __END__
↑ Summary