Changeset 17994

Show
Ignore:
Timestamp:
08/22/08 00:13:41 (5 months ago)
Author:
tokuhirom
Message:

- added test cases
- refactoring
- make immutable

Location:
lang/perl/Nanto/trunk
Files:
2 added
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Nanto/trunk/lib/Nanto/Config/Any.pm

    r17993 r17994  
    1616 
    1717    $cache->{$class} ||= do { 
    18         my $cfg = catfile(Nanto::Utils::home($class), config_fname); 
     18        my $cfg = Nanto::Utils::home($class)->file(config_fname); 
    1919        croak "$cfg not found" unless -f $cfg; 
    2020        Config::Any->load_files({ files => [ $cfg ], use_ext => 1 })->[0]->{$cfg}; 
  • lang/perl/Nanto/trunk/lib/Nanto/Config/YAMLSyck.pm

    r17992 r17994  
    44 
    55use Nanto::Utils; 
    6 use File::Spec::Functions; 
    7 use Carp; 
    8 use YAML::Syck; 
     6use Carp (); 
     7use YAML::Syck (); 
    98 
    109my $cache = {}; 
     
    1615 
    1716    $cache->{$class} ||= do { 
    18         my $cfg = catfile(Nanto::Utils::home($class), config_fname); 
    19         croak "$cfg not found" unless -f $cfg; 
     17        my $cfg = Nanto::Utils::home($class)->file(config_fname); 
     18        Carp::croak "$cfg not found" unless -f $cfg; 
    2019        YAML::Syck::LoadFile($cfg); 
    2120    }; 
    2221} 
    2322 
    24 1; 
     23no Moose; __PACKAGE__->meta->make_immutable; 
    2524 
    2625# this is