line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catalyst::Helper::Model::Riak; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
1
|
|
|
1
|
|
6399
|
$Catalyst::Helper::Model::Riak::AUTHORITY = 'cpan::NLTBO'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
BEGIN { |
6
|
1
|
|
|
1
|
|
30
|
$Catalyst::Helper::Model::Riak::VERSION = '0.02'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
12
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
117
|
|
10
|
1
|
|
|
1
|
|
9
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
219
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub mk_compclass { |
13
|
0
|
|
|
0
|
1
|
|
my( $self, $helper, $host, $timeout ) = @_; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
my %args = ( |
16
|
|
|
|
|
|
|
host => $host, |
17
|
|
|
|
|
|
|
ua_timeout => $timeout, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
$helper->render_file('modelclass', $helper->{file}, \%args); |
22
|
0
|
|
|
|
|
|
return 1; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub mk_comptest { |
26
|
0
|
|
|
0
|
1
|
|
my ($self, $helper) = @_; |
27
|
0
|
|
|
|
|
|
$helper->render_file('modeltest', $helper->{test}); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=pod |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 NAME |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Catalyst::Helper::Model::Riak - Helper for Riak models |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 VERSION |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
version 0.10 |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SYNOPSIS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
script/myapp_create.pl model MyModel Riak [host] [ua_timeout] |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 DESCRIPTION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Helper for the L<Catalyst> Riak model. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 USAGE |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 METHODS |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 mk_compclass |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Makes the model class. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 mk_comptest |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Makes tests. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 SUPPORT |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Repository |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
https://github.com/Mainframe2008/CatRiak |
67
|
|
|
|
|
|
|
Pull request and additional contributors are welcome |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Issue Tracker |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
https://github.com/Mainframe2008/CatRiak/issues |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 AUTHOR |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Theo Bot <nltbo@cpan.org> L<http://www.proxy.nl/> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
This software is copyright (c) 2013 by Theo Bot |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
82
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=cut |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
__DATA__ |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=begin pod_to_ignore |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
__modelclass__ |
92
|
|
|
|
|
|
|
package [% class %]; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
use Moose; |
95
|
|
|
|
|
|
|
BEGIN { extends 'Catalyst::Model::Riak' }; |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
__PACKAGE__->config( |
98
|
|
|
|
|
|
|
host => '[% host || 'http://localhost:8098' %]', |
99
|
|
|
|
|
|
|
timeout => [% ua_timeout || '900' %], |
100
|
|
|
|
|
|
|
); |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 NAME |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
[% class %] - Riak Catalyst model component |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 SYNOPSIS |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
See L<[% app %]>. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 DESCRIPTION |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Riak Catalyst model component. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 AUTHOR |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
[% author %] |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 LICENSE |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
121
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=cut |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
no Moose; |
126
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
1; |
129
|
|
|
|
|
|
|
__modeltest__ |
130
|
|
|
|
|
|
|
use strict; |
131
|
|
|
|
|
|
|
use warnings; |
132
|
|
|
|
|
|
|
use Test::More tests => 2; |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
use_ok('Catalyst::Test', '[% app %]'); |
135
|
|
|
|
|
|
|
use_ok('[% class %]'); |