mirror of
https://codeberg.org/scip/Config-General.git
synced 2025-12-16 12:11:02 +01:00
bumb 2.53, couple of small fixes, spelling fixes.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@98 be1acefe-a474-0410-9a34-9b3221f2030f
This commit is contained in:
14
Changelog
14
Changelog
@@ -1,4 +1,14 @@
|
||||
2.52 - applied pod patch rt.cpan.org#79603
|
||||
2.53 - applied patch rt.cpan.org#68153, which adds a find() method to
|
||||
Config::General::Extended.
|
||||
|
||||
- fixed rt.cpan.org#79869 (in fact it has been fixed in 2.52
|
||||
but I forgot to mention it here).
|
||||
|
||||
- applied spelling fixes rt.cpan.org 87072+87080.
|
||||
|
||||
- fixed rt.cpan.org#89379
|
||||
|
||||
2.52 - applied pod patch rt.cpan.org#79603
|
||||
|
||||
- fixed rt.cpan.org#80006, it tolerates now whitespaces
|
||||
after the block closing >
|
||||
@@ -32,7 +42,7 @@
|
||||
parameters: -NormalizeOption, -NormalizeBlock and -NormalizeValue,
|
||||
which take a subroutine reference and change the block,
|
||||
option or value accordingly.
|
||||
|
||||
|
||||
- fixed rt.cpan.org#65860+76953 undefined value error.
|
||||
|
||||
|
||||
|
||||
17
General.pm
17
General.pm
@@ -5,7 +5,7 @@
|
||||
# config values from a given file and
|
||||
# return it as hash structure
|
||||
#
|
||||
# Copyright (c) 2000-2013 Thomas Linden <tlinden |AT| cpan.org>.
|
||||
# Copyright (c) 2000-2014 Thomas Linden <tlinden |AT| cpan.org>.
|
||||
# All Rights Reserved. Std. disclaimer applies.
|
||||
# Artistic License, same as perl itself. Have fun.
|
||||
#
|
||||
@@ -32,7 +32,7 @@ use Carp::Heavy;
|
||||
use Carp;
|
||||
use Exporter;
|
||||
|
||||
$Config::General::VERSION = "2.52";
|
||||
$Config::General::VERSION = "2.53";
|
||||
|
||||
use vars qw(@ISA @EXPORT_OK);
|
||||
use base qw(Exporter);
|
||||
@@ -727,7 +727,10 @@ sub _read {
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (/^\s*<<include\s+(.+?)>>\s*$/i) {
|
||||
if (/^\s*<<include\s+(["'])(.+?)>>\\s*$/i) {
|
||||
$incl_file = $2;
|
||||
}
|
||||
elsif (/^\s*<<include\s+(.+?)>>\s*$/i) {
|
||||
$incl_file = $1;
|
||||
}
|
||||
}
|
||||
@@ -1814,7 +1817,7 @@ you turn on this option, they will be interpolated as well.
|
||||
=item B<-ExtendedAccess>
|
||||
|
||||
If set to a true value, you can use object oriented (extended) methods to
|
||||
access the parsed config. See L<Config::General::Extended> for more informations.
|
||||
access the parsed config. See L<Config::General::Extended> for more information.
|
||||
|
||||
=item B<-StrictObjects>
|
||||
|
||||
@@ -2709,11 +2712,11 @@ I recommend you to read the following documents, which are supplied with Perl:
|
||||
perllol Perl data structures: arrays of arrays
|
||||
|
||||
Config::General::Extended Object oriented interface to parsed configs
|
||||
Config::General::Interpolated Allows to use variables inside config files
|
||||
Config::General::Interpolated Allows one to use variables inside config files
|
||||
|
||||
=head1 LICENSE AND COPYRIGHT
|
||||
|
||||
Copyright (c) 2000-2013 Thomas Linden
|
||||
Copyright (c) 2000-2014 Thomas Linden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself.
|
||||
@@ -2742,7 +2745,7 @@ Thomas Linden <tlinden |AT| cpan.org>
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
2.52
|
||||
2.53
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Config::General::Extended - special Class based on Config::General
|
||||
#
|
||||
# Copyright (c) 2000-2013 Thomas Linden <tlinden |AT| cpan.org>.
|
||||
# Copyright (c) 2000-2014 Thomas Linden <tlinden |AT| cpan.org>.
|
||||
# All Rights Reserved. Std. disclaimer applies.
|
||||
# Artistic License, same as perl itself. Have fun.
|
||||
#
|
||||
@@ -23,7 +23,7 @@ use vars qw(@ISA @EXPORT);
|
||||
use strict;
|
||||
|
||||
|
||||
$Config::General::Extended::VERSION = "2.06";
|
||||
$Config::General::Extended::VERSION = "2.07";
|
||||
|
||||
|
||||
sub new {
|
||||
@@ -314,7 +314,17 @@ sub configfile {
|
||||
return $this->{configfile};
|
||||
}
|
||||
|
||||
|
||||
sub find {
|
||||
my $this = shift;
|
||||
my $key = shift;
|
||||
return undef unless $this->exists($key);
|
||||
if (@_) {
|
||||
return $this->obj($key)->find(@_);
|
||||
}
|
||||
else {
|
||||
return $this->obj($key);
|
||||
}
|
||||
}
|
||||
|
||||
sub AUTOLOAD {
|
||||
#
|
||||
@@ -557,12 +567,36 @@ If no key name was supplied, then the keys of the object itself will be returned
|
||||
You can use this method in B<foreach> loops as seen in an example above(obj() ).
|
||||
|
||||
|
||||
=item delete ('key')
|
||||
=item delete('key')
|
||||
|
||||
This method removes the given key and all associated data from the internal
|
||||
hash structure. If 'key' contained data, then this data will be returned,
|
||||
otherwise undef will be returned.
|
||||
|
||||
=item find(@list)
|
||||
|
||||
Given a list of nodes, ->find will search for a tree that branches in
|
||||
just this way, returning the Config::General::Extended object it finds
|
||||
at the bottom if it exists. You can also search partway down the tree
|
||||
and ->find should return where you left off.
|
||||
|
||||
For example, given the values B<find (qw (A B C))> and the following
|
||||
tree (</end> tags ommitted for brevity):
|
||||
|
||||
<A>
|
||||
<FOO>
|
||||
...
|
||||
<B>
|
||||
<BAZ>
|
||||
...
|
||||
<C>
|
||||
BAR = shoo
|
||||
|
||||
B<find()> will find the object at I<C> with the value BAR = shoo and
|
||||
return it.
|
||||
|
||||
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -606,7 +640,7 @@ values under the given key will be overwritten.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright (c) 2000-2013 Thomas Linden
|
||||
Copyright (c) 2000-2014 Thomas Linden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself.
|
||||
@@ -623,7 +657,7 @@ Thomas Linden <tlinden |AT| cpan.org>
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
2.06
|
||||
2.07
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Config::General::Interpolated - special Class based on Config::General
|
||||
#
|
||||
# Copyright (c) 2001 by Wei-Hon Chen <plasmaball@pchome.com.tw>.
|
||||
# Copyright (c) 2000-2013 by Thomas Linden <tlinden |AT| cpan.org>.
|
||||
# Copyright (c) 2000-2014 by Thomas Linden <tlinden |AT| cpan.org>.
|
||||
# All Rights Reserved. Std. disclaimer applies.
|
||||
# Artistic License, same as perl itself. Have fun.
|
||||
#
|
||||
@@ -340,7 +340,7 @@ L<Config::General>
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2001 by Wei-Hon Chen E<lt>plasmaball@pchome.com.twE<gt>.
|
||||
Copyright 2002-2013 by Thomas Linden <tlinden |AT| cpan.org>.
|
||||
Copyright 2002-2014 by Thomas Linden <tlinden |AT| cpan.org>.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Makefile.PL - build file for Config::General
|
||||
#
|
||||
# Copyright (c) 2000-2013 Thomas Linden <tom@daemon.de>.
|
||||
# Copyright (c) 2000-2014 Thomas Linden <tom@daemon.de>.
|
||||
# All Rights Reserved. Std. disclaimer applies.
|
||||
# Artistic License, same as perl itself. Have fun.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user