From 94d6da08d046db7d92acf584d4dd646c8812fb7a Mon Sep 17 00:00:00 2001 From: Will Budic Date: Sun, 9 Nov 2025 12:13:50 +1100 Subject: [PATCH] Impl. see CNFMeta->_import_into_this_package(); --- system/modules/CNFParser.pm | 10 +++------- system/modules/RSSFeedsPlugin.pm | 5 +---- tests/testCNFMeta.pl | 2 +- tests/test_CursesProgressBar.pl | 28 +++++++++++----------------- 4 files changed, 16 insertions(+), 29 deletions(-) diff --git a/system/modules/CNFParser.pm b/system/modules/CNFParser.pm index 353b0a3..7482de8 100644 --- a/system/modules/CNFParser.pm +++ b/system/modules/CNFParser.pm @@ -1053,13 +1053,9 @@ sub parse { my ($self, $cnf_file, $content, $del_keys) = @_; } }elsif ($e eq '@'){#collection processing. - my $isArray = $t=~ m/^@/; - # if(!$v && $t =~ m/(.*)>(\s*.*\s*)/gms){ - # $t = $1; - # $v = $2; - # } - my $IsConstant = ($v =~ s/$meta_const/""/sexi); - my @lst = ($isArray?split(/[,\n]/, $v):split('\n', $v)); $_=""; + my $isArray = $t=~ m/^@/; + my $IsConstant = ($v =~ s/$meta_const/""/sexi); + my @lst = ($isArray?split(DELIMITER(), $v):split('\n', $v)); my @props = map { s/^\s+|\s+$//; # strip unwanted spaces s/^\s*["']|['"]$//g;#strip quotes diff --git a/system/modules/RSSFeedsPlugin.pm b/system/modules/RSSFeedsPlugin.pm index ceee7b7..2f7d06d 100644 --- a/system/modules/RSSFeedsPlugin.pm +++ b/system/modules/RSSFeedsPlugin.pm @@ -19,11 +19,8 @@ use LWP::Simple; use Benchmark; use constant VERSION => '1.1'; +CNFParser::_import_into_this_package(); -# require CNFNode; -# require CNFDateTime; - -CNFParser::import(); our %MHDR = %CNFMeta::TABLE_HEADER; our $TZ; diff --git a/tests/testCNFMeta.pl b/tests/testCNFMeta.pl index d72e9da..763bb67 100644 --- a/tests/testCNFMeta.pl +++ b/tests/testCNFMeta.pl @@ -3,7 +3,7 @@ use lib "system/modules"; require TestManager; require CNFParser; -require CNFMeta; CNFMeta->import(); +require CNFMeta; CNFMeta->_import_into_this_package(); my $test = TestManager -> new($0); diff --git a/tests/test_CursesProgressBar.pl b/tests/test_CursesProgressBar.pl index 3cfd33e..d6bf389 100644 --- a/tests/test_CursesProgressBar.pl +++ b/tests/test_CursesProgressBar.pl @@ -1,19 +1,15 @@ #!/usr/bin/env perl -use warnings; use strict; +use strict; use warnings; no warnings qw(experimental::signatures); use Syntax::Keyword::Try; -#no critic "eval" - -### - -use lib::relative "../system/modules"; - require CNFParser; - require CNFDateTime; - require CNFScriptToANSIFormatter; - - -use lib "system/modules"; - -require TestManager; +use feature 'signatures'; +## +# Disable bellow use lib::relative when debugging -> "perl.perlInc" +# if set hard linked to vscode project/workspace finds the right folder. +# + use lib::relative (".","../system/modules"); +## +use CNFParser; +use TestManager; my $test = TestManager -> new($0)-> unsuited(); my $cnf = CNFParser->blank()->parse(undef,q{ <<@<@DIRECTORIES> @@ -49,7 +45,6 @@ localperl use lib "/home/will/dev_new/web_imports_cloned/CPAN/Curses-UI-0.9609/lib"; use Curses::UI; -#use Time::HiRes qw(usleep); use feature 'say'; use File::Type; @@ -80,8 +75,7 @@ package FileCollected { } -sub isExcluded{ - my $path = shift; +sub isExcluded($path){ foreach my $exclude(@EXCLUDE_KEYS){ if($path =~ m/$exclude/){ return 1 if $EXCLUDE_RULES{$exclude} -> ($path,$exclude) -- 2.34.1