+(DirPath => [ value => $dir_path ], FileName => [ value => $file ])
}
);
+ $solver->add_predicate(
+ path_on => [ qw(On Path FullPath) ],
+ [ qw(+ + -) ] => sub {
+ (my $path = $_{Path}) =~ s/^(:!\/)/.\//;
+ if ($_{On} eq '' or $_{On} eq 'localhost') {
+ (FullPath => [ value => $path ])
+ } else {
+ (FullPath => [ value => join(':', $_{On}, $path) ])
+ }
+ },
+ [ qw(- - +) ] => sub {
+ if (my ($on, $path) = $_{FullPath} =~ /^([^\/]+):(.*)$/) {
+ (On => [ value => $on ], Path => [ value => $path ]);
+ } else {
+ (On => [ value => 'localhost' ], Path => [ value => $_{FullPath} ]);
+ }
+ }
+ );
$solver->add_rule(
does => [ qw(Thing RoleName) ],
[ constrain => [ qw(Thing RoleName) ], sub { $_[0]->DOES($_[1]) } ]