line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Rubyish::Module; |
4
|
1
|
|
|
1
|
|
5
|
use base 'Rubyish::Object'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
490
|
|
5
|
|
|
|
|
|
|
use Class::Inspector; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# A Rubyish Module exports all of its subs to caller. |
8
|
|
|
|
|
|
|
sub import { |
9
|
|
|
|
|
|
|
my ($class) = @_; |
10
|
|
|
|
|
|
|
my $caller = caller; |
11
|
|
|
|
|
|
|
my $subs = Class::Inspector->methods($class, "expanded"); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
for (@$subs) { |
14
|
|
|
|
|
|
|
my ($full, $class_name, $sub_name, $code) = @$_; |
15
|
|
|
|
|
|
|
# warn "$class_name $sub_name $code\n"; |
16
|
|
|
|
|
|
|
next unless $class_name eq $class; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Sub::Install::install_sub({ |
19
|
|
|
|
|
|
|
code => $code, |
20
|
|
|
|
|
|
|
into => $caller, |
21
|
|
|
|
|
|
|
as => $sub_name |
22
|
|
|
|
|
|
|
}); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
return 1; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 NAME |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Rubyish::Module - The Module implementation |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 DESCRIPTION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
This module isn't quite useful at this moment. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 AUTHOR |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Kang-min Liu C<< >>, shelling C |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 LICENCE AND COPYRIGHT |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Copyright (c) 2008,2009, Kang-min Liu C<< >>. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
This is free software, licensed under: |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
The MIT (X11) License |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 DISCLAIMER OF WARRANTY |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY |
52
|
|
|
|
|
|
|
FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN |
53
|
|
|
|
|
|
|
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES |
54
|
|
|
|
|
|
|
PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER |
55
|
|
|
|
|
|
|
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
56
|
|
|
|
|
|
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE |
57
|
|
|
|
|
|
|
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH |
58
|
|
|
|
|
|
|
YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL |
59
|
|
|
|
|
|
|
NECESSARY SERVICING, REPAIR, OR CORRECTION. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
62
|
|
|
|
|
|
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR |
63
|
|
|
|
|
|
|
REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE |
64
|
|
|
|
|
|
|
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, |
65
|
|
|
|
|
|
|
OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE |
66
|
|
|
|
|
|
|
THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING |
67
|
|
|
|
|
|
|
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A |
68
|
|
|
|
|
|
|
FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF |
69
|
|
|
|
|
|
|
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
70
|
|
|
|
|
|
|
SUCH DAMAGES. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|