Advanced-Config

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

  - Retired option 'date_reverse_test' in favor of option "date_format" to make
    the parsing of numeric dates less ambiguous.  Required a reorg of the
    arguments to all the parse date functions.  Also required to replace arg $up
    with $order so we must pick & choose which format to use.
  - Fixed t/13-alt-get-tests.t to explicitly use "date_enable_yy => 1"
    during all calls to get_date() to allow 2-year dates in the tests!
  - Fixed t/t/09-basic_date.t to explicitly allow 2-year dates in it's
    tests as well.
  - Added option date_dl_conversion to allow the use of Date:Language:str2time()
    to optionally enhance parse_date().
  - Fixed bug in the dynamic DBUG/DBUG::OFF module selection in all module BEGIN
    blocks.
  Never uploaded to CPAN.

1.02 2019-01-08 08:30:00
  - Corrected some significant errors in the POD text.
  - Added some usage errors in move_tag, rename_tag, and delete_tag.
  - Merged rule 5 & 6 tests in lookup_one_variable().  But left
    separate in POD.
  - Added toHash() method to convert object into a hash.
  - Fixed sensitive bug in Options.pm.

Config.pm  view on Meta::CPAN


   my $class = ref ( $prototype ) || $prototype;
   my $self = {};

   # Create an empty object ...
   bless ( $self, $class );

   # Creating a new object ... (The main section)
   my %control;

   # Initialize what options were selected ...
   $control{filename}  = $self->_fix_path ($filename);
   $control{read_opts} = get_read_opts ( $read_opts );
   $control{get_opts}  = get_get_opts ( $get_opts );
   $control{date_opts} = get_date_opts ( $date_opts );

   my ( %dates, %empty, %mods, %ropts, %rec, @lst );

   # Special Date Variables ...
   set_special_date_vars ($control{date_opts}, \%dates);
   $control{DATES}     = \%dates;

Config.pm  view on Meta::CPAN

   my ($opts, %dt);
   unless ( $is_obj ) {
      $opts = get_date_opts ( $date_opts );
   } else {
      $opts = get_date_opts ( $date_opts, $pcfg->{CONTROL}->{date_opts} );
   }
   my $language = $opts->{month_language};
   my $type = ( $opts->{use_gmt} ) ? "gmtime" : "localtime";

   print STDERR "${cmt} The Special Predefined Date Variables ... (in ${language})\n";
   print STDERR "${cmt} The format and language used can vary based on the date options selected.\n";
   print STDERR "${cmt} Uses ${type} to convert the current timestamp into the other values.\n";

   set_special_date_vars ( $opts, \%dt );
   foreach my $k ( sort keys %dt ) {
      print STDERR "   ${la}$k${ra} ${asgn} $dt{$k}\n";
   }

   print STDERR "\n";

   DBUG_VOID_RETURN ();

lib/Advanced/Config/Date.pm  view on Meta::CPAN

         $alt =~ s/[.]$//;
      }
   }

   return ($wide, lc $value, $has_internal_period, $has_ending_period, $alt);
}

# ==============================================================
# It's a mess since Date::Manip allows for aliases.

sub _select_language
{
   DBUG_ENTER_FUNC ( @_ );
   my $lang       = shift;
   my $warn_ok    = shift;
   my $allow_wide = shift;

   my $k = lc ($lang);
   my $manip_ref = $date_manip_installed_languages{$k};
   my $lang_ref  = $date_language_installed_languages{$k};

lib/Advanced/Config/Date.pm  view on Meta::CPAN

{
   DBUG_ENTER_FUNC ( @_ );
   my $lang       = shift;
   my $warn_ok    = shift;
   my $allow_wide = shift || 0;

   if ( (! defined $lang) || lc($lang) eq lc($last_language_edit_flags{language}) ) {
      return DBUG_RETURN ( $last_language_edit_flags{language} );
   }

   my ($manip_ref, $lang_ref) = _select_language ($lang, $warn_ok, $allow_wide);

   unless ( $lang_ref || $manip_ref ) {
      return DBUG_RETURN ( $last_language_edit_flags{language} );
   }

   my ($month_ref, $day_ref, $issue1_ref);
   if ( $manip_ref ) {
      my $old = $manip_ref->{Language};
      ($month_ref, $day_ref, $issue1_ref) =
                  _swap_manip_language_common ($manip_ref, $warn_ok, $allow_wide );

lib/Advanced/Config/Date.pm  view on Meta::CPAN

   my $allow_wide = shift || 0;

   my @months = ( "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" );
   my @week_days = ( "1", "2", "3", "4", "5", "6", "7" );

   my $numbers = ($mode != 1 && $mode != 2 );

   my ( $lang_ref, $manip_ref );

   if ( defined $lang ) {
      ($manip_ref, $lang_ref) = _select_language ($lang, $warn_ok, $allow_wide);

      unless ( $lang_ref || $manip_ref ) {
         $lang = undef;    # So it will enter the early out if block ...
      }
   }

   if ( (! defined $lang) || lc($lang) eq lc($prev_array_lang) || $numbers ) {
      if ( $mode == 1 ) {
         @months    = @gMoYs;      # Abrevited month names ...
         @week_days = @gDoWs;      # Abrevited week names ...

lib/Advanced/Config/Options.pm  view on Meta::CPAN

      @{$result{VALUE}} = reverse ( @{$result{VALUE}} )  if ( $get_opts->{sort} < 0 );
   }

   DBUG_RETURN ( \%result );
}

# ==============================================================

=item $boolean = is_assign_spaces ( $ropts )

Tells if the assignment operator selected is the special case of using spaces
to separate the tag/value pair.  Only returns true if it's B<\\s>.

=cut

# No fish since it's called so frequently, over & over again ...
sub is_assign_spaces
{
   # Checking the ${rOpts} settings ...
   return ( exists $_[0]->{assign} && $_[0]->{assign} eq "\\s" );
}

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.



( run in 0.751 second using v1.01-cache-2.11-cpan-49f99fa48dc )