Add the following packages libalgorithm-diff-perl libspiffy-perl libtext-diff-perl...
[pkg-perl] / deb-src / libspiffy-perl / libspiffy-perl-0.30 / inc / Module / Install / Base.pm
1 #line 1 "inc/Module/Install/Base.pm - /Users/ingy/local/lib/perl5/site_perl/5.8.6/Module/Install/Base.pm"
2 package Module::Install::Base;
3
4 # Suspend handler for "redefined" warnings
5 BEGIN { my $w = $SIG{__WARN__}; $SIG{__WARN__} = sub { $w } };
6
7 #line 30
8
9 sub new {
10     my ($class, %args) = @_;
11
12     foreach my $method (qw(call load)) {
13         *{"$class\::$method"} = sub {
14             +shift->_top->$method(@_);
15         } unless defined &{"$class\::$method"};
16     }
17
18     bless(\%args, $class);
19 }
20
21 #line 48
22
23 sub AUTOLOAD {
24     my $self = shift;
25
26     local $@;
27     my $autoload = eval { $self->_top->autoload } or return;
28     goto &$autoload;
29 }
30
31 #line 62
32
33 sub _top { $_[0]->{_top} }
34
35 #line 73
36
37 sub admin {
38     my $self = shift;
39     $self->_top->{admin} or Module::Install::Base::FakeAdmin->new;
40 }
41
42 sub is_admin {
43     my $self = shift;
44     $self->admin->VERSION;
45 }
46
47 sub DESTROY {}
48
49 package Module::Install::Base::FakeAdmin;
50
51 my $Fake;
52 sub new { $Fake ||= bless(\@_, $_[0]) }
53 sub AUTOLOAD {}
54 sub DESTROY {}
55
56 1;
57
58 # Restore warning handler
59 BEGIN { $SIG{__WARN__} = $SIG{__WARN__}->() };
60
61 __END__
62
63 #line 120