reorg
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 28 Jan 2007 00:35:32 +0000 (00:35 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 28 Jan 2007 00:35:32 +0000 (00:35 +0000)
IkiWiki.pm

index 10d178f3efddc531ab766b413d371ee4aa8789e8..2bef2164e69aea6ae6cc5b13f6626b01f0cebc66 100644 (file)
@@ -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;