From: Matt S Trout Date: Tue, 1 Oct 2019 01:53:12 +0000 (+0000) Subject: meh, with being used elsewhere X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=00c02304759c01ece88c335d77937df98c1159d4;p=scpubgit%2FQ-Branch.git meh, with being used elsewhere --- diff --git a/lib/with.pm b/lib/with.pm deleted file mode 100644 index 96c2a66..0000000 --- a/lib/with.pm +++ /dev/null @@ -1,39 +0,0 @@ -package with; - -# This must be its own dist later - -use strict; -use warnings; -use if $] < '5.010', 'MRO::Compat'; -use mro; - -my $comp = 'A001'; - -sub components { - my ($inv, @comp) = @_; - my $class = ref($inv) || $inv; - my $new_class = join('::', $class, $comp++); - require Class::C3::Componentised; - my @comp_classes = map +(/^\+(.+)$/ ? "${class}::$1" : $_), @comp; - Class::C3::Componentised->ensure_class_loaded($_) for @comp_classes; - Class::C3::Componentised->inject_base( - $new_class, - @comp_classes, $class - ); - mro::set_mro($new_class, 'c3'); - return $new_class unless ref($inv); - return bless($inv, $new_class); -} - -sub roles { - my ($inv, @roles) = @_; - my $class = ref($inv) || $inv; - require Role::Tiny; - my $new_class = Role::Tiny->create_class_with_roles($class, - map +(/^\+(.+)$/ ? "${class}::$1" : $_), @roles - ); - return $new_class unless ref($inv); - return bless($inv, $new_class); -} - -1;