diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-01-28 00:35:32 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-01-28 00:35:32 +0000 |
commit | 350a0638968603458b1e4ddd1efc1bccd6e4a606 (patch) | |
tree | b7e2d5ec5b26a5ee55a43e0bcb173e2460aa5d84 | |
parent | 4ff60ef1c50ab182f7ce011de1ff7ca67e99254b (diff) |
reorg
-rw-r--r-- | IkiWiki.pm | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index 10d178f3e..2bef2164e 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -762,6 +762,50 @@ sub safequote ($) { #{{{ return "q{$s}"; } #}}} +sub add_depends ($$) { #{{{ + my $page=shift; + my $pagespec=shift; + + if (! exists $depends{$page}) { + $depends{$page}=$pagespec; + } + else { + $depends{$page}=pagespec_merge($depends{$page}, $pagespec); + } +} # }}} + +sub file_pruned ($$) { #{{{ + require File::Spec; + my $file=File::Spec->canonpath(shift); + my $base=File::Spec->canonpath(shift); + $file=~s#^\Q$base\E/*##; + + my $regexp='('.join('|', @{$config{wiki_file_prune_regexps}}).')'; + $file =~ m/$regexp/; +} #}}} + +my $gettext_obj; +sub gettext { #{{{ + # Only use gettext in the rare cases it's needed. + if (exists $ENV{LANG} || exists $ENV{LC_ALL} || exists $ENV{LC_MESSAGES}) { + if (! $gettext_obj) { + $gettext_obj=eval q{ + use Locale::gettext q{textdomain}; + Locale::gettext->domain('ikiwiki') + }; + if ($@) { + print STDERR "$@"; + $gettext_obj=undef; + return shift; + } + } + return $gettext_obj->get(shift); + } + else { + return shift; + } +} #}}} + sub pagespec_merge ($$) { #{{{ my $a=shift; my $b=shift; @@ -813,50 +857,6 @@ sub pagespec_translate ($) { #{{{ return $code; } #}}} -sub add_depends ($$) { #{{{ - my $page=shift; - my $pagespec=shift; - - if (! exists $depends{$page}) { - $depends{$page}=$pagespec; - } - else { - $depends{$page}=pagespec_merge($depends{$page}, $pagespec); - } -} # }}} - -sub file_pruned ($$) { #{{{ - require File::Spec; - my $file=File::Spec->canonpath(shift); - my $base=File::Spec->canonpath(shift); - $file=~s#^\Q$base\E/*##; - - my $regexp='('.join('|', @{$config{wiki_file_prune_regexps}}).')'; - $file =~ m/$regexp/; -} #}}} - -my $gettext_obj; -sub gettext { #{{{ - # Only use gettext in the rare cases it's needed. - if (exists $ENV{LANG} || exists $ENV{LC_ALL} || exists $ENV{LC_MESSAGES}) { - if (! $gettext_obj) { - $gettext_obj=eval q{ - use Locale::gettext q{textdomain}; - Locale::gettext->domain('ikiwiki') - }; - if ($@) { - print STDERR "$@"; - $gettext_obj=undef; - return shift; - } - } - return $gettext_obj->get(shift); - } - else { - return shift; - } -} #}}} - sub pagespec_match ($$) { #{{{ my $page=shift; my $spec=shift; |