Created
November 22, 2018 02:15
-
-
Save FCO/87d7645286d7f836e1f8e1e76514a599 to your computer and use it in GitHub Desktop.
Schema CompUnit::Repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
no precompilation; | |
use Schema; | |
use lib "CompUnit::Repository::Red::Schema#"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use lib "."; | |
use Schema; | |
say Bla |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit class CompUnit::Repository::Red::Schema does CompUnit::Repository; | |
has $!name; | |
has $.prefix; | |
submethod TWEAK(:$!name = 'redschema') { | |
CompUnit::RepositoryRegistry.register-name($!name, self); | |
} | |
method id { "redschema" } | |
method loaded {[]} | |
method path-spec(--> Str:D) { "redschema#{$!prefix}" } | |
method short-id(--> Str:D) { 'redschema' } | |
method need( | |
CompUnit::DependencySpecification $spec, | |
CompUnit::PrecompilationRepository $precomp = self.precomp-repository(), | |
--> CompUnit:D) { | |
return self.next-repo.need($spec) unless $spec.short-name eq "Schema"; | |
my $h = CompUnit::Loader.load-source( q"class Bla {}; say 'FOI'".encode ); | |
CompUnit.new( | |
handle => $h, | |
short-name => $spec.short-name, | |
version => Version.new("0.0.1"), | |
auth => "FCO", | |
repo => self, | |
repo-id => self.id, | |
precompiled => False, | |
distribution => Distribution, | |
); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment