Changeset 19752
- Timestamp:
- 09/23/08 09:47:21 (5 years ago)
- Location:
- lang/perl/App-Hachero/trunk
- Files:
-
- 1 added
- 1 modified
-
lib/App/Hachero/Plugin/Input/File.pm (modified) (2 diffs)
-
t/plugin/input/04_file_rule.t (added)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/App-Hachero/trunk/lib/App/Hachero/Plugin/Input/File.pm
r19478 r19752 4 4 use base qw(App::Hachero::Plugin::Base); 5 5 use File::Find::Rule; 6 use File::Find::Rule::Age; 6 7 use File::stat; 7 8 … … 26 27 sub _get_rule { 27 28 my ($self, $context) = @_; 28 my $work_path = $context->work_path; 29 $self->{rule} = File::Find::Rule->file()->start( $work_path ); 29 my $path = $self->config->{config}->{path} || $context->work_path; 30 my $rule = File::Find::Rule->file(); 31 my $config = $self->config->{config}->{rule}; 32 for my $key (keys %{$config}) { 33 my $value = $config->{$key}; 34 $rule->$key( 35 ref $value eq 'HASH' ? %{$value} : 36 ref $value eq 'ARRAY' ? @{$value} : 37 $value 38 ); 39 } 40 $self->{rule} = $rule->start( $path ); 30 41 return $self->{rule}; 31 42 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)