- fixed rt.cpan.org#61302, now croak if the config file
parameter is a directory and directory include is not
turned on.
- fixed rt.cpan.org#60429 META.yml typo
- added new option -AllowSingleQuoteInterpolation, which
turns on interpolation for variables inside single quotes.
- added test case for the new option
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@91 be1acefe-a474-0410-9a34-9b3221f2030f
- fixed rt.cpan.org#35122. This one was one of the most
intriguing bugs I've ever observed in my own code. The
internal temporary __stack hashref were copied from one
subhash to another to enable inheritance of variables.
However, the hashes were copied by reference, so once a
value changed later, that value were overwritten because
the __stack in question were just a reference. I introduced
a simple function _copy() which copies the contents of
the __stack by value, which solved the bug.
Conclusion: beware of perl hash refs!
- fixed rt.cpan.org#36607, accept whitespaces in heredoc
names if split delimiter is gues (equalsign or whitespace)
- fixed rt.cpan.org#34080 (typo)
- fixed rt.cpan.org#35766. Variables inside single quoted
strings will no more interpolated (as the docu states).
Also added test case for this.
- fixed bug rt.cpan.org#33766. Checking for defined not true
in ::Extended::AUTOLOAD().
- added -UTF8 flag, which opens files in utf8 mode
(suggested by KAORU, rt.cpan.org#35583)
I decided not to add a test case for this, since perls
utf8 support is not stable with all versions.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@65 be1acefe-a474-0410-9a34-9b3221f2030f
- fixed rt.cpan.org#31529 variable inheritance failed
with multiple named blocks.
- fixed rt.cpan.org#33447, regex to catch variable
names were too strict, now - . + or : are allowed too.
- fixed rt.cpan.org#33385 and #32978 - using arrayrefs
as param to -String didn't work anymore (sic)
- fixed rt.cpan.org#33216 - variable stack were not properly
re-constructed for pre-existing variables if
-MergeDuplicateOptions is turned on.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@64 be1acefe-a474-0410-9a34-9b3221f2030f
- 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
- fixed rt.cpan.org#26333 - just return $con if env var
is undefined.
- applied part of a patch supplied by Vincent Rivellino <vince@cuz.cx>
which turns off explicit empty block support if in
apache compatibility mode, see next.
- added new option -ApacheCompatible, which makes the
module behave really apache compatible by setting the
required options.
- a little bit re-organized the code, most of the stuff
in new() is now outsourced into several extra subs to
make maintenance of the code easier. The old new() sub
in fact was a nightmare.
- fixed a bug reported by Otto Hirr <otto.hirr@olabinc.com>:
the _store() sub used sort() to sort the keys, which conflicts
with sorted hashes (eg. tied using Tie::IxHash).
- fixed tie bug reported by King, Jason <kingj@newsltd.com.au>,
loading of the tie module didn't work.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@59 be1acefe-a474-0410-9a34-9b3221f2030f
- fixed rt.cpan.org#24232 - import ENV vars only if defined
- fixed rt.cpan.org#20742 - dont' overwrite a var if re-defined
in current scope, interpolation failed for re-defined vars and used
the value of the var defined in outer scope, not the current one.
- fixed rt.cpan.org#17852 - a 0 as blockname were ignored. applied
patch by SCOP to t/run.t to test for 0 in blocks.
- applied most hints Perl::Critic had about Config::General:
o the functions ParseConfig SaveConfig SaveConfigString must
now imported implicitly. This might break existing code, but
is easily to fix.
o using IO::File instead of open().
o General.pm qualifies for "stern" level after all.
- added much more tests to t/run.t for 'make test'.
- using Test::More now.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@58 be1acefe-a474-0410-9a34-9b3221f2030f
- applied patches by Jason Rhinelander <jagerman@jagerman.com>:
o bugfix: multiple levels if include files didn't
work properly.
o new option -IncludeDirectories, which allows
to include all files of a directory. The directory
must be specified by -ConfigFile as usual.
o new option -IncludeGlob, which allows to
use globs (wildcards) to include multiple files.
o -ConfigPath can be speciefied using a single
scalar value instead of an array if there is only
one path.
o bugfix: quotes from quoted block names were
not removed properly.
o fixes and updates for tests (make test) for
the above patches.
Thanks a lot Jason.
- fixed number of tests in run.t
- applied suggestion by Eric Kisiel <eric.kisiel@adelphia.com>:
::Extended::keys() returns an empty hash if the
referring object is not hash.
- fixed bug #14770, "Use of uninitialized value.." during
environment variable interpolation.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@57 be1acefe-a474-0410-9a34-9b3221f2030f
- applied patch by Branislav Zahradnik
<brano@blueorange.sk> which adds -InterPolateEnv.
This allows to use environment variables too. It
implies -InterPolateVars.
- added object list capability for the ::Extended::obj()
method. If a certain key points to an array of
hashrefs, then the whole arrayref is returned.
Suggested by Alan Hodgkinson <alan@softxs.ch>.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@56 be1acefe-a474-0410-9a34-9b3221f2030f
- fixed bug in save(), now blocks containing whitespaces
will be saved using quotes, in addition the parser observes
the quoting feature, added portion about this to the pod
doc. pointed out by Jeff Murphy <jcmurphy@jeffmurphy.org>.
- added internal list of files opened so far to avoid
reading in the same file multiple times.
Suggested by Michael Graham.
- added new method files() which returns the above list.
- added workaround for foolish perl installation on
debian systems (croak() doesn't work anymore as of
5.8.4, it's a shame!)
- applied patch by Michael Graham which fixes IncludeRelative
feature, now an included file is being included relative
to the calling config file, not the first one.
- added 'make test' targets for files() and include
stuff. (by Michael too)
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@54 be1acefe-a474-0410-9a34-9b3221f2030f
- bugfix in _store, which caused warning when saving
a config containing empty hashes. Reported by
herbert breunung <deirdre_skye@web.de>.
- removed applied patch (added in 2.20), there are no more
calls to binmode(), this destroys portability, because
perls determines itself wether it uses \n or \r\n as newline.
Reported by herbert breunung too.
- applied patch by Danial Pearce <danial@infoxchange.net.au>,
scalars containing a backslash as the last character will
be written out as here-doc when storing a config to disk.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@53 be1acefe-a474-0410-9a34-9b3221f2030f
- fixed invalid regexp in _open() which circumvented
explicit empty block to work when the block statement
included whitespaces.
- more finetuning in Makefile.PL for cleaning emacs'
~ files.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@52 be1acefe-a474-0410-9a34-9b3221f2030f
- fixed bug with not working -IncludeRelative setting when
including a config file. It were only included from the
location relative to the underlying config if it were
non-existent. reported by Dmitry Koteroff <dmitry@koteroff.ru>.
- applied patch by Danial Pearce <danial@infoxchange.net.au>
which adds the -BackslashEscape parameter to enable
general escaping of special characters using the
backslash.
- fixed bug reported by Harold van Oostrom <cpan@lanceerplaats.nl>:
according to the documentation one can call new() with
a hash-ref as its single parameter which would then
used as the config. This didn't work and were fixed.
- added feature suggested by Eric Andreychek <eric@openthought.net>:
now block statements like this are allowed: "<directory blah/>"
which is called an explicit empty block. This generates just
an empty hash-ref and saves writing. In fact, internally it
will be converted to:
<directory blah>
</directory>
- fixed Makefile.PL: it cleans now files generated by 'make test'
properly. reported by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
- updated MANIFEST (in fact I did this some years ago the last time!)
also reported by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@51 be1acefe-a474-0410-9a34-9b3221f2030f
- fixed Bug #3869 (rt.cpan.org) reported by
"Mike Depot" <mdepot@comcast.net>
- applied patch by Roland Huss <Roland.Huss@consol.de>,
which fixes a bug with the -Tie option, sub-hashes of
named blocks were not properly created (in fact, not
tied).
- added documentation to Interpolated.pm that it does not
interpolate variables in keys, see bug #3773 (rt.cpan.org).
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@50 be1acefe-a474-0410-9a34-9b3221f2030f
- fixed bug reported by Stefano di Sandro <stedis@ulis.it>: in
OOP mode (extended access) the obj() method returned the whole
config object if the given key does not exist. Now it returns
a new empty object.
- added patch by David Dick <david_dick@iprimus.com.au> which
sets $/ if it is unset.
- added patch by David Dick <david_dick@iprimus.com.au> which
calls the binmode() function in case the modules is being
used under win32 systems. Read perldoc -f binmode for more
informations on this issue.
- added feature suggested by Chase Phillips <cmp@uiuc.edu>:
the new() method has a new parameter -Tie which takes the
name of a Tie class that each new hash should be based off
of. This makes it possible to create a config hash with
ordered contents across nested structures.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@46 be1acefe-a474-0410-9a34-9b3221f2030f
- forgot to import 'catfile' from File::Spec. Bug reported by
various people.
- applied patch by Peter Tandler <Peter.Tandler@ipsi.fhg.de>
which adds a search-path feature for include files.
- applied patch by David Dick <david_dick@iprimus.com.au> which
adds an auto launder capability to the module which makes it
possible to use variables read by Config::General in a
tainted perlscript (executed with -T) for open(), backtick calls
or something which the taintmode considers to be dangerous.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@45 be1acefe-a474-0410-9a34-9b3221f2030f
- fixed Bug #2325 (rt.cpan.org). The subs exported by File::Spec
will now imported explicitly.
- fixed warning about double my'ed variable $dummi, changed it
to undef because it was unused anyway.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@44 be1acefe-a474-0410-9a34-9b3221f2030f
- applied patch by Michael Gray <mjg17@eng.cam.ac.uk> which
fixes a bug in the Interpolate.pm submodule. A second variable,
when immediately following the first, did not get interpolated,
i.e. ${var1}${var2}.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@42 be1acefe-a474-0410-9a34-9b3221f2030f
<folarte@peoplecall.com>, which caused _parse to
ignore blocks with the name "0":
<0> .. </0>, because it checked just if $block (the name
between < and >) is true, and from the perl point
of view "0" is not. Changed it to check for defined.
Normally I avoid using 'defined' but in this case
it will not be possible that $block contains the
empty string, so defined is ok here.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@40 be1acefe-a474-0410-9a34-9b3221f2030f
the parser was still active inside a here-doc, which
cause weird results if the here-doc contained
multiple <<XXX strings.
this bug has been fixed by re-organizing the _read()
method. now the parser is only active outside of
here-docs.
- here-doc parsing bug fixed, which ignored the
-SplitPolicy settings completely, now it is aware
of the split policy
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@39 be1acefe-a474-0410-9a34-9b3221f2030f
by the -DefaultConfig parameter was ignored by
the new interpolation code, this has been fixed.
- fixed another bug in the new interpolation code,
which made variable global, the variable scope
were ignored. Now a special constructed hash
exists, which makes sure, that variables only
valid within its correct scope.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@38 be1acefe-a474-0410-9a34-9b3221f2030f
Peter Sergeant <pete@clueball.com> reported this
mis-behavior. The problem was that the whole hash
was feeded to ::Interpolated.pm, but as we all
know, perl hashes doesn't preserve the order. So,
in our case the module sometimes was unable to
resolve variablenames, because they were stored
in a different location as it occured in the config.
The change is, that Config::General now calls
::Interpolate.pm (new sub: _interpolate()) itself
directly on a per-key/value pair basis. The internal
varstack is now stored on $this globally. So, now
a variable will be known when it occurs. period :-
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@37 be1acefe-a474-0410-9a34-9b3221f2030f
ignore undefined variables and replaces such occurences
with the emppty string.
- applied patch by Stefan Moser <sm@open.ch>, which fixes
some weird bevavior if -MergeDuplicateOptions was turned
on, the parser croaked regardless -MergeDuplicateBlocks
was set or not. Now the two options behave almost independent
from each other, which allows one to merge duplicate
blocks but duplicate options not.
- changed behavior of setting -MergeDuplicateOptions which
implied in previous versions -AllowMultiOptions to be
false. Now this will only be done if the user does not
set -AllowMultiOptions by himself. This allows one to
have duplicate blocks which will be turned into an
array but duplicate options to be merged.
- applied patch by Matthias Pitzl <matthias@izb.net>, which
fixes a bug at parsing apache-like include directive
(Include ...). It did not properly trim unnecessary whitespaces
so that the filename to be included became invalid. This
bug espessially occurred if one saved a hash containing
a key/value pair like this: "Include" => "/etc/grs.cfg",
which was then saved as "Include /etc/grs.cfg", the
parser returned " /etc/grs.cfg" which, of course, does
not exists. odd...
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@34 be1acefe-a474-0410-9a34-9b3221f2030f
function call which caused the module to croak.
- added feature request, if in extended mode (OOP turned
on with -ExtendedAccess => 1 access to non-existent keys
caused a croak. While this is still the default behavior
it is now possible to turn this off using -StrictObjects => 0.
- added this to the related pod section in ::Extended.
- fixed bug in new() which caused a couple of errors
if the ConfigFile parameter is not set, or is set to
undef. In this case it will now simply create an empty
object.
- fixed related bug in save_file() which will save "" to
a file now if the config is uninitialized (i.e. the case
mentioned below arrived).
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@33 be1acefe-a474-0410-9a34-9b3221f2030f
- removed whitespace support in keys in the default parser
SplitPolicy 'guess', which was introduced in 2.02. Now
I (re-)use the old regex I used before. if you need
whitespaces in keys, use 'equalsign' as SplitPolicy.
- the write_scalar() method uses the StoreDelimiter for
separating options from values.
- added -CComments to make it possible to turn c-comment
parsing off.
- added support for FileHandle objects as parameter to the
-ConfigFile parameter. This makes it possible to use locking.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@32 be1acefe-a474-0410-9a34-9b3221f2030f
reason I cant remember all of its methods. This included
keys() exists() and delete(), which are perl internals.
If one used keys() on a normal hash, then the ::Extended
own keys() were used instead of perls own one. I removed
the export line.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@31 be1acefe-a474-0410-9a34-9b3221f2030f
module populates now uses of uninitialized variables in
config files itself instead of just letting perl die().
The other suggestion of the RFE was declined.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@30 be1acefe-a474-0410-9a34-9b3221f2030f
after the last patch for allowing whitespaces in
option names, it had a problem with here-docs which
contained equal signs. option/value splitting resulted
in weird output.
- as a side effect of the bug fix below it is now
possible to use equal signs inside quoted values, which
will then be ignored, thus not used for splitting
the line into an option/value assignment.
- added a new test, which tests for all possible notations
of option/value lines.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@29 be1acefe-a474-0410-9a34-9b3221f2030f
whitespaces in option names.
- changed the save() calls in the test script (t/run.t)
to save_file()
- removed new() from ::Interpolated and ::Extended.
This may break existing code (they will need to
move to the flags of Config::General::new() ), but
this decision must be made. The problem was that
both the old way of directly using the subclasses
and the enw way did not work together. So, now
subclasses are only method holders and used by
Config::General on request. Direct use of subclasses
is prohibited. (you receive a warning if you do).
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@28 be1acefe-a474-0410-9a34-9b3221f2030f
-ConfigHash (in replace for -hash) to get a consistent
parameter naming scheme. The old names are still
supported for backward compatibility, but no more
documented.
- the parameter -BaseHash has been dropped because
-DefaultConfig already has the capabilities of
defining a custom backing hash. The pod section for
-DefaultConfig has been enhanced to reflect this.
- README changed something. Removed the 'small' keyword,
because the module isn't really small anymore :-)
At least IMHO.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@27 be1acefe-a474-0410-9a34-9b3221f2030f
bit better to understand.
- added new parameter -DefaultConfig, which can hold a hashref
or a string, which will be used to pre-define values
of the resulting hash after parsing a config.
Thanks to Mark Hampton <mark.hampton@qualis.com> for the
suggestion.
- added new parameter -MergeDuplicateOptions, which allows
one to overwrite duplicate options, which is required,
if you turn on -DefaultConfig, because otherwise a
array would be created, which is probably not what you
wanted.
- added patch by Danial Pearce <danial@infoxchange.net.au>
to Config::General::Extended::keys(), which allows to
retrieve the keys of the object itself (which was not
directly possible before)
- added patch by Danial Pearce <danial@infoxchange.net.au>
to Config::General::Extended::value(), which allows to
set a value to a (perlish-) nontrue value. This was a
bug.
- added patch by Danial Pearce <danial@infoxchange.net.au>
to Config::General::_parse_value, which fixes a bug in
this method, which in prior versions caused values of
"0" (zero digit) to be wiped out of the config.
- added tests in t/run.t for the new default config feature.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@25 be1acefe-a474-0410-9a34-9b3221f2030f
in a way which avoids the existence of this identifier
inside the here-doc, which if it happens results in
weird behavior in the resulting config.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@24 be1acefe-a474-0410-9a34-9b3221f2030f
in _store(), which caused the module to create scalar
entries even if the entry contained newlines. While
Danial supplied a patch to fix this - thx(TM) - I
did not apply it, because I "outsourced" this kind of
stuff to the subroutine _write_scalar(), see next.
- added internal methods _write_scalar() and _write_hash()
to simplify _store(), which did the same thing more
than once, which is a good time to create a sub which
does the job.
- fixed cut'n paste bug in General/Extended.pm reported by
Danial Pearce <danial@infoxchange.net.au>, which caused
Config::General::Extended::is_scalar() to return true even
when the key you pass in is an array.
- added new method Config::General::Extended::delete() suggested
by Danial Pearce <danial@infoxchange.net.au>, which deletes
the given key from the config.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@23 be1acefe-a474-0410-9a34-9b3221f2030f
could happen, in 1.29 it was "lost". However -
I added it again now.
- added patch by Peder Stray <peder@linpro.no> to
the _store() method, which makes it possible to catch
arrays of hashes to be stored correctly.
- cleaned up the t/run.t testscript to reflect the
changes (in fact I did not touch it since 1.18 or so).
- added test number 16 to test variable interpolation
using ::Interpolated in t/run.t.
- fixed bug with new() parameter -AllowMultiOptions which
generated a croak() if set to something other than "no".
- changed Extended::save() to reflect the API change,
it calls now save_file().
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@21 be1acefe-a474-0410-9a34-9b3221f2030f
- added 2 procedural functions ParseConf and SaveConf
- added new parameters -AutoTrue and -FlagBits
- added save_file() which replaces save(), which was
weird implemented. If the user only supplied a hash
as parameter to save(), then the first key was
used as the filename and the rest was used
as a config hash (which was then of an uneven size).
- save_file() takes now instead of a hash a hash-ref
and a filename. And the hashref is optional, since
the object already contains a complete hash.
- new method save_string() added, which returns the
ready generated string instead of writing it to
disk. The user can then save it himself.
- POD updated.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@17 be1acefe-a474-0410-9a34-9b3221f2030f