line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Quiki::Meta; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
2042
|
use YAML::Any qw.LoadFile Dump.; |
|
2
|
|
|
|
|
1348
|
|
|
2
|
|
|
|
|
16
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub get { |
6
|
2
|
|
|
2
|
1
|
6665
|
my $node = shift; |
7
|
|
|
|
|
|
|
|
8
|
2
|
100
|
|
|
|
63
|
unless (-f "data/meta/$node") { |
9
|
1
|
|
|
|
|
4
|
my $meta = { |
10
|
|
|
|
|
|
|
last_update_by => '_', |
11
|
|
|
|
|
|
|
last_updated_in => '_', |
12
|
|
|
|
|
|
|
rev => 0}; |
13
|
1
|
|
|
|
|
4
|
set($node, $meta); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
|
|
14
|
LoadFile "data/meta/$node"; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub set { |
20
|
2
|
|
|
2
|
1
|
27538
|
my ($node, $meta) = @_; |
21
|
|
|
|
|
|
|
|
22
|
2
|
50
|
|
|
|
248
|
open(F, ">data/meta/$node") or die $!; |
23
|
2
|
|
|
|
|
13
|
print F Dump($meta); |
24
|
2
|
|
|
|
|
24347
|
close(F); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=encoding UTF-8 |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 NAME |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Quiki::Meta - Quiki meta information handler |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 SYNOPSIS |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
use Quiki::Meta; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# get meta info |
39
|
|
|
|
|
|
|
$self->{meta} = Quiki::Meta::get($node); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# set meta info |
42
|
|
|
|
|
|
|
Quiki::Meta::set($node, $self->{meta}); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 DESCRIPTION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Handles saving and retriving meta information for quiki nodes. Meta |
47
|
|
|
|
|
|
|
information is stored in simple text files and uses the YAML format. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 set |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
This function updates the meta information in the file for a given page. |
52
|
|
|
|
|
|
|
It uses the meta information in the current Quicki object. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 get |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
This function retrives the meta information from the file for a given |
57
|
|
|
|
|
|
|
node. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 SEE ALSO |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Quiki, perl(1) |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 AUTHOR |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Alberto Simões, Eambs@cpan.orgE |
66
|
|
|
|
|
|
|
Nuno Carvalho, Esmash@cpan.orgE |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Copyright 2009-2010 Alberto Simoes and Nuno Carvalho. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
73
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
74
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
"zero"; |