-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #819 from gugod/sys-module
a Sys module for quick accessing info about current system.
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package App::Perlbrew::Sys; | ||
use strict; | ||
use warnings; | ||
use Config; | ||
|
||
sub osname { | ||
$Config{osname} | ||
} | ||
|
||
sub archname { | ||
$Config{archname} | ||
} | ||
|
||
sub os { | ||
$Config{osname} | ||
} | ||
|
||
sub arch { | ||
(split(/-/, $Config{archname}, 2))[0] | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use Test2::V0; | ||
|
||
use App::perlbrew; | ||
|
||
subtest 'sys', sub { | ||
my $o = App::perlbrew->new(); | ||
is $o->can("sys"), T(); | ||
is $o->sys->os(), D(); | ||
is $o->sys->arch(), D(); | ||
is $o->sys->osname(), D(); | ||
is $o->sys->archname(), D(); | ||
}; | ||
|
||
done_testing; |