- fixed rt.cpan.org#27271 - removed output file from
          manifest.

	- fixed rt.cpan.org#27225 - clear vars off the stack
          if entering a new block, so old vars get not re-used.

	- fixed rt.cpan.org#27110 - re-implemented support
          for arrayref as -String parameter.

	- fixed rt.cpan.org#24155 - relative include bug fixed.

	- applied patch by GWYN, (see fixed rt.cpan.org#27622)
 	  which allows the same file included multiple times.
	  there is no loop detection if turned on. new option
	  introduced: -IncludeAgain => 1 (default turned off).

	- added support for -IncludeAgain to directory include
	  code too.

	- the directory globbing code used slashes to join
	  directory and file names. changed this to use catfile()
	  instead.



git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@60 be1acefe-a474-0410-9a34-9b3221f2030f
This commit is contained in:
Thomas von Dein
2009-10-10 16:40:22 +00:00
parent a644abce36
commit 0b78a916bb
8 changed files with 153 additions and 22 deletions

6
t/apache-include.conf Normal file
View File

@@ -0,0 +1,6 @@
<bit one>
include t/included.conf
</bit>
<bit two>
include t/included.conf
</bit>

6
t/dual-include.conf Normal file
View File

@@ -0,0 +1,6 @@
<bit one>
<<include t/included.conf>>
</bit>
<bit two>
<<include t/included.conf>>
</bit>

1
t/included.conf Normal file
View File

@@ -0,0 +1 @@
honk=bonk

31
t/run.t
View File

@@ -8,7 +8,7 @@
use Data::Dumper;
use Test::More tests => 35;
use Test::More tests => 38;
#use Test::More qw(no_plan);
### 1
@@ -394,3 +394,32 @@ my %expect35 = (
'var2' => 'beta'
);
is_deeply(\%conf35, \%expect35, "Using -SplitPolicy and custom -SplitDelimiter");
### Include both
my $conf36 = Config::General->new( -ConfigFile => "t/dual-include.conf",
-IncludeAgain => 1 );
my %C36 = $conf36->getall;
is_deeply( \%C36, { bit => { one => { honk=>'bonk' },
two => { honk=>'bonk' }
} }, "Included twice" );
### Include once
diag "\nPlease ignore the following message about IncludeAgain";
my $conf37 = Config::General->new( "t/dual-include.conf" );
my %C37 = $conf37->getall;
is_deeply( \%C37, { bit => { one => { honk=>'bonk' },
two => {}
} }, "Included once-only" );
### apache-style Include
my $conf38 = Config::General->new( -ConfigFile => "t/apache-include.conf",
-IncludeAgain => 1,
-UseApacheInclude => 1 );
my %C38 = $conf38->getall;
is_deeply( \%C38, { bit => { one => { honk=>'bonk' },
two => { honk=>'bonk' }
} }, "Apache-style include" );