| 1 | package Skilletor; | ||||||||||||||||||||||||||||
| 2 | # ABSTRACT: Install skills, agents and rules from remote sources – the Perl port of skilletor | ||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 28 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 28 | ▶ | use Carp qw( croak ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 28 | ▶ | use Skilletor::Engine; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 28 | ▶ | use Skilletor::Entry qw( name_key ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 28 | ▶ | use Skilletor::Error::Ambiguous; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 28 | ▶ | use Skilletor::Error::Unsupported; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 28 | ▶ | use Skilletor::FSUtil qw( path_join ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 28 | ▶ | use namespace::clean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 28 | our $VERSION = '0.001'; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 28 | has home => ( | |||||||||||||||||||||||||||
| 16 | is => 'ro', | ||||||||||||||||||||||||||||
| 17 | required => 1, | ||||||||||||||||||||||||||||
| 18 | ); | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 28 | has project_dir => ( | |||||||||||||||||||||||||||
| 21 | is => 'ro', | ||||||||||||||||||||||||||||
| 22 | ); | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | has fetch => ( | ||||||||||||||||||||||||||||
| 25 | is => 'ro', | ||||||||||||||||||||||||||||
| 26 | 76 | ▶ | default => sub { 'always' }, | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 27 | 28 | ); | |||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | has require_harness => ( | ||||||||||||||||||||||||||||
| 30 | is => 'ro', | ||||||||||||||||||||||||||||
| 31 | 192 | ▶ | default => sub { 0 }, | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 32 | 28 | ); | |||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 28 | has [qw( state_root cache_root codex_home timeout_ms lock_timeout_ms is_git_work_tree git_tracked git_remote plugin_root )] => ( | |||||||||||||||||||||||||||
| 35 | is => 'ro', | ||||||||||||||||||||||||||||
| 36 | ); | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | has resolver => ( | ||||||||||||||||||||||||||||
| 39 | is => 'lazy', | ||||||||||||||||||||||||||||
| 40 | 64 | ▶ | builder => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.0
Subroutine
_build_resolver: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||
| 41 | 64 | my ( $self ) = @_; | |||||||||||||||||||||||||||
| 42 | return Skilletor::Engine->new( | ||||||||||||||||||||||||||||
| 43 | home => $self->home, | ||||||||||||||||||||||||||||
| 44 | project_dir => $self->project_dir, | ||||||||||||||||||||||||||||
| 45 | fetch => $self->fetch, | ||||||||||||||||||||||||||||
| 46 | require_harness => $self->require_harness, | ||||||||||||||||||||||||||||
| 47 | 64 | ▶ | map { defined $self->$_ ? ( $_ => $self->$_ ) : () } | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 48 | qw( state_root cache_root codex_home timeout_ms lock_timeout_ms is_git_work_tree git_tracked git_remote plugin_root ), | ||||||||||||||||||||||||||||
| 49 | ); | ||||||||||||||||||||||||||||
| 50 | }, | ||||||||||||||||||||||||||||
| 51 | 28 | ); | |||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 0 | ▶ | sub engine { $_[0]->resolver } | ||||||||||||||||||||||||||
|
Subroutine
engine: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | # A sync changes what the lookups would answer: the resolution they answer from goes with it. | ||||||||||||||||||||||||||||
| 56 | 6 | ▶ | sub sync { | ||||||||||||||||||||||||||
|
Subroutine
sync: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 57 | 6 | my ( $self, %opts ) = @_; | |||||||||||||||||||||||||||
| 58 | 6 | my $report = $self->resolver->sync(%opts); | |||||||||||||||||||||||||||
| 59 | 4 | $self->refresh; | |||||||||||||||||||||||||||
| 60 | 4 | return $report; | |||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | 4 | ▶ | sub check { | ||||||||||||||||||||||||||
|
Subroutine
check: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 64 | 4 | my ( $self, %opts ) = @_; | |||||||||||||||||||||||||||
| 65 | 4 | return $self->resolver->check(%opts); | |||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | 2 | ▶ | sub status { | ||||||||||||||||||||||||||
|
Subroutine
status: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 69 | 2 | my ( $self, %opts ) = @_; | |||||||||||||||||||||||||||
| 70 | 2 | return $self->resolver->status(%opts); | |||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | # The resolution of every scope that resolve_* answer from, made on first use. | ||||||||||||||||||||||||||||
| 74 | has _resolution => ( | ||||||||||||||||||||||||||||
| 75 | is => 'lazy', | ||||||||||||||||||||||||||||
| 76 | init_arg => undef, | ||||||||||||||||||||||||||||
| 77 | clearer => 'refresh', | ||||||||||||||||||||||||||||
| 78 | 143 | ▶ | builder => sub { $_[0]->resolver->resolve( scope => 'all', throw => 1 ) }, | ||||||||||||||||||||||||||
|
Subroutine
_build__resolution: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 79 | 28 | ); | |||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||
| 81 | 107 | ▶ | sub resolve { | ||||||||||||||||||||||||||
|
Subroutine
resolve: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 82 | 107 | my ( $self, %opts ) = @_; | |||||||||||||||||||||||||||
| 83 | 107 | return $self->resolver->resolve(%opts); | |||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | # One resolved item as the record resolve_item returns. | ||||||||||||||||||||||||||||
| 87 | 1241 | ▶ | sub _record { | ||||||||||||||||||||||||||
|
Subroutine
_record: called CC=8 SCAR=21.0
| |||||||||||||||||||||||||||||
| 88 | 1241 | my ( $self, $scope, $ri ) = @_; | |||||||||||||||||||||||||||
| 89 | 1241 | my $ci = $ri->{item}; | |||||||||||||||||||||||||||
| 90 | 1241 | my $root = $ri->{sourceDir}; | |||||||||||||||||||||||||||
| 91 | 1241 | my @files = @{ $ci->{files} }; | |||||||||||||||||||||||||||
| 92 | 1241 | my ( $path, $dir, $main ); | |||||||||||||||||||||||||||
| 93 | 1241 | ▶ | if ( $ri->{type} eq 'skill' ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 94 | 568 | $path = $ci->{dir}; | |||||||||||||||||||||||||||
| 95 | 568 | $dir = path_join( $root, $path ); | |||||||||||||||||||||||||||
| 96 | 568 | ($main) = grep { $_ eq $path.'/SKILL.md' } @files; | |||||||||||||||||||||||||||
| 97 | 568 | ▶ | $main //= $path.'/SKILL.md.njk'; | ||||||||||||||||||||||||||
|
Condition50%1/2
$main //= $path . '/SKILL.md.njk'
MC/DC0%0/1
$main //= $path . '/SKILL.md.njk'
$main
Truth table50%1/2
A
A= $main
| |||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||
| 99 | else { | ||||||||||||||||||||||||||||
| 100 | 673 | $path = $main = $files[0]; | |||||||||||||||||||||||||||
| 101 | 673 | ( my $parent = $path ) =~ s{/[^/]*\z}{}; | |||||||||||||||||||||||||||
| 102 | 673 | ▶ | $dir = path_join( $root, $parent eq $path ? '' : $parent ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||
| 104 | 1241 | my @templates = grep { /\.njk\z/ } @files; | |||||||||||||||||||||||||||
| 105 | 1241 | my %source = map { ( $_->{name} => $_ ) } @{ $self->_scope_report($scope)->{sources} }; | |||||||||||||||||||||||||||
| 106 | return { | ||||||||||||||||||||||||||||
| 107 | type => $ri->{type}, | ||||||||||||||||||||||||||||
| 108 | name => $ri->{name}, | ||||||||||||||||||||||||||||
| 109 | scope => $scope, | ||||||||||||||||||||||||||||
| 110 | source => $ri->{source}, | ||||||||||||||||||||||||||||
| 111 | version => $source{ $ri->{source} } ? $source{ $ri->{source} }{version} : undef, | ||||||||||||||||||||||||||||
| 112 | source_dir => $root, | ||||||||||||||||||||||||||||
| 113 | path => $path, | ||||||||||||||||||||||||||||
| 114 | dir => $dir, | ||||||||||||||||||||||||||||
| 115 | file => path_join( $root, $main ), | ||||||||||||||||||||||||||||
| 116 | 1529 | ▶ | files => [ map { path_join( $root, $_ ) } @files ], | ||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||
| 117 | ( defined $ci->{description} ? ( description => $ci->{description} ) : () ), | ||||||||||||||||||||||||||||
| 118 | vars => $ri->{vars}, | ||||||||||||||||||||||||||||
| 119 | declaredBy => $ri->{declaredBy}, | ||||||||||||||||||||||||||||
| 120 | 1241 | ▶ | ( $ri->{via} ? ( via => $ri->{via} ) : () ), | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 121 | templated => @templates ? 1 : 0, | ||||||||||||||||||||||||||||
| 122 | templates => \@templates, | ||||||||||||||||||||||||||||
| 123 | }; | ||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||
| 126 | 2906 | ▶ | sub _scope_report { | ||||||||||||||||||||||||||
|
Subroutine
_scope_report: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 127 | 2906 | my ( $self, $scope ) = @_; | |||||||||||||||||||||||||||
| 128 | 2906 | my ($rep) = grep { $_->{scope} eq $scope } @{ $self->_resolution->{scopes} }; | |||||||||||||||||||||||||||
| 129 | 2865 | return $rep; | |||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||
| 132 | # Claude Code's order per type when both scopes hold an item of one name: a personal skill wins | ||||||||||||||||||||||||||||
| 133 | # over a project one, a project agent over a personal one; rules do not override each other – | ||||||||||||||||||||||||||||
| 134 | # both load, the user's first. | ||||||||||||||||||||||||||||
| 135 | 28 | my %ORDER = ( skill => [qw( user project )], agent => [qw( project user )], rule => [qw( user project )] ); | |||||||||||||||||||||||||||
| 136 | 28 | my %SHADOWS = ( skill => 1, agent => 1, rule => 0 ); | |||||||||||||||||||||||||||
| 137 | 28 | my @TYPES = qw( skill agent rule ); | |||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||
| 139 | 925 | ▶ | sub _check_type { | ||||||||||||||||||||||||||
|
Subroutine
_check_type: called CC=3 SCAR=11.1
| |||||||||||||||||||||||||||||
| 140 | 925 | my ( $type ) = @_; | |||||||||||||||||||||||||||
| 141 | 925 | ▶ | croak 'type must be skill, agent or rule' unless defined $type && $ORDER{$type}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $type and $ORDER{$type}
MC/DC50%1/2
defined $type and $ORDER{$type}
defined $type
$ORDER{$type}
Truth table66%2/3
A and B
A= defined $typeB= $ORDER{$type}
| |||||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||
| 144 | 2326 | ▶ | sub _scopes_for { | ||||||||||||||||||||||||||
|
Subroutine
_scopes_for: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||
| 145 | 2326 | my ( $scope, $type ) = @_; | |||||||||||||||||||||||||||
| 146 | 2326 | ▶ | $scope //= 'all'; | ||||||||||||||||||||||||||
|
Condition100%2/2
$scope //= "all"
MC/DC100%1/1
$scope //= "all"
$scope
Truth table100%2/2
A
A= $scope
| |||||||||||||||||||||||||||||
| 147 | 2326 | ▶ | croak 'scope must be user, project or all' unless $scope =~ /\A(?:user|project|all)\z/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 148 | 2326 | ▶ | return $scope eq 'all' ? @{ $ORDER{$type} } : ($scope); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||
| 151 | # Every record of a type, in the type's order: one per name where one scope's item wins. | ||||||||||||||||||||||||||||
| 152 | 1521 | ▶ | sub _items_of { | ||||||||||||||||||||||||||
|
Subroutine
_items_of: called CC=9 SCAR=22.0
| |||||||||||||||||||||||||||||
| 153 | 1521 | my ( $self, $type, $scope, $key ) = @_; | |||||||||||||||||||||||||||
| 154 | 1521 | my ( %seen, @out ); | |||||||||||||||||||||||||||
| 155 | 1521 | for my $s ( _scopes_for( $scope, $type ) ) { | |||||||||||||||||||||||||||
| 156 | 1665 | ▶ | my $rep = $self->_scope_report($s) or next; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 157 | 1532 | for my $ri ( @{ $rep->{items} } ) { | |||||||||||||||||||||||||||
| 158 | 6477 | ▶ | next unless $ri->{type} eq $type; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 159 | 2273 | my $k = name_key( $ri->{name} ); | |||||||||||||||||||||||||||
| 160 | 2273 | ▶ | next if defined $key && $k ne $key; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $key and $k ne $key
MC/DC100%2/2
defined $key and $k ne $key
defined $key
$k ne $key
Truth table100%3/3
A and B
A= defined $keyB= $k ne $key
| |||||||||||||||||||||||||||||
| 161 | 1337 | ▶ | next if $SHADOWS{$type} && $seen{$k}++; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$SHADOWS{$type} and $seen{$k}++
MC/DC100%2/2
$SHADOWS{$type} and $seen{$k}++
$SHADOWS{$type}
$seen{$k}++
Truth table100%3/3
A and B
A= $SHADOWS{$type}B= $seen{$k}++
| |||||||||||||||||||||||||||||
| 162 | 1241 | push @out, $self->_record( $s, $ri ); | |||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||
| 165 | 1480 | return @out; | |||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||
| 168 | 120 | ▶ | sub items { | ||||||||||||||||||||||||||
|
Subroutine
items: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 169 | 120 | my ( $self, %opts ) = @_; | |||||||||||||||||||||||||||
| 170 | 120 | ▶ | _check_type( $opts{type} ) if defined $opts{type}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 171 | 120 | ▶ | return [ map { $self->_items_of( $_, $opts{scope} ) } defined $opts{type} ? ( $opts{type} ) : @TYPES ]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||
| 174 | 853 | ▶ | sub resolve_items { | ||||||||||||||||||||||||||
|
Subroutine
resolve_items: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||
| 175 | 853 | my ( $self, $type, $name, %opts ) = @_; | |||||||||||||||||||||||||||
| 176 | 853 | _check_type($type); | |||||||||||||||||||||||||||
| 177 | 829 | ▶ | return [] unless defined $name && length $name; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $name and length $name
MC/DC50%1/2
defined $name and length $name
defined $name
length $name
Truth table66%2/3
A and B
A= defined $nameB= length $name
| |||||||||||||||||||||||||||||
| 178 | 805 | my $key = name_key($name); | |||||||||||||||||||||||||||
| 179 | 805 | my @all; | |||||||||||||||||||||||||||
| 180 | 805 | for my $s ( _scopes_for( $opts{scope}, $type ) ) { | |||||||||||||||||||||||||||
| 181 | 1305 | push @all, grep { $_->{scope} eq $s } $self->_items_of( $type, $s, $key ); | |||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||
| 183 | 764 | return \@all; | |||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||
| 186 | 757 | ▶ | sub resolve_item { | ||||||||||||||||||||||||||
|
Subroutine
resolve_item: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||
| 187 | 757 | my ( $self, $type, $name, %opts ) = @_; | |||||||||||||||||||||||||||
| 188 | 757 | my @found = @{ $self->resolve_items( $type, $name, %opts ) }; | |||||||||||||||||||||||||||
| 189 | 692 | ▶ | return undef unless @found; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 190 | 545 | ▶ | if ( @found > 1 && !$SHADOWS{$type} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
@found > 1 and not $SHADOWS{$type}
MC/DC100%2/2
@found > 1 and not $SHADOWS{$type}
@found > 1
not $SHADOWS{$type}
Truth table100%3/3
A and not(B)
A= @found > 1B= not $SHADOWS{$type}
| |||||||||||||||||||||||||||||
| 191 | 48 | Skilletor::Error::Ambiguous->throw( $type.' '.$found[0]{name}.' is declared in the user and the project scope; ' | |||||||||||||||||||||||||||
| 192 | .'Claude Code loads both (neither overrides the other) – ask resolve_'.$type.'s, or pass a scope' ); | ||||||||||||||||||||||||||||
| 193 | } | ||||||||||||||||||||||||||||
| 194 | 497 | return $found[0]; | |||||||||||||||||||||||||||
| 195 | } | ||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||
| 197 | 385 | ▶ | sub _refuse_template { | ||||||||||||||||||||||||||
|
Subroutine
_refuse_template: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||
| 198 | 385 | my ( $rec ) = @_; | |||||||||||||||||||||||||||
| 199 | 385 | ▶ | return unless $rec->{templated}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 200 | Skilletor::Error::Unsupported->throw( $rec->{type}.' '.$rec->{name}.'@'.$rec->{source}.' is a Nunjucks template (' | ||||||||||||||||||||||||||||
| 201 | 48 | .join( ', ', @{ $rec->{templates} } ).'); the Perl port of skilletor renders no templates' ); | |||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||
| 204 | 508 | ▶ | sub _main_file { | ||||||||||||||||||||||||||
|
Subroutine
_main_file: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||
| 205 | 508 | my ( $self, $type, $name, %opts ) = @_; | |||||||||||||||||||||||||||
| 206 | 508 | ▶ | my $rec = $self->resolve_item( $type, $name, %opts ) or return undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 207 | 313 | _refuse_template($rec); | |||||||||||||||||||||||||||
| 208 | 265 | return $rec->{file}; | |||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||
| 211 | 360 | ▶ | sub resolve_skill { my $self = shift; return $self->_main_file( skill => @_ ) } | ||||||||||||||||||||||||||
|
Subroutine
resolve_skill: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 212 | 76 | ▶ | sub resolve_agent { my $self = shift; return $self->_main_file( agent => @_ ) } | ||||||||||||||||||||||||||
|
Subroutine
resolve_agent: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 213 | 72 | ▶ | sub resolve_rule { my $self = shift; return $self->_main_file( rule => @_ ) } | ||||||||||||||||||||||||||
|
Subroutine
resolve_rule: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||
| 215 | 72 | ▶ | sub resolve_rules { | ||||||||||||||||||||||||||
|
Subroutine
resolve_rules: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 216 | 72 | my ( $self, $name, %opts ) = @_; | |||||||||||||||||||||||||||
| 217 | 72 | my @recs = @{ $self->resolve_items( rule => $name, %opts ) }; | |||||||||||||||||||||||||||
| 218 | 72 | _refuse_template($_) for @recs; | |||||||||||||||||||||||||||
| 219 | 72 | return map { $_->{file} } @recs; | |||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||
| 222 | 28 | 1; | |||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||
| 224 | __END__ | ||||||||||||||||||||||||||||