line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#--------------------------------------------------------------------# |
2
|
|
|
|
|
|
|
# @class : Chef::Rest::Client::recipe # |
3
|
|
|
|
|
|
|
# @author : Bhavin Patel # |
4
|
|
|
|
|
|
|
#--------------------------------------------------------------------# |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Chef::REST::Client::recipe; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
$Chef::REST::Client::recipe::VERSION = 1.0; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new |
11
|
|
|
|
|
|
|
{ |
12
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
13
|
0
|
|
|
|
|
|
my $recipe = shift; |
14
|
0
|
|
|
|
|
|
my $self = {}; |
15
|
0
|
|
|
|
|
|
bless $self, $class; |
16
|
0
|
|
|
|
|
|
$self->parse( $recipe ); |
17
|
0
|
|
|
|
|
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub parse |
21
|
|
|
|
|
|
|
{ |
22
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
23
|
0
|
|
|
|
|
|
my $recipe = shift; |
24
|
0
|
|
|
|
|
|
$recipe =~ s/^recipe\[(.*)\]/$1/; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
$recipe =~ /((?[\w-_]+)::)?(?[\w-_]+)(@(?.*))?/; |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
1
|
|
12763
|
$self->cookbook( $+{cookbook }); |
|
1
|
|
|
|
|
612
|
|
|
1
|
|
|
|
|
282
|
|
|
0
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
$self->recipe( $+{recipe }); |
30
|
0
|
|
|
|
|
|
$self->version( $+{version }); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
0
|
0
|
|
0
|
1
|
|
sub cookbook { $_[0]->{'cookbook'} = $_[1] if defined $_[1]; return $_[0]->{'cookbook'}; } |
|
0
|
|
|
|
|
|
|
35
|
0
|
0
|
|
0
|
1
|
|
sub recipe { $_[0]->{'recipe' } = $_[1] if defined $_[1]; return $_[0]->{'recipe' }; } |
|
0
|
|
|
|
|
|
|
36
|
0
|
0
|
|
0
|
1
|
|
sub version { $_[0]->{'version' } = $_[1] if defined $_[1]; return $_[0]->{'version' }; } |
|
0
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=pod |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 NAME |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Chef::REST::Client::recipe |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 VERSION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1.0 |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 SYNOPSIS |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
use Chef::REST::Client::recipe; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
my $obj = new Chef::REST::Client::recipe( $recipe); |
55
|
|
|
|
|
|
|
$obj->cookbook; |
56
|
|
|
|
|
|
|
$obj->recipe; |
57
|
|
|
|
|
|
|
$obj->version; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 DESCRIPTION |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Class that represents chef recipe |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 METHODS |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 Constructor |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
return new L object. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 cookbook ( $cookbook ) |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
set or get cookbook property |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head2 recipe ( $recipe ) |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
set or get recipe property |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head2 version ( $version ) |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
set or get version property |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 KNOWN BUGS |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 SUPPORT |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
open a github ticket or email comments to Bhavin Patel |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
This Software is free to use , licensed under : The Artisic License 2.0 (GPL Compatible) |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=cut |