Changeset 12549 for lang/perl/chalow

Show
Ignore:
Timestamp:
05/27/08 19:47:07 (5 years ago)
Author:
yappo
Message:

assets dir を指定できるようにした

Location:
lang/perl/chalow/branches/perlnews
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/chalow/branches/perlnews/chalow

    r12541 r12549  
    308308### ���ޥ�饤���topt::Long::Configure('bundling'); 
    309309my ($opt_topn_tmp, $outputdir, $quiet_mode, $opt_css_file, $debug_mode, 
    310     $update_by_size, $conf_file, $stop_date); 
     310    $update_by_size, $conf_file, $stop_date, $assets_dir); 
    311311my $gor = GetOptions('n|top-n=n'   => \$opt_topn_tmp, 
    312312                     'o|output-dir=s'   => \$outputdir, 
     
    317317                     'q|quiet' => \$quiet_mode, 
    318318                     '8|utf8' => \$utf8_mode, 
    319                      'd|debug' => \$debug_mode); 
     319                     'd|debug' => \$debug_mode, 
     320                     'a|assets=s' => \$assets_dir); 
    320321 
    321322if (@ARGV == 0 or $gor == 0) { 
     
    331332    -8, --utf8                  utf8 mode 
    332333    -d, --debug                 debug mode 
     334    -a, --assets=DIR            assets dir 
    333335USAGE 
    334336    ; 
     
    347349 
    348350$outputdir = "." if (not defined $outputdir); 
     351 
     352# assets dir ������App::Chalow::Template::assets_dir = ($assets_dir || $FindBin::Bin) . '/'; 
    349353 
    350354# �桼�����ե������ꥳ�ޥ�饤���ͥ������ 
  • lang/perl/chalow/branches/perlnews/lib/App/Chalow/Template.pm

    r12545 r12549  
    77 
    88# 超適当 
    9 use FindBin; 
    10 my $assets_dir = File::Spec->catfile($FindBin::Bin, 'assets'); 
    11 my $template = Template->new({ INCLUDE_PATH => "$assets_dir/template" }); 
     9our $assets_dir; 
     10my $template; 
    1211 
    1312### インデックスページ(index.html)を作る 
    1413sub index { 
     14    $template ||= Template->new({ INCLUDE_PATH => "$assets_dir/template" }); 
    1515    my($class, $cl, $opt_topn, $month_page, $changelog_name, $changelog_description, $css_file, $what_time_is_it_now, $signature, $month_page_list, $latest_item_list, $category_list, $rss_filename, $outputdir, $replace_once, $update_by_size, $utf8_mode, $quiet_mode,  
    1616     $calendar_style, 
     
    9191 
    9292sub item { 
     93    $template ||= Template->new({ INCLUDE_PATH => "$assets_dir/template" }); 
    9394    my($class, $cl, $opt_topn, $month_page, $changelog_name, $changelog_description, $css_file, $what_time_is_it_now, $signature, $month_page_list, $latest_item_list, $category_list, $rss_filename, $outputdir, $replace_once, $update_by_size, $utf8_mode, $quiet_mode,  
    9495     $clog_url,