Changeset 25208 for lang/perl/Shika
- Timestamp:
- 11/28/08 14:41:45 (4 years ago)
- Location:
- lang/perl/Shika/trunk
- Files:
-
- 1 added
- 1 modified
-
lib/Shika/Util.pm (modified) (2 diffs)
-
t/020_role/07_apply_blessed.t (added)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Shika/trunk/lib/Shika/Util.pm
r25194 r25208 17 17 sub copy_functions { 18 18 my ($src, $dst, $alias) = @_; 19 $src = ref $src if ref $src; 20 $dst = ref $dst if ref $dst; 19 21 22 print "[debug] copy functions $src to $dst\n" if $ENV{DEBUG}; 20 23 no strict 'refs'; 21 24 for my $method (@{ Shika::Util::get_functions($src) }) { 22 25 next if $method eq 'has' || $method eq 'requires' || $method eq 'meta' || $method eq 'with'; 23 26 my $dstmethod = $alias->{$method} ? $alias->{$method} : $method; 24 next if $dst->can($dstmethod); 27 print "[debug] copying method $method\n" if $ENV{DEBUG}; 28 if ($dst->can($dstmethod)) { 29 print "[debug] $dst already have $dstmethod. skip\n" if $ENV{DEBUG}; 30 next; 31 } 25 32 *{"${dst}::${dstmethod}"} = *{"${src}::${method}"}; 26 33 } … … 30 37 my $klass = shift; 31 38 eval "require $klass"; ## no critic ### too bad 39 print "[debug] cannot load class $@" if $ENV{DEBUG} && $@; 32 40 } 33 41
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)