line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Hyper::Developer::Generator; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1733
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
40
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
5
|
1
|
|
|
1
|
|
6
|
use version; our $VERSION = qv('0.01'); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
742
|
use Class::Std; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use Template; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Hyper::Error; |
11
|
|
|
|
|
|
|
use Hyper::Singleton::Context; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my %base_path_of :ATTR(:init_arg :get); |
14
|
|
|
|
|
|
|
my %template_of :ATTR(:get); |
15
|
|
|
|
|
|
|
my %namespace_of :ATTR(:name); |
16
|
|
|
|
|
|
|
my %verbose_of :ATTR(:name :default<()>); |
17
|
|
|
|
|
|
|
my %force_of :ATTR(:name :default<()>); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub START { |
20
|
|
|
|
|
|
|
my ($self, $ident) = @_; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
$base_path_of{$ident} ||= Hyper::Singleton::Context->singleton |
23
|
|
|
|
|
|
|
->get_context->get_config()->get_base_path(); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# create Template object |
26
|
|
|
|
|
|
|
$template_of{$ident} = Template->new({ |
27
|
|
|
|
|
|
|
INCLUDE_PATH => [ |
28
|
|
|
|
|
|
|
map { |
29
|
|
|
|
|
|
|
"$_/var"; |
30
|
|
|
|
|
|
|
} $base_path_of{$ident}, |
31
|
|
|
|
|
|
|
Hyper::Functions::get_path_from_file(__FILE__), |
32
|
|
|
|
|
|
|
], |
33
|
|
|
|
|
|
|
INTERPOLATE => 0, |
34
|
|
|
|
|
|
|
POST_CHOMP => 0, |
35
|
|
|
|
|
|
|
EVAL_PERL => 1, |
36
|
|
|
|
|
|
|
COMPILE_DIR => '/tmp/tt', # <= tt drops a f*** warning if this is not set |
37
|
|
|
|
|
|
|
}); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
return $self; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub create { |
43
|
|
|
|
|
|
|
throw('you have to implement this method :)'); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub verbose_message { |
47
|
|
|
|
|
|
|
my $self = shift; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
$verbose_of{ident $self} and print @_, "\n"; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
return $self; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |