Changeset 9022 for lang/perl/App-Starter

Show
Ignore:
Timestamp:
04/06/08 23:31:30 (5 years ago)
Author:
tomyhero
Message:

lang/perl/App-Starter : replace ,ignore の設定がマージされなかったのを修正

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

Legend:

Unmodified
Added
Removed
  • lang/perl/App-Starter/trunk/Changes

    r9006 r9022  
    11Revision history for App-Starter 
     2 
     30.13    2008-04-06/23:26 
     4        - bug fix. replace and ignore data was not marged between yaml and parameter... 
     5 
    260.12    2008-04-06/17:27 
    37        - forget to Test:Spelling :add prerequired  
  • lang/perl/App-Starter/trunk/lib/App/Starter.pm

    r9006 r9022  
    1313use base qw/Class::Accessor/; 
    1414 
    15 our $VERSION = '0.12'; 
     15our $VERSION = '0.13'; 
    1616 
    1717my $DIR = {}; 
     
    2525    # get config 
    2626    my $config = {}; 
     27    $config->{replace} = $self->{replace} ? $self->{replace} : {}; 
     28    $config->{ignore}  = $self->{ignore}  ? $self->{ignore}  : []; 
    2729    $config->{from}      = $self->{from}      if $self->{from}; 
    28     $config->{replace}   = $self->{replace}   if $self->{replace}; 
    29     $config->{ignore}    = $self->{ignore}    if $self->{ignore}; 
    3030    $config->{name}      = $self->{name}      if $self->{name}; 
    3131    $config->{tag_style} = $self->{tag_style} if $self->{tag_style}; 
     
    5858 
    5959    if ( $self->{config} ) { 
    60         $config = { %{ LoadFile( $self->{config} ) }, %{$config}, }; 
     60        my $config_from_file = LoadFile( $self->{config} ); 
     61        %$config = ( %$config_from_file, %$config ); 
     62 
     63        $config->{replace} 
     64            = { %{ $config_from_file->{replace} }, %{ $config->{replace} } } 
     65            if $config_from_file->{replace}; 
     66 
     67        push @{ $config->{ignore} }, @{ $config_from_file->{ignore} } 
     68            if $config_from_file->{ignore}; 
    6169    } 
    6270