summaryrefslogtreecommitdiff
path: root/libpiny
diff options
context:
space:
mode:
authorJulian Blake Kongslie <jblake@omgwallhack.org>2011-05-11 22:09:43 -0700
committerJulian Blake Kongslie <jblake@omgwallhack.org>2011-05-11 22:09:43 -0700
commit0c7e2843ae4ae231b10e0ebda5d06fcc431521be (patch)
tree1ccb49bd1a92724417deb638c8bc4a2f3a493ff7 /libpiny
parent681344f391f6a752cc96210ecb3216c1f4515363 (diff)
downloadpiny-code-0c7e2843ae4ae231b10e0ebda5d06fcc431521be.tar.gz
piny-code-0c7e2843ae4ae231b10e0ebda5d06fcc431521be.zip
Inhibit some tweakables from being in the all-tweakables list, and display
undefined values better.
Diffstat (limited to 'libpiny')
-rw-r--r--libpiny/lib/Piny/Config.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/libpiny/lib/Piny/Config.pm b/libpiny/lib/Piny/Config.pm
index d37fa67..3c1ae3f 100644
--- a/libpiny/lib/Piny/Config.pm
+++ b/libpiny/lib/Piny/Config.pm
@@ -183,7 +183,7 @@ sub all_tweakables {
# Tweakable helper
sub tweakable {
- my ( $attr, $default, $isa ) = @_;
+ my ( $attr, $default, $isa, $inhibit ) = @_;
$attr = lc $attr;
@@ -192,7 +192,7 @@ sub tweakable {
if ( $attrname =~ /_/ ) { croak "Illegal attribute name $attrname! (use only one underbar)"; };
- push @tweakables, $attr;
+ push @tweakables, $attr unless defined $inhibit and $inhibit;
has $attr =>
( is => 'rw'
@@ -235,8 +235,8 @@ sub tweakable {
# The tweakables
# Global tweakables, which only make sense in the global config file.
-tweakable "piny_adminemail" => "jrayhawk\@omgwallhack.org", 'Str';
-tweakable "piny_template" => undef, 'Maybe[PathDir]';
+tweakable "piny_adminemail" => "jrayhawk\@omgwallhack.org", 'Str', 'inhibit';
+tweakable "piny_template" => undef, 'Maybe[PathDir]', 'inhibit';
# Repo-specific tweakables, in the repos' .git/config files.
tweakable "piny_ikiwiki" => "true", 'GitBool';