| 1 | package Reply::Config; | ||||||||||
| 2 | 3 | our $AUTHORITY = 'cpan:DOY'; | |||||||||
| 3 | 3 | $Reply::Config::VERSION = '0.42'; | |||||||||
| 4 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | # ABSTRACT: config loading for Reply | ||||||||||
| 7 | |||||||||||
| 8 | 3 | ▶ | use Config::INI::Reader::Ordered; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 3 | ▶ | use File::HomeDir; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 3 | ▶ | use File::Spec; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | |||||||||||
| 13 | |||||||||||
| 14 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 15 | 0 | my $class = shift; | |||||||||
| 16 | 0 | my %opts = @_; | |||||||||
| 17 | |||||||||||
| 18 | $opts{file} = '.replyrc' | ||||||||||
| 19 | 0 | ▶ | unless defined $opts{file}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | |||||||||||
| 21 | my $file = File::Spec->catfile( | ||||||||||
| 22 | (File::Spec->file_name_is_absolute($opts{file}) | ||||||||||
| 23 | ? () | ||||||||||
| 24 | : (File::HomeDir->my_home)), | ||||||||||
| 25 | $opts{file} | ||||||||||
| 26 | 0 | ▶ | ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | |||||||||||
| 28 | 0 | my $self = bless {}, $class; | |||||||||
| 29 | |||||||||||
| 30 | 0 | $self->{file} = $file; | |||||||||
| 31 | 0 | $self->{config} = Config::INI::Reader::Ordered->new; | |||||||||
| 32 | |||||||||||
| 33 | 0 | return $self; | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | |||||||||||
| 37 | 0 | ▶ | sub file { shift->{file} } | ||||||||
|
Subroutine
file: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 38 | |||||||||||
| 39 | |||||||||||
| 40 | 0 | ▶ | sub data { | ||||||||
|
Subroutine
data: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 41 | 0 | my $self = shift; | |||||||||
| 42 | |||||||||||
| 43 | 0 | return $self->{config}->read_file($self->{file}); | |||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | 3 | 1; | |||||||||
| 47 | |||||||||||
| 48 | __END__ | ||||||||||