Advanced-Config
view release on metacpan or search on metacpan
quote detection section.
- Config.pm - Changed section() to get_section(), depreciating section()
with a stub function that prints warning if used.
- Config.pm - Added create_section() and no longer exposed new_section()
in the POD. Also added new flag SENSITIVE_SECTION to tell if the section
name was sensitive to fix bug in _base_set() & set_value().
- Reader.pm - Fixed to use get_section() & create_section().
- Reader.pm - Fixed hide section bug in read_config().
- t/*.t - Fixed several test cases to use get_section().
- t/11-manual_build.t - Fixed to use create_section() and to also create
a sensitive section to verify masking words correctly for set_value().
- Options.pm - Fixed floating point numeric checks in apply_get_rules().
- 13-alt-get-tests.t & 13-alt-get-tests.cfg - fixed to allow 1. and .1
as valid numeric test values. Also added numeric flag to compare
arrays function. Also added additional floating point tests.
- Options.pm - Fixed sudo bug returning wrong user in _get_user_id().
- Config.pm - Fixed issue with print_special_vars() when called incorrectly.
- Options.pm - Made corrections to the POD.
- Date.pm - Fixed issue with lc/uc. IE: In German -- M RZ vs m rz
- Date.pm - Added wide char flag to _swap_common(), init_special_date_arrays()
and swap_language() to allow for wide char/utf8 support.
lib/Advanced/Config/Date.pm view on Meta::CPAN
my %languages;
# For Date::Language ... (straight forward)
foreach my $k1 ( keys %date_language_installed_languages ) {
my $lang = $date_language_installed_languages{$k1}->{Language};
$languages{$lang} = 1;
}
# For Date::Manip ... (a bit messy)
# Messy since we can't verify the language without 1st loading it!
foreach my $k1 ( keys %date_manip_installed_languages ) {
my $lang = $date_manip_installed_languages{$k1}->{Language};
my $k2 = ($k1 eq lc($lang)) ? $lang : $k1;
$languages{$k2} = 1;
}
if ( scalar ( keys %languages ) == 0 ) {
$languages{English} = 1;
}
lib/Advanced/Config/Date.pm view on Meta::CPAN
{
my $value = shift;
my $keep_case = shift || 0;
my $wide = ( $value =~ m/[^\x00-\xff]/ ) ? 1 : 0; # Before ...
unless ( $wide ) {
utf8::encode ($value);
utf8::decode ($value);
# Now verify if any of the following makes it wide ...
if ( $value =~ m/[^\x00-\xff]/ ||
lc ($value) =~ m/[^\x00-\xff]/ ||
uc ($value) =~ m/[^\x00-\xff]/ ) {
$wide = 1;
}
}
$value = lc ($value) unless ( $keep_case );
my $alt = $value;
lib/Advanced/Config/Reader.pm view on Meta::CPAN
return DBUG_RETURN ( $tv_pair_flag, $line, "", "", "" );
}
# Handles case where a comment char embedded in the assignment string.
if ( $tv_pair_flag && $value !~ m/${comment}/ ) {
DBUG_PRINT ("LINE", "Simply no comments in the value to worry about ...");
return DBUG_RETURN ( $tv_pair_flag, $line, "", "", "" );
}
# ----------------------------------------------------------------------
# If not protected by balanced quotes, verify the comment symbol detected
# isn't actually a variable modifier. Variables are allowed in most places
# in the config file, not just in tag/value pairs.
# ----------------------------------------------------------------------
# The left & right anchor points for variable substitution ...
my $lvar = convert_to_regexp_string ($opts->{variable_left}, 1);
my $rvar = convert_to_regexp_string ($opts->{variable_right}, 1);
# Determine what value to use in variable substitutions that doesn't include
# a variable tag, or a comment tag, or a value in the $line.
t/30-alt_symbols_cfg.t view on Meta::CPAN
#!/usr/bin/perl
# This test program assumes that "t/config/10-simple.cfg" is 100% valid!
# And that each config file you compare against is an equivalant config file
# to this one.
# This program compares other config files against this one with different
# "Read Options" selected to verify that these other config files parse
# correctly. So if any test cases fail, either the config file is bad or
# there is a bug in this module!
# Rather than modify this program each and every time I want to add a new config
# file to compare against, I use "t/config/30-alt_symbol_control.cfg" as a
# control file that tells how each of the config files it compares against is
# configured. Done this way so I may use any of the "Read Options" I wish
# in setting up a new config file to test against.
# See the comments in this control config file for more details.
t/75-check_all_languages.t view on Meta::CPAN
DBUG_ENTER_FUNC (@_);
my $cfg = shift;
my $pause = shift;
DBUG_PAUSE () if ( $pause );
DBUG_RETURN ( $cfg->load_config () );
}
# --------------------------------------------------------------------
# Compares 2 Advanced::Config objects and verify they are the same!
# Stops on any error encountered.
# --------------------------------------------------------------------
sub compare_objects
{
DBUG_ENTER_FUNC (@_);
my $cfg_src = shift;
my $cfg_dst = shift;
DBUG_PAUSE () unless ( $run_as_developer );
t/76-check_all_languages2.t view on Meta::CPAN
DBUG_ENTER_FUNC (@_);
my $cfg = shift;
my $pause = shift;
DBUG_PAUSE () if ( $pause );
DBUG_RETURN ( $cfg->load_config () );
}
# --------------------------------------------------------------------
# Compares 2 Advanced::Config objects and verify they are the same!
# Stops on any error encountered.
# --------------------------------------------------------------------
sub compare_objects
{
DBUG_ENTER_FUNC (@_);
my $cfg_src = shift;
my $cfg_dst = shift;
DBUG_PAUSE () unless ( $run_as_developer );
( run in 0.439 second using v1.01-cache-2.11-cpan-5467b0d2c73 )