Website.pm

filter: Statementstmt 100% 12 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 15 / 15 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Website/Command/Install.pm ↑ Summary
1 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package App::PM::Website;
5 {
6 2 $App::PM::Website::VERSION = '0.131611';
7 }
8 #use App::Cmd::Setup -app;
9 2 ▶use base 'App::Cmd';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 1;
12  
13  
14 =pod
15  
16 =head1 NAME
17  
18 App::PM::Website
19  
20 =head1 VERSION
21  
22 version 0.131611
23  
24 =head1 SYNOPSIS
25  
26 # create and initialize configuration file:
27 pm-website init --build-dir website \
28 --template-dir template \
29 --config-file config/pm-website.yaml \
30 --username your_username \
31 --groupname monger_long_city_name
32  
33 # manually update configfile to list new meeting
34 vim config/pm-website.yaml
35  
36 # create template directory and templates
37 mkdir template/
38 cp examples/template/index.in template/
39 vim templates/index.in
40  
41 # copy cacert for pm.org from examples:
42 cp examples/cacert.pem ./
43  
44 # render website locally to website/ dir
45 pm-website build
46  
47 ... view changes locally ...
48  
49 # upload website/index file to pm.org
50 pm-website upload
51  
52 =head1 DESCRIPTION
53  
54 Use C<pm-website> to render and maintain an up-to-date info page
55 for your Perl Monger group!
56  
57 L<PM.org|http://pm.org> provides free hosting for perl monger groups.
58 Pages must be updated with webDAV and server-side scripts are not
59 allowed. C<pm-website> will update and install a static, template-driven
60 page via webDAV with minimal effort. Spend less time while creating a
61 more useful front page. Everyone wins!
62  
63 =head1 COMMANDS
64  
65 =over
66  
67 =item C<pm-website init>
68  
69 Initialize a configuration yaml file with the necessary keys
70  
71 =item C<pm-website build>
72  
73 Builds the index file (F<website/index.html>) by rendering the
74 template (F<template/index.in>) with TemplateToolkit. The template
75 is passed models describing the next meeting and location, past
76 meetings, presenters and locations. See L</Model>.
77  
78 =item C<pm-website install>
79  
80 Uploads F<website/index.html> via webDAV to F<< groups.pm.org/groups/I<$groupname> >>, which corresponds to L<< http://I<$groupname>.pm.org/ >>
81  
82 I<username> and I<groupname> are read from the configuration file
83 and password is read from the C<groups.pm.org> entry in F<$HOME/.netrc>
84 if the files exists and is not readable by others.
85  
86 #netrc example
87 machine groups.pm.org
88 login USERNAME
89 password PASSWORD
90  
91 =back
92  
93 =head1 Model
94  
95 The template will be provided with models derived from the configuration file. Any information added to the presenter, location and meetings configuration keys will be presented in the model.
96  
97 =over
98  
99 =item C<m>
100  
101 A hash describing the next meeting.
102  
103 Meetings have additional date keys added from the C<event_date> or C<epoch> field.
104  
105 =over
106  
107 =item * C<epoch>
108  
109 event time in epoch unix seconds. Created from C<event_date> if missing.
110  
111 =item * C<dt>
112  
113 a DateTime object created from C<epoch>
114  
115 =item * C<ds1>
116  
117 C<dt> rendered using strp pattern '%Y-%b-%d'.
118  
119 =item * C<ds_std>
120  
121 C<dt> rendered using strp pattern '%A %B %e, %Y'.
122  
123 =item * C<event_date_pretty>
124  
125 C<dt> rendered using strp pattern '%A the %e' and then munged by Lingua::EN::Numbers::Ordinate to produce strings like "Friday the 13th" or "Thursday the 23rd"
126  
127 =back
128  
129 =item C<meetings>
130  
131 An array of hashes describing past meetings. The array is reverse sorted by meeting start date. Each hash describes a meeting. The next meeting C<m> is not included in the list of meetings.
132  
133 =item C<l>
134  
135 The location information for the next meeting.
136  
137 =item C<locations>
138  
139 hash of location information keyed by location key.
140  
141 =item C<presenter>
142  
143 hash of presenter information keyed by presenter id.
144  
145 =back
146  
147 =head1 SEE ALSO
148  
149 =over
150  
151 =item * L<Template::Toolkit>
152  
153 =item * la.pm.org: example L<Website|http://la.pm.org> L<Source|https://github.com/spazm/la.pm.org>
154  
155 =item * L<PM Group Hosting FAQ|http://www.pm.org/faq/hosting_faq.html#www>
156  
157 =item * L<How to run a successful PM group|http://www.pm.org/successful/>
158  
159 =back
160  
161 =head1 AUTHOR
162  
163 Andrew Grangaard <spazm@cpan.org>
164  
165 =head1 COPYRIGHT AND LICENSE
166  
167 This software is copyright (c) 2012 by Andrew Grangaard.
168  
169 This is free software; you can redistribute it and/or modify it under
170 the same terms as the Perl 5 programming language system itself.
171  
172 =cut
173  
174  
175 __END__
« Website/Command/Install.pm ↑ Summary