Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix some signatures and simplify methods
  • Loading branch information
lizmat committed Oct 26, 2014
1 parent 2797925 commit 6ef0c72
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/core/CompUnitRepo/Locally.pm
Expand Up @@ -5,7 +5,7 @@ role CompUnitRepo::Locally {

my %instances;

method new($dir) {
method new(CompUnitRepo::Locally: $dir) {
my $path := IO::Path.new-from-absolute-path($*SPEC.rel2abs($dir));
return Nil unless $path.d and $path.r;
%instances{$path.abspath} //= self.bless(:$path, :lock(Lock.new));
Expand All @@ -14,19 +14,17 @@ role CompUnitRepo::Locally {
multi method WHICH (CompUnitRepo::Locally:D:) {
$!WHICH //= self.^name ~ '|' ~ $!path.abspath;
}
method Str { self.DEFINITE ?? $!path.abspath !! Nil }
method gist { self.DEFINITE
?? "{self.short-id}:{$!path.abspath}"
!! self.^name;
method Str(CompUnitRepo::Locally:D:) { $!path.abspath }
method gist(CompUnitRepo::Locally:D:) {
"{self.short-id}:{$!path.abspath}"
}
method perl { self.DEFINITE
?? "CompUnitRepo.new('{self.short-id}:{$!path.abspath}')"
!! self.^name;
method perl(CompUnitRepo::Locally:D:) {
"CompUnitRepo.new('{self.short-id}:{$!path.abspath}')"
}

# stubs
method install ($source, $from? ) { ... }
method files ($file, :$name, :$auth, :$ver) { ... }
method candidates ($name, :$file, :$auth, :$ver) { ... }
method short-id ( ) { ... }
method install(CompUnitRepo::Locally:D: $source, $from? ) {...}
method files(CompUnitRepo::Locally:D: $file, :$name, :$auth, :$ver) {...}
method candidates(CompUnitRepo::Locally:D: $name,:$file,:$auth,:$ver) {...}
method short-id(CompUnitRepo::Locally:D:) {...}
}

0 comments on commit 6ef0c72

Please sign in to comment.