view release on metacpan or search on metacpan
full_developer_test.pl.src view on Meta::CPAN
353637383940414243444546474849505152535455# ------------------------------------------------------------------------
use
strict;
use
warnings;
use
ExtUtils::MakeMaker 6.30;
use
File::Spec;
use
File::Basename;
use
File::Copy;
#
The number of fish
log
files to locate
for
each
'make test'
run!
my
$fish_dir_summary
;
my
$fish_dir_details
;
BEGIN {
eval
{
full_developer_test.pl.src view on Meta::CPAN
347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384# Lists the fish files generated by "make test" ...
sub
show_fish_logs
{
my
$fish_dir
=
shift
;
"\nThe fish logs for: FISH_OFF_FLAG == $ENV{FISH_OFF_FLAG} ...\n"
;
my
$wild
= File::Spec->catfile (
$fish_dir
,
"*.fish.txt"
);
my
$cnt
= 0;
foreach
my
$f
( bsd_glob (
$wild
) ) {
" $f\n"
;
++
$cnt
;
}
"Found ${cnt} fish logs ...\n\n"
;
return
(
$cnt
);
}
# Cleans up after previous runs of this program ...
sub
delete_old_fish_logs
{
my
$wild_1
= File::Spec->catfile (
$fish_dir_summary
,
"*.fish.txt"
);
my
$wild_2
= File::Spec->catfile (
$fish_dir_details
,
"*.fish.txt"
);
foreach
my
$f
( bsd_glob (
$wild_1
), bsd_glob (
$wild_2
) ) {
unlink
(
$f
);
}
return
;
}
# Tries to find out the proper 'make' program to use for your platform ...
# Then runs it. If it exits with a non-zero status it assumes it's the
# wrong one and tries out the next one in the list!
lib/Advanced/Config/Date.pm view on Meta::CPAN
697071727374757677787980818283848586878889=over 4
=cut
package
Advanced::Config::Date;
use
strict;
use
warnings;
use
File::Spec;
use
vars
qw( @ISA @EXPORT @EXPORT_OK $VERSION )
;
use
Exporter;
$VERSION
=
"1.12"
;
@ISA
=
qw( Exporter )
;
@EXPORT
= qw( get_languages
swap_language
lib/Advanced/Config/Date.pm view on Meta::CPAN
9293949596979899100101102103104105106107108109110111112
make_it_a_4_digit_year
parse_8_digit_date
parse_6_digit_date
init_special_date_arrays
_date_language_installed
_date_manip_installed
);
@EXPORT_OK
=
qw( )
;
my
$global_cutoff_date
= 30;
# Defaults to 30 years in the future ...
# Thesee haahes tell which language modules are available ...
my
%date_language_installed_languages
;
my
%date_manip_installed_languages
;
# ========================================================================
# Detects if the optional Date::Language module is available ...
# If it's not installed, you'll be unable to swap languages using it!
BEGIN
{
lib/Advanced/Config/Date.pm view on Meta::CPAN
114115116117118119120121122123124125126127128129130131132133
local
$SIG
{__DIE__} =
""
;
# Find out where it's installed
my
$loc
=
$INC
{
"Date/Language.pm"
};
$loc
=~ s/[.]pm$//;
my
$search
= File::Spec->catfile (
$loc
,
"*.pm"
);
# Get's the list of languages supported.
foreach
my
$f
( bsd_glob (
$search
) ) {
my
$module
= (File::Spec->splitdir(
$f
))[-1];
$module
=~ s/[.]pm$//;
my
%data
= (
Language
=>
$module
,
Module
=>
"Date::Language::${module}"
);
$date_language_installed_languages
{
lc
(
$module
)} = \
%data
;
}
};
}
lib/Advanced/Config/Date.pm view on Meta::CPAN
370371372373374375376377378379380381382383384385386387388389390
warn
"==> ${msg}\n"
;
}
DBUG_VOID_RETURN ();
}
# ==============================================================
# No POD on purpose ...
# Does some common logic for swap_language() & init_special_date_arrays().
# Requires knowledge of the internals to Date::Language::<language>
# in order to work.
# This method should avoid referencing any global variables!
# Returns: undef or the references to the 5 arrays!
sub
_swap_lang_common
{
DBUG_ENTER_FUNC (
@_
);
my
$lang_ref
=
shift
;
my
$warn_ok
=
shift
;
my
$allow_wide
=
shift
|| 0;
my
$base
=
"Date::Language"
;
lib/Advanced/Config/Date.pm view on Meta::CPAN
479480481482483484485486487488489490491492493494495496497498
DBUG_RETURN ( \
@lMoY
, \
@lMoYs
, \
@lDsuf
, \
@lDoW
, \
@lDoWs
, \
%issues
);
}
# ==============================================================
# No POD on purpose ...
# Does some common logic for swap_language() & init_special_date_arrays().
# Requires knowledge of the internals to Date::Manip::Lang::<language>
# in order to work.
# This method should avoid referencing any global variables!
# Returns: undef or the references to the 5 arrays!
# I would have broken it up ino multiple functions if not for the wide test!
sub
_swap_manip_language_common
{
DBUG_ENTER_FUNC (
@_
);
my
$lang_ref
=
shift
;
my
$warn_ok
=
shift
;
my
$allow_wide
=
shift
|| 0;
lib/Advanced/Config/Date.pm view on Meta::CPAN
682683684685686687688689690691692693694695696697698699700701702So assuming one of the language modules are intalled, it asks it
for
the list of
months in the requested language. And once that list is retrieved only months
in that language are supported
when
parsing a date string.
true. Otherwise that language is disabled. Using the I<use_ut8> option
when
creating the Advanced::Config object causes the I<
$wide
> flag to be set to B<1>.
=cut
# NOTE: Sets the following global variables for use by parse_date() ...
# %last_language_edit_flags
# %Months
# %Days
sub swap_language
{
DBUG_ENTER_FUNC ( @_ );
my $lang = shift;
my $warn_ok = shift;
my $allow_wide = shift || 0;
lib/Advanced/Config/Date.pm view on Meta::CPAN
15511552155315541555155615571558155915601561156215631564156515661567156815691570This affects all L<Advanced::Config> objects, not just the current one.
=cut
sub adjust_future_cutoff
{
DBUG_ENTER_FUNC ( @_ );
my $years = shift;
if ( defined $years && $years =~ m/^\d+$/ ) {
$global_cutoff_date = shift;
}
DBUG_VOID_RETURN ();
}
# ==============================================================
=item $year = make_it_a_4_digit_year ( $two_digit_year );
lib/Advanced/Config/Date.pm view on Meta::CPAN
158415851586158715881589159015911592159315941595159615971598159916001601160216031604{
DBUG_ENTER_FUNC (
@_
);
my
$year
=
shift
|| 0;
# Passed as a 2-digit year ...
$year
+= 2000;
# Convert it to a 4-digit year ...
# Get the current 4-digit year ...
my
$this_yr
= (
localtime
(
time
()))[5];
$this_yr
+= 1900;
if
(
$this_yr
<
$year
&& (
$year
-
$this_yr
) >=
$global_cutoff_date
) {
$year
-= 100;
# Make it last century instead.
}
DBUG_RETURN (
$year
);
}
# ==============================================================
=item ($year, $month, $day) = parse_8_digit_date ( $date_str, $order[, $skip] );
lib/Advanced/Config/Date.pm view on Meta::CPAN
184418451846184718481849185018511852185318541855185618571858185918601861186218631864
}
}
if
(
$lang_ref
) {
(
$MoY_ref
,
$MoYs_ref
,
$Dsuf_ref
,
$DoW_ref
,
$DoWs_ref
) =
_swap_lang_common (
$lang_ref
,
$warn_ok
,
$allow_wide
);
$lang
=
$lang_ref
->{Language};
}
# If the new language was valid, update the global variables ...
if
(
$MoY_ref
) {
$prev_array_lang
=
$lang
;
@gMoY
= @{
$MoY_ref
};
@gMoYs
=
map
{
uc
(
$_
) } @{
$MoYs_ref
};
@gDoW
= @{
$DoW_ref
};
@gDoWs
=
map
{
uc
(
$_
) } @{
$DoWs_ref
};
@gDsuf
= @{
$Dsuf_ref
};
DBUG_PRINT (
"LANGUAGE"
,
"%s\n%s\n%s\n%s\n%s"
,
join
(
", "
,
@gMoY
),
join
(
", "
,
@gMoYs
),
lib/Advanced/Config/Options.pm view on Meta::CPAN
125126127128129130131132133134135136137138139140141142143144=pod
B<trap_recursion> - Defaults to B<0>. Set to B<1> if you want to treat
recursion as a fatal error when loading a config file. By default it just
ignores the recursion request to prevent infinite loops.
B<source_cb_opts> - A work area for holding values between calls to the
callback function. This is expected to be a hash reference to provide any
needed configuration values needed to parse the next config file. This way
you can avoid global varibles. Defaults to an empty hash reference.
B<source_cb> - An optional callback routine called each time your config file
sources in another config file. It's main use is when the I<Read Options>
and/or I<Date Format Options> required to parse each config file change between
files. It's automatically called right before the sourced in file is opened up
for parsing.
Once the new file is sourced in, it inherits most of the options currently used
unless you override them. The only ones not inherited deal with decryption.
lib/Advanced/Config/Options.pm view on Meta::CPAN
330331332333334335336337338339340341342343344345346347348349same B<pass_pharase>
when
you source in a
sub
-file in your config files.
name you are running the program under as part of the encryption key. So only
the user who encryted the file can decrypt it.
B<encrypt_cb_opts> - A work area
for
holding
values
between calls to the
callback function. This is expected to be a hash reference to provide any
values
needed by your encryption efforts. So you can avoid global variables
and having to figure out the correct context of the call. Defaults to an empty
hash reference.
B<encrypt_cb> - An optional callback function to provide hooks
for
B<true
encryption> or an additional layer of masking. It defaults to
no
callback
function used. This callback function is called in addition to any obscuring
work done by this module.
Here is the callback function's expected definition:
lib/Advanced/Config/Options.pm view on Meta::CPAN
372373374375376377378379380381382383384385386387388389390391392393394395396397398=head2 Z<>
=head1 The Get Options
This section deals with the options you can use to override how the I<B<get>>
methods behave when you try to access the values for individual tags. None
of the options below allows leading or trailing spaces in it's value. If any
are found, they will be automatically trimmed off before their value is used.
Internal spaces are OK.
These options can be set as global defaults via the call to the constructor,
B<new()>, or for individual B<get_...> calls if you don't like the defaults
for individual calls.
But it is strongly recomended that the B<inherit> option only be set in the
constructor and not changed elsewhere. Changing it's value beween calls can
cause strange behavior if you do so. Since it globally affects how this
module locates the requested tag and affects variable lookups when the
config file is parsed.
After that, where to set the other options is more a personal choice than
anything else.
=over 4
B<inherit> - Defaults to B<0> where each section is independent, the tag either
exists or it doesn't in the section. Set to B<1> if each section should be
lib/Advanced/Config/Options.pm view on Meta::CPAN
572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
my
$tag
=
shift
;
my
$value
=
shift
;
# Clear text sensitive value ...
my
$file
=
shift
;
my
$cbOpts
=
shift
;
DBUG_MASK ( 0 );
DBUG_RETURN (
$value
);
}
# ==============================================================
# Initialize the global hashes with their default values ...
BEGIN
{
DBUG_ENTER_FUNC ();
# ---------------------------------------------------------------------
# Make sure no hash value is undef !!!
# ---------------------------------------------------------------------
# You can only add to this list, you can't remove anything from it!
# See should_we_hide_sensitive_data () on how this list is used.
DBUG_PRINT (
"INFO"
,
"Initializing the tag patterns to hide from fish ..."
);
push
(
@hide_from_fish
,
"password"
);
push
(
@hide_from_fish
,
"pass"
);
push
(
@hide_from_fish
,
"pwd"
);
# ---------------------------------------------------------------------
DBUG_PRINT (
"INFO"
,
"Initializing the READ options global hash ..."
);
# Should always be set in the constructor ...
$default_read_opts
{tag_case} = 0;
# Case sensitive tags.
# The generic options ...
my
%src_empty
;
$default_read_opts
{croak} = 0;
# Don't croak by default.
$default_read_opts
{export} = 0;
# Don't export any tag/val pairs.
$default_read_opts
{use_utf8} = 0;
# Doesn't support utf8/Unicode/Wide Chars.
$default_read_opts
{disable_quotes} = 0;
# Don't disable balanced quotes.
$default_read_opts
{disable_variables} = 0;
# Don't disable variables!
lib/Advanced/Config/Options.pm view on Meta::CPAN
650651652653654655656657658659660661662663664665666667668669670# Special undocumented test prog option for overriding fish in parse_line().
$default_read_opts
{dbug_test_use_case_parse_override} = 0;
# Always off.
# Special undocumented test prog option for overriding fish in read_config().
$default_read_opts
{dbug_test_use_case_hide_override} = 0;
# Always off.
# ---------------------------------------------------------------------
DBUG_PRINT (
"INFO"
,
"Initializing the GET options global hash ..."
);
# Should always be set in the constructor ...
$default_get_opts
{inherit} = 0;
# Can inherit from the parent section.
# The generic options ... Who cares where set!
$default_get_opts
{required} = 0;
# Return undef by default.
$default_get_opts
{vcase} = 0;
# Case of the value. (0 = as is)
$default_get_opts
{split_pattern} =
qr /\s+/;
# Space separated lists.
# Used in parsing dates for get_date() ...
$default_get_opts
{date_language} =
"English"
;
# The language to use in parsing dates.
lib/Advanced/Config/Options.pm view on Meta::CPAN
679680681682683684685686687688689690691692693694695696697$default_get_opts
{auto_true} = 0;
# Don't return as boolean.
$default_get_opts
{filename} = 0;
# Tag doesn't do a file test.
$default_get_opts
{directory} = 0;
# Tag doesn't do a directory test.
$default_get_opts
{
split
} = 0;
# Don't split the value.
$default_get_opts
{
sort
} = 0;
# Don't sort the split value. (1 - sort, -1 - reverse sort)
$default_get_opts
{date_active} = 0;
# 0-No, 1-Yes expecing it to be a date.
# ---------------------------------------------------------------------
DBUG_PRINT (
"INFO"
,
"Initializing the DATE formatting options global hash ..."
);
$default_date_opts
{date_order} = 0;
# 0 - YMD, 1 - MDY, 2 - DMY
$default_date_opts
{date_sep} =
"-"
;
# Separator to format dates with.
$default_date_opts
{month_type} = 0;
# 0 - numeric, 1 - abbreviate, 2 - full.
$default_date_opts
{month_language} =
"English"
;
# See Date::Language.
$default_date_opts
{use_gmt} = 0;
# 0 - localtime, 1 - gmtime.
# $default_date_opts{timestamp} = ?; # Special case can't set directly.
# ---------------------------------------------------------------------
lib/Advanced/Config/Reader.pm view on Meta::CPAN
7475767778798081828384858687888990919293949596979899100101102103104105106107108109@ISA
=
qw( Exporter )
;
@EXPORT
=
qw( read_config source_file make_new_section parse_line
expand_variables apply_modifier parse_for_variables
format_section_line format_tag_value_line format_encrypt_cmt
encrypt_config_file_details decrypt_config_file_details )
;
@EXPORT_OK
=
qw( )
;
my
$skip_warns_due_to_make_test
;
my
%global_sections
;
my
$gUserName
;
# ==============================================================
# NOTE: It is extreemly dangerous to reference Advanced::Config
# internals in this code. Avoid where possible!!!
# Ask for copies from the module instead.
# ==============================================================
# Any other module initialization done here ...
# This block references initializations done in my other modules.
BEGIN
{
DBUG_ENTER_FUNC ();
# What we call our default section ...
$global_sections
{DEFAULT} = Advanced::Config::Options::DEFAULT_SECTION_NAME;
$global_sections
{OVERRIDE} =
$global_sections
{DEFAULT};
$gUserName
= Advanced::Config::Options::_get_user_id ();
# Is the code being run via "make test" environment ...
if
(
$ENV
{PERL_DL_NONLAZY} ||
$ENV
{PERL_USE_UNSAFE_INC} ||
$ENV
{HARNESS_ACTIVE} ) {
$skip_warns_due_to_make_test
= 1;
}
lib/Advanced/Config/Reader.pm view on Meta::CPAN
415416417418419420421422423424425426427428429430431432433434435sub
source_file
{
DBUG_ENTER_FUNC (
@_
);
my
$cfg
=
shift
;
my
$defaultSection
=
shift
;
# The new default section if not "".
my
$new_file
=
shift
;
# May contain variables to expand ...
my
$old_file
=
shift
;
# File we're currently parsing. (has abs path)
my
$rOpts
=
$cfg
->get_cfg_settings ();
# The Read Options ...
local
$global_sections
{OVERRIDE} =
$defaultSection
if
(
$defaultSection
);
my
$pcfg
=
$cfg
->get_section ();
# Back to the main/default section ...
my
$file
=
$new_file
= expand_variables (
$pcfg
,
$new_file
,
undef
,
undef
, 1);
# Get the full name of the file we're sourcing in ...
$file
=
$pcfg
->_fix_path (
$file
, dirname (
$old_file
) );
unless
( -f
$file
&& -r _ ) {
my
$msg
=
"No such file to source in or it's unreadable ( $file )"
;
lib/Advanced/Config/Reader.pm view on Meta::CPAN
481482483484485486487488489490491492493494495496497498499500501502503504505=cut
sub make_new_section
{
DBUG_ENTER_FUNC (@_);
my $config = shift;
my $new_name = shift;
# Check if overriding the default section with a new name ...
if ( $new_name eq "" || $new_name eq $global_sections{DEFAULT} ) {
if ( $global_sections{DEFAULT} ne $global_sections{OVERRIDE} ) {
DBUG_PRINT ("OVERRIDE", "Overriding section '%s' with section '%s'",
$new_name, $global_sections{OVERRIDE});
$new_name = $global_sections{OVERRIDE};
}
}
my $pcfg = $config->get_section (); # Back to the main section ...
my $val = expand_variables ($pcfg, $new_name, undef, undef, 1);
$new_name = lc ( $val );
# Check if the section name is already in use ...
my $old = $pcfg->get_section ( $new_name );
t/20-validate_encrypt_decrypt.t view on Meta::CPAN
306307308309310311312313314315316317318319320321322323324325326# =================================================================
sub
init_cfg_file
{
DBUG_ENTER_FUNC (
@_
);
my
$file
=
shift
;
my
$rOpts
=
shift
;
my
%empty
;
# Empty out the global hashes ...
%decrypt_callback_tags
=
%encrypt_callback_tags
=
%empty
;
my
$cfg
;
eval
{
if
(
$rOpts
) {
$cfg
= Advanced::Config->new (
$file
,
$rOpts
);
}
else
{
$cfg
= Advanced::Config->new (
$file
, {
encrypt_cb
=> \
&my_security_callback
} );
}
dbug_isa_ok (
$cfg
,
'Advanced::Config'
);
t/30-alt_symbols_cfg.t view on Meta::CPAN
157158159160161162163164165166167168169170171172173174175176177
# Since I didn't count the test cases, must end my program
# with a call to this method. Can't do tests in END anymore!
done_testing ();
DBUG_LEAVE (0);
}
# ====================================================================
# This is the source_cb callback function named in: 30-alt_symbol_control.cfg
# All it does is lookup the options to use from the
# appropriate section in the conig file. (global var)
sub
ALTER_SOURCE_CALLBACK_OPTIONS
{
DBUG_ENTER_FUNC (
@_
);
my
$file
=
shift
;
my
$custom
=
shift
;
my
$f
= basename (
$file
);
DBUG_ENTER_BLOCK (
"GRAB"
);
DBUG_PAUSE();
t/75-check_all_languages.t view on Meta::CPAN
12345678910111213141516171819202122232425262728293031323334353637383940#!/usr/bin/perl
use
strict;
use
warnings;
use
Test::More;
use
File::Basename;
use
File::Spec;
use
Fred::Fish::DBUG 2.09
qw (
on );
use
Fred::Fish::DBUG::Test 2.09;
# How to find the helper module ...
BEGIN {
push
(
@INC
, File::Spec->catdir (
"."
,
"t"
,
"test-helper"
)); }
use
helper1234;
# ---------------------------------------------------------------------
# Automatically creates a config file with all Date::Languages in use.
# It doesn't use the tools Advanced::Config has to give me more
# direct control on how the config file is created. Also when originally
# created those tools hadn't been created yet.
# ---------------------------------------------------------------------
# After the config file has been created it attempts to use the
# Config object to validate everything works.
# ---------------------------------------------------------------------
my
$fish
;
my
$config_file_normal
;
my
$config_file_wide
;
my
@global_languages
;
my
@global_lang_use_utf8
;
my
$run_as_developer
= 0;
BEGIN {
# The config file this program is to create!
$config_file_normal
= File::Spec->catfile (dirname ($0),
"config"
,
"75-all_languages_normal.cfg"
);
$config_file_wide
= File::Spec->catfile (dirname ($0),
"config"
,
"75-all_languages_wide.cfg"
);
unlink
(
$config_file_normal
,
$config_file_wide
);
$fish
= turn_fish_on_off_for_advanced_config ();
t/75-check_all_languages.t view on Meta::CPAN
9293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
}
# Lookup where to find the Language modules ...
my
$key
= File::Spec->catfile (
"Date"
,
"Language"
) .
".pm"
;
my
$lang_dir
=
$INC
{
$key
};
$lang_dir
=
$INC
{
'Date/Language.pm'
}
unless
(
$lang_dir
);
$lang_dir
=~ s/[.]pm$//;
my
$search
= File::Spec->catdir (
$lang_dir
,
"*.pm"
);
# Get's the list of languages supported.
foreach
my
$f
( bsd_glob (
$search
) ) {
my
@dirs
= File::Spec->splitdir (
$f
);
$dirs
[-1] =~ s/[.]pm//;
push
(
@global_languages
,
$dirs
[-1]);
push
(
@global_lang_use_utf8
, uses_utf8_module (
$f
));
}
if
(
$#global_languages
== -1 ) {
dbug_ok (1,
"No Date::Language::<lang> modules are installed. Skipping this test!"
);
done_testing ();
DBUG_LEAVE (0);
}
# Now load all those modules ...
foreach
my
$l
(
@global_languages
) {
my
$module
=
"Date::Language::${l}"
;
use_ok (
$module
);
}
DBUG_VOID_RETURN ();
}
END {
DBUG_ENTER_FUNC ();
# Don't do any tests in the END block ...
t/75-check_all_languages.t view on Meta::CPAN
727728729730731732733734735736737738739740741742743744745746747748}
# ====================================================================
sub
load_all_language_data
{
DBUG_ENTER_FUNC (
@_
);
my
%lang_data
;
my
$lidx
= 0;
foreach
my
$lang
(
@global_languages
) {
my
$uses_utf8_mod
=
$global_lang_use_utf8
[
$lidx
++];
my
$module
=
"Date::Language::${lang}"
;
my
(
$lang_wide
,
$lang_utf8
) = ( 0, 0 );
# @Dsuf isn't always available for some modules.
my
@lMoY
=
eval
"\@${module}::MoY"
;
# The fully spelled out Months.
my
@lMoYs
=
eval
"\@${module}::MoYs"
;
# The legal Abbreviations.
my
@lDsuf
=
eval
"\@${module}::Dsuf"
;
# The suffix for the Day of Month. (buggy)
my
@lDoW
=
eval
"\@${module}::DoW"
;
# The Day of Week.
my
@lDoWs
=
eval
"\@${module}::DoWs"
;
# The Day of Week Abbreviations.
t/76-check_all_languages2.t view on Meta::CPAN
123456789101112131415161718192021222324252627282930313233343536373839#!/usr/bin/perl
use
strict;
use
warnings;
use
Test::More;
use
File::Basename;
use
File::Spec;
use
Fred::Fish::DBUG 2.09
qw (
on );
use
Fred::Fish::DBUG::Test 2.09;
# How to find the helper module ...
BEGIN {
push
(
@INC
, File::Spec->catdir (
"."
,
"t"
,
"test-helper"
)); }
use
helper1234;
# ---------------------------------------------------------------------
# Automatically creates a config file with all Date::Manip::Lang::*.pm in use.
# It doesn't use the tools Advanced::Config has to give me more
# direct control on how the config file is created. Also when originally
# created those tools hadn't been created yet.
# ---------------------------------------------------------------------
# After the config file has been created it attempts to use the
# Config object to validate everything works.
# ---------------------------------------------------------------------
my
$fish
;
my
$config_file_normal
;
my
$config_file_wide
;
my
@global_modules
;
my
$run_as_developer
= 0;
BEGIN {
# The config file this program is to create!
$config_file_normal
= File::Spec->catfile (dirname ($0),
"config"
,
"76-all_languages_normal-2.cfg"
);
$config_file_wide
= File::Spec->catfile (dirname ($0),
"config"
,
"76-all_languages_wide-2.cfg"
);
unlink
(
$config_file_normal
,
$config_file_wide
);
$fish
= turn_fish_on_off_for_advanced_config ();
t/76-check_all_languages2.t view on Meta::CPAN
798081828384858687888990919293949596979899100101102103104105106107108
if
($@) {
dbug_ok (1,
"Date::Manip::Lang::index is not installed. This version of Date::Manip (v${ver}) is not supported. Skipping this test!"
);
done_testing ();
DBUG_LEAVE (0);
}
my
%val
;
foreach
my
$v
(
values
%Date::Manip::Lang::index::Lang
) {
$val
{
$v
} = 1;
}
@global_modules
=
sort
keys
%val
;
if
(
$#global_modules
== -1 ) {
dbug_ok (1,
"No Date::Manip::Lang::<lang> modules are installed. Skipping this test!"
);
done_testing ();
DBUG_LEAVE (0);
}
# Now load all those modules ...
foreach
my
$l
(
@global_modules
) {
my
$module
=
"Date::Manip::Lang::${l}"
;
use_ok (
$module
);
}
DBUG_VOID_RETURN ();
}
END {
DBUG_ENTER_FUNC ();
# Don't do any tests in the END block ...
t/76-check_all_languages2.t view on Meta::CPAN
744745746747748749750751752753754755756757758759760761762763764}
# ====================================================================
sub
load_all_language_data
{
DBUG_ENTER_FUNC (
@_
);
my
%lang_data
;
foreach
my
$mod
(
@global_modules
) {
my
$module
=
"Date::Manip::Lang::${mod}"
;
my
(
$lang_wide
,
$lang_utf8
) = ( 0, 0 );
my
$Language
=
eval
"\$${module}::LangName"
;
# The proper name of this language.
my
$langData
=
eval
"\$${module}::Language"
;
# A hash reference with the data!
my
%months
;
my
%days
;