From 010403fd8a0a0c7b1687ed30d02e1cafb8739a71 Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Wed, 30 Apr 2014 12:17:56 +0000 Subject: [PATCH] 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 --- Changelog | 14 +++++++++++-- General.pm | 17 ++++++++------- General/Extended.pm | 46 +++++++++++++++++++++++++++++++++++------ General/Interpolated.pm | 4 ++-- Makefile.PL | 2 +- 5 files changed, 65 insertions(+), 18 deletions(-) diff --git a/Changelog b/Changelog index eb6e90b..995b725 100644 --- a/Changelog +++ b/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. diff --git a/General.pm b/General.pm index 36260bf..2102022 100644 --- a/General.pm +++ b/General.pm @@ -5,7 +5,7 @@ # config values from a given file and # return it as hash structure # -# Copyright (c) 2000-2013 Thomas Linden . +# Copyright (c) 2000-2014 Thomas Linden . # 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*<>\s*$/i) { + if (/^\s*<>\\s*$/i) { + $incl_file = $2; + } + elsif (/^\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 for more informations. +access the parsed config. See L 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 =head1 VERSION -2.52 +2.53 =cut diff --git a/General/Extended.pm b/General/Extended.pm index a57e381..0c73ff2 100644 --- a/General/Extended.pm +++ b/General/Extended.pm @@ -1,7 +1,7 @@ # # Config::General::Extended - special Class based on Config::General # -# Copyright (c) 2000-2013 Thomas Linden . +# Copyright (c) 2000-2014 Thomas Linden . # 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 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 and the following +tree ( tags ommitted for brevity): + + + + ... + + + ... + + BAR = shoo + +B will find the object at I 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 =head1 VERSION -2.06 +2.07 =cut diff --git a/General/Interpolated.pm b/General/Interpolated.pm index f0d48d6..29d1ad2 100644 --- a/General/Interpolated.pm +++ b/General/Interpolated.pm @@ -2,7 +2,7 @@ # Config::General::Interpolated - special Class based on Config::General # # Copyright (c) 2001 by Wei-Hon Chen . -# Copyright (c) 2000-2013 by Thomas Linden . +# Copyright (c) 2000-2014 by Thomas Linden . # All Rights Reserved. Std. disclaimer applies. # Artistic License, same as perl itself. Have fun. # @@ -340,7 +340,7 @@ L =head1 COPYRIGHT Copyright 2001 by Wei-Hon Chen Eplasmaball@pchome.com.twE. -Copyright 2002-2013 by Thomas Linden . +Copyright 2002-2014 by Thomas Linden . This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/Makefile.PL b/Makefile.PL index e159e3d..9d65ba1 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,7 +1,7 @@ # # Makefile.PL - build file for Config::General # -# Copyright (c) 2000-2013 Thomas Linden . +# Copyright (c) 2000-2014 Thomas Linden . # All Rights Reserved. Std. disclaimer applies. # Artistic License, same as perl itself. Have fun. #