line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright Infomation |
2
|
|
|
|
|
|
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
3
|
|
|
|
|
|
|
# Author : Dr. Ahmed Amin Elsheshtawy, Ph.D. |
4
|
|
|
|
|
|
|
# Website: https://github.com/mewsoft/Nile, http://www.mewsoft.com |
5
|
|
|
|
|
|
|
# Email : mewsoft@cpan.org, support@mewsoft.com |
6
|
|
|
|
|
|
|
# Copyrights (c) 2014-2015 Mewsoft Corp. All rights reserved. |
7
|
|
|
|
|
|
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
8
|
|
|
|
|
|
|
package Nile::Base; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.55'; |
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:MEWSOFT'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=pod |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=encoding utf8 |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Nile::Base - Base class for the Nile framework. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
package Nile::MyModule; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
use Nile::Base; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 DESCRIPTION |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Nile::Base - Base class for the Nile framework. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=cut |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
36
|
1
|
|
|
1
|
|
25
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
37
|
1
|
|
|
1
|
|
5662
|
use MooseX::Declare; |
|
1
|
|
|
|
|
1429378
|
|
|
1
|
|
|
|
|
7
|
|
38
|
1
|
|
|
1
|
|
1684
|
use MooseX::MethodAttributes; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
9
|
|
39
|
1
|
|
|
1
|
|
6052
|
use Import::Into; |
|
1
|
|
|
|
|
403
|
|
|
1
|
|
|
|
|
24
|
|
40
|
1
|
|
|
1
|
|
10
|
use Module::Runtime qw(use_module); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
41
|
|
|
|
|
|
|
#use true; # both load and import it |
42
|
|
|
|
|
|
|
#use Nile::Declare; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
1
|
|
492
|
use Nile::Say; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
45
|
|
|
|
|
|
|
#use Nile::Declare ('method' => 'method', 'function' => 'function', 'invocant'=>'$this', 'inject'=>'my ($me) = $this->me;'); |
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
1
|
|
4
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
48
|
1
|
|
|
1
|
|
12
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
177
|
|
49
|
|
|
|
|
|
|
# disable the auto immutable feature of Moosex::Declare, or use class Nile::Home is mutable {...} |
50
|
|
|
|
|
|
|
*{"MooseX::Declare::Syntax::Keyword::Class" . '::' . "auto_make_immutable"} = sub { 0 }; |
51
|
|
|
|
|
|
|
#around auto_make_immutable => sub { 0 }; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
our @EXPORT_MODULES = ( |
54
|
|
|
|
|
|
|
#strict => [], |
55
|
|
|
|
|
|
|
#warnings => [], |
56
|
|
|
|
|
|
|
Moose => [], |
57
|
|
|
|
|
|
|
utf8 => [], |
58
|
|
|
|
|
|
|
#true => [], |
59
|
|
|
|
|
|
|
'Nile::Say' => [], |
60
|
|
|
|
|
|
|
#'Nile::Declare' => ['method' => 'method', 'function' => 'function', 'invocant'=>'$self', 'inject'=>'my ($me) = $self->me;'], |
61
|
|
|
|
|
|
|
'MooseX::Declare' => [], |
62
|
|
|
|
|
|
|
#'Nile::Declare' => [], |
63
|
|
|
|
|
|
|
'MooseX::MethodAttributes' => [], |
64
|
|
|
|
|
|
|
#'MooseX::ClassAttribute' => [], |
65
|
|
|
|
|
|
|
#'Module::Load' => [()], # will emit error for methods load redefined |
66
|
|
|
|
|
|
|
); |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub import { |
69
|
16
|
|
|
16
|
|
49
|
my ($class, %args) = @_; |
70
|
16
|
|
|
|
|
36
|
my $caller = caller; |
71
|
16
|
|
|
|
|
74
|
my @modules = @EXPORT_MODULES; |
72
|
16
|
|
|
|
|
51
|
while (@modules) { |
73
|
80
|
|
|
|
|
112083
|
my $module = shift @modules; |
74
|
80
|
50
|
|
|
|
219
|
my $imports = ref $modules[0] eq 'ARRAY' ? shift @modules : []; |
75
|
80
|
|
|
|
|
253
|
use_module($module)->import::into($caller, @{$imports}); |
|
80
|
|
|
|
|
2258
|
|
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=pod |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 Bugs |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
This project is available on github at L<https://github.com/mewsoft/Nile>. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 HOMEPAGE |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Please visit the project's homepage at L<https://metacpan.org/release/Nile>. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 SOURCE |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Source repository is at L<https://github.com/mewsoft/Nile>. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 SEE ALSO |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
See L<Nile> for details about the complete framework. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 AUTHOR |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Ahmed Amin Elsheshtawy, اØÙ
د اÙ
Ù٠اÙششتاÙÙ <mewsoft@cpan.org> |
100
|
|
|
|
|
|
|
Website: http://www.mewsoft.com |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Copyright (C) 2014-2015 by Dr. Ahmed Amin Elsheshtawy اØÙ
د اÙ
Ù٠اÙششتاÙÙ mewsoft@cpan.org, support@mewsoft.com, |
105
|
|
|
|
|
|
|
L<https://github.com/mewsoft/Nile>, L<http://www.mewsoft.com> |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=cut |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
1; |