ponfish
view release on metacpan or search on metacpan
Ponfish/Config.pm view on Meta::CPAN
chdir $base_path || return (); ###!!!die "Can't chdir to dir: '$base_path'";
my @files = glob( $filespec );
@files = map { create_valid_filepath( $base_path, $_ ) } @files;
return @files;
}
return glob $filespec;
}
}
my %prefs =
(
servers => undef,
dirs => {
main => ((WINDOWS) ? "c:/pf/pfdata"
: $ENV{HOME}."/pf/pfdata"),
},
colors => {
incomplete => "red",
highlight => "yellow",
background => "black",
reverse => "bold",
},
prefs => {
#num_decodes => 3,
},
run_settings => { date => "on",
poster => "on",
rhs => 20,
vtype => "bold",
highlight_line => 4,
avail_format => "2",
pagesort => "on",
nolimit => "off",
Ponfish/Config.pm view on Meta::CPAN
sub SERVER_FILE {
return create_valid_filepath( MAIN_DIR, "servers" );
}
sub CONF_DIR {
CONFIG->get_dir( "conf" );
}
# Add more directories to configuration:
for ( qw(cache newsgroups articles data decode trash conf ) ) {
$prefs{dirs}{$_} = create_valid_filepath( MAIN_DIR(), $_ );
}
# Specifics:
if( WINDOWS ) {
$prefs{dirs}{decode} = "C:/pf";
}
else {
$prefs{dirs}{decode} = create_valid_filepath( $ENV{HOME} . "/pf" );
}
# Trash dir:
$prefs{dirs}{trash} = create_valid_filepath( DECODE_DIR(), "junk" );
# Ensure filepaths exist:
for( qw/cache newsgroups articles data decode trash/ ) {
# print "EDE: $_ -> ", CONFIG()->get_dir( $_ ), "\n";;
ensure_dir_exists CONFIG()->get_dir( $_ );
}
sub DATA_DIR {
return CONFIG->get_dir( "data" );
}
Ponfish/Config.pm view on Meta::CPAN
my %freeform_settings = ( decode_dir => 1,
preview_dir => 1,
);
my $singleton = undef;
sub new {
my $type = shift;
if( defined $singleton ) {
return $singleton;
}
$singleton = bless {}, $type;
$singleton->{data} = \%prefs;
return $singleton;
}
sub get_dir {
my $self = shift;
my $dir_name = shift;
return $self->{data}{dirs}{$dir_name};
}
sub get_color {
( run in 1.499 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )