Skip Menu |
 

This queue is for tickets about the AppConfig CPAN distribution.

Report information
The Basics
Id: 15160
Status: open
Priority: 0/
Queue: AppConfig

People
Owner: Nobody in particular
Requestors: grousse [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)

Attachments


Subject: Allow lazy variable expansion
Download (untitled) / with headers
text/plain 790b
AppConfig performs expansion immediatly when parsing a file, meaning variable definition order matters. a = $b b = 1 => won't work Morevoer, in multiple configuration file scenarios, it doesn't allow easy variable redefinition, as any subsequent including variable as to be redefined also a = 1 b = $a a = 2 => b still equals 1 The following patch add a new value EXPAND_LAZY to expansion policy, that allows variable to get expanded at retrieval time, instead of insertion time. It does this by moving _expand method from File to State, renaming it to _substitue to avoid name clash (additional benefit: should allow variable expansion from elsewhere as file, such as command line options), and adding it an additional context parameter. Additional tests are also included in the patch.
Download AppConfig.patch
text/x-diff 14.2k

Message body is not shown because it is too large.

This updated patch ensure varlist() also apply lazy expansion, and provides better debug output.

Message body is not shown because it is too large.

Subject: Thanks!
From: melcher [...] rescomp.berkeley.edu
Download (untitled) / with headers
text/plain 304b
On Thu Oct 20 11:21:44 2005, GROUSSE wrote: Show quoted text
> This updated patch ensure varlist() also apply lazy expansion, and > provides better debug output.
Thanks! This feature is exactly what I was looking for in order to use AppConfig in a large scale project, with system defaults overwritten by local configs.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.