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.54'; |
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
|
|
7
|
use utf8; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
36
|
1
|
|
|
1
|
|
39
|
use Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
37
|
1
|
|
|
1
|
|
8152
|
use MooseX::Declare; |
|
1
|
|
|
|
|
1381014
|
|
|
1
|
|
|
|
|
7
|
|
38
|
1
|
|
|
1
|
|
2001
|
use MooseX::MethodAttributes; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
9
|
|
39
|
1
|
|
|
1
|
|
6432
|
use Import::Into; |
|
1
|
|
|
|
|
438
|
|
|
1
|
|
|
|
|
27
|
|
40
|
1
|
|
|
1
|
|
5
|
use Module::Runtime qw(use_module); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
3
|
|
41
|
|
|
|
|
|
|
#use true; # both load and import it |
42
|
|
|
|
|
|
|
#use Nile::Declare; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
1
|
|
415
|
use Nile::Say; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
45
|
|
|
|
|
|
|
#use Nile::Declare ('method' => 'method', 'function' => 'function', 'invocant'=>'$this', 'inject'=>'my ($me) = $this->me;'); |
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
1
|
|
5
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
38
|
|
48
|
1
|
|
|
1
|
|
9
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
207
|
|
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
|
|
52
|
my ($class, %args) = @_; |
70
|
16
|
|
|
|
|
43
|
my $caller = caller; |
71
|
16
|
|
|
|
|
71
|
my @modules = @EXPORT_MODULES; |
72
|
16
|
|
|
|
|
47
|
while (@modules) { |
73
|
80
|
|
|
|
|
120606
|
my $module = shift @modules; |
74
|
80
|
50
|
|
|
|
231
|
my $imports = ref $modules[0] eq 'ARRAY' ? shift @modules : []; |
75
|
80
|
|
|
|
|
256
|
use_module($module)->import::into($caller, @{$imports}); |
|
80
|
|
|
|
|
2271
|
|
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; |