Changeset 8313

Show
Ignore:
Timestamp:
03/23/08 22:31:50 (6 years ago)
Author:
tomyhero
Message:

lang/perl/OreOre-Starter : TAG_STYLE option support

Location:
lang/perl/OreOre-Starter/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/OreOre-Starter/trunk/conf/config.yaml

    r8311 r8313  
    11name    : myapp 
    22from    : /tmp/oreore-skel/ 
     3#tag_style : star SEE TEMPLATE TAG_STYLE OPTION 
    34ignore  : 
    45    - \.svn 
  • lang/perl/OreOre-Starter/trunk/lib/OreOre/Starter.pm

    r8311 r8313  
    1717my $DIR = {}; 
    1818 
    19 __PACKAGE__->mk_accessors(qw/config name from replace ignore/); 
     19__PACKAGE__->mk_accessors(qw/config name from replace ignore tag_style/); 
    2020 
    2121sub create { 
     
    2424    # get config 
    2525    my $config = {}; 
    26     $config->{from}    = $self->{from}    if $self->{from}; 
    27     $config->{replace} = $self->{replace} if $self->{replace}; 
    28     $config->{ignore}  = $self->{ignore}  if $self->{ignore}; 
    29     $config->{name}    = $self->{name}    if $self->{name}; 
     26    $config->{from}      = $self->{from}      if $self->{from}; 
     27    $config->{replace}   = $self->{replace}   if $self->{replace}; 
     28    $config->{ignore}    = $self->{ignore}    if $self->{ignore}; 
     29    $config->{name}      = $self->{name}      if $self->{name}; 
     30    $config->{tag_style} = $self->{tag_style} if $self->{tag_style}; 
    3031 
    3132    if ( $self->{config} ) { 
     
    3334    } 
    3435 
    35     my $to   = getcwd; 
    36     my $from = $config->{from}; 
    37     my $name = $config->{name}; 
     36    my $to        = getcwd; 
     37    my $from      = $config->{from}; 
     38    my $name      = $config->{name}; 
     39    my $tag_style = $config->{tag_style} || 'template'; 
    3840 
    3941    # check 
     
    5860 
    5961    # create files 
    60     my $template = Template->new( { INCLUDE_PATH => $from } ); 
     62    my $template 
     63        = Template->new( { INCLUDE_PATH => $from, TAG_STYLE => $tag_style } ); 
    6164    for my $file ( @{ $self->{files} } ) { 
    6265        my $to_file = $file;