Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Part 3 of Application -> Systemic move
  • Loading branch information
lizmat committed May 15, 2014
1 parent 69e11c9 commit a0ba7f9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/Distro.pm
Expand Up @@ -3,7 +3,7 @@
# If you find errors for your hardware or OS distribution, please report them
# with the values that you expected and how to get them in your situation.

class Distro does Application{
class Distro does Systemic{
has Bool $.is-win;
has Str $.release;

Expand Down
2 changes: 1 addition & 1 deletion src/core/Kernel.pm
Expand Up @@ -3,7 +3,7 @@
# If you find errors for your hardware or OS distribution, please report them
# with the values that you expected and how to get them in your situation.

class Kernel does Application {
class Kernel does Systemic {
has $!hardware;
has $!arch;
has $!bits;
Expand Down
23 changes: 22 additions & 1 deletion src/core/Systemic.pm
@@ -1,7 +1,28 @@
role Application {
role Systemic {
has Str $.name;
has Str $.auth;
has Version $.version;
has Blob $.signature;
has Str $.desc;

submethod BUILD (
:$!name = "unknown",
:$!auth = "unknown",
:$!version = Version.new("unknown"),
) {}
method gist { $!name ~ (" ($!version)" if $!version ne "vunknown") }
method Str { $!name }
}

# Since we cannot see attributes of roles done by other roles, the below is
# a copy of the above (minus .desc), instead of doing the Universal role in
# Systemic (as is the spec). Once we can see attributes of roles of roles
# inside a class, we can fix this abomination.
role Universal {
has Str $.name;
has Str $.auth;
has Version $.version;
has Blob $.signature;

submethod BUILD (
:$!name = "unknown",
Expand Down
2 changes: 1 addition & 1 deletion src/core/VM.pm
@@ -1,4 +1,4 @@
class VM does Application {
class VM does Systemic {
has $.config;

submethod BUILD (:$!name, :$!config) {
Expand Down

0 comments on commit a0ba7f9

Please sign in to comment.