Skip to content

Commit

Permalink
add VersionControl rule
Browse files Browse the repository at this point in the history
  • Loading branch information
jrockway committed Nov 28, 2009
1 parent c098d99 commit d7bb534
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
18 changes: 18 additions & 0 deletions lib/Path/Filter/Rule/VersionControl.pm
@@ -0,0 +1,18 @@
use MooseX::Declare;

class Path::Filter::Rule::VersionControl
extends Path::Filter::Rule::Set
with Path::Filter::Rule::Static {
use Path::Filter::Rule::VersionControl::Subversion;
use Path::Filter::Rule::VersionControl::Git;

method get_instance(ClassName $class:) {
return $class->new(
rules => [
Path::Filter::Rule::VersionControl::Git::,
Path::Filter::Rule::VersionControl::Subversion::,
],
);
}

}
4 changes: 3 additions & 1 deletion t/basic.t
Expand Up @@ -20,7 +20,7 @@ ok !$filter->filter('.#thing#/foo');
ok !$filter->filter('new.txt');

my $rooted = Path::Filter->new(
rules => [qw/VersionControl::Git/],
rules => [qw/VersionControl/],
root => '/foo/',
);

Expand All @@ -30,4 +30,6 @@ ok $rooted->filter('/foo/.git/refs/heads/');
ok !$rooted->filter('/foo/bar/.git/config');
ok !$rooted->filter('/foo/.gitignore');

ok $rooted->filter('/foo/bar/.svn/baz');

done_testing;

0 comments on commit d7bb534

Please sign in to comment.