~ubuntu-branches/ubuntu/trusty/libhtml-selector-xpath-perl/trusty-proposed

« back to all changes in this revision

Viewing changes to inc/Module/Install/Base.pm

  • Committer: Package Import Robot
  • Author(s): Florian Schlichting, Salvatore Bonaccorso, Florian Schlichting
  • Date: 2013-08-22 12:06:46 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20130822120646-hov1bpb2l2klhrhe
Tags: 0.16-1
[ Salvatore Bonaccorso ]
* Change Vcs-Git to canonical URI (git://anonscm.debian.org)
* Change search.cpan.org based URIs to metacpan.org based URIs

[ Florian Schlichting ]
* Import Upstream version 0.16
* Bump years of included Module::Install copyright
* Bump Standards-Version to 3.9.4 (update to copyright-format 1.0)
* Add myself to uploaders and copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#line 1
2
2
package Module::Install::Base;
3
3
 
4
 
$VERSION = '0.81';
 
4
use strict 'vars';
 
5
use vars qw{$VERSION};
 
6
BEGIN {
 
7
        $VERSION = '1.06';
 
8
}
5
9
 
6
10
# Suspend handler for "redefined" warnings
7
11
BEGIN {
9
13
        $SIG{__WARN__} = sub { $w };
10
14
}
11
15
 
12
 
### This is the ONLY module that shouldn't have strict on
13
 
# use strict;
14
 
 
15
 
#line 41
 
16
#line 42
16
17
 
17
18
sub new {
18
 
    my ($class, %args) = @_;
19
 
 
20
 
    foreach my $method ( qw(call load) ) {
21
 
        *{"$class\::$method"} = sub {
22
 
            shift()->_top->$method(@_);
23
 
        } unless defined &{"$class\::$method"};
24
 
    }
25
 
 
26
 
    bless( \%args, $class );
 
19
        my $class = shift;
 
20
        unless ( defined &{"${class}::call"} ) {
 
21
                *{"${class}::call"} = sub { shift->_top->call(@_) };
 
22
        }
 
23
        unless ( defined &{"${class}::load"} ) {
 
24
                *{"${class}::load"} = sub { shift->_top->load(@_) };
 
25
        }
 
26
        bless { @_ }, $class;
27
27
}
28
28
 
29
29
#line 61
30
30
 
31
31
sub AUTOLOAD {
32
 
    my $self = shift;
33
 
    local $@;
34
 
    my $autoload = eval { $self->_top->autoload } or return;
35
 
    goto &$autoload;
36
 
}
37
 
 
38
 
#line 76
39
 
 
40
 
sub _top { $_[0]->{_top} }
41
 
 
42
 
#line 89
 
32
        local $@;
 
33
        my $func = eval { shift->_top->autoload } or return;
 
34
        goto &$func;
 
35
}
 
36
 
 
37
#line 75
 
38
 
 
39
sub _top {
 
40
        $_[0]->{_top};
 
41
}
 
42
 
 
43
#line 90
43
44
 
44
45
sub admin {
45
 
    $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new;
 
46
        $_[0]->_top->{admin}
 
47
        or
 
48
        Module::Install::Base::FakeAdmin->new;
46
49
}
47
50
 
48
 
#line 101
 
51
#line 106
49
52
 
50
53
sub is_admin {
51
 
    $_[0]->admin->VERSION;
 
54
        ! $_[0]->admin->isa('Module::Install::Base::FakeAdmin');
52
55
}
53
56
 
54
57
sub DESTROY {}
55
58
 
56
59
package Module::Install::Base::FakeAdmin;
57
60
 
58
 
my $Fake;
59
 
sub new { $Fake ||= bless(\@_, $_[0]) }
 
61
use vars qw{$VERSION};
 
62
BEGIN {
 
63
        $VERSION = $Module::Install::Base::VERSION;
 
64
}
 
65
 
 
66
my $fake;
 
67
 
 
68
sub new {
 
69
        $fake ||= bless(\@_, $_[0]);
 
70
}
60
71
 
61
72
sub AUTOLOAD {}
62
73
 
69
80
 
70
81
1;
71
82
 
72
 
#line 146
 
83
#line 159