Changeset 1638
- Timestamp:
- 09/02/06 01:58:50
- Files:
-
- trunk/plagger (modified) (previous)
- trunk/plagger/lib/Plagger/Date.pm (modified) (1 diff)
- trunk/plagger/lib/Plagger/Plugin.pm (modified) (1 diff)
- trunk/plagger/lib/Plagger/Template.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/lib/Plagger/Date.pm
r1386 r1638 97 97 98 98 1; 99 100 __END__ 101 102 =head1 NAME 103 104 Plagger::Date - DateTime subclass for Plagger 105 106 =head1 SYNOPSIS 107 108 109 110 =head1 DESCRIPTION 111 112 This module subclasses DataTime for plagger's own needs. 113 114 =over 115 116 =item rebless 117 118 ... 119 120 =item parse 121 122 ... 123 124 =item parse_dwim 125 126 ... 127 128 =item strptime 129 130 ... 131 132 =item now 133 134 ... 135 136 =item from_epoch 137 138 ... 139 140 =item format($format) 141 142 Convience method. Returns the datetime in the format 143 passed (either a formatter object or a blessed reference) 144 145 =item set_time_zone 146 147 Overides default behavior to default to UTC if the passed 148 time zone isn't a legal 149 150 =item serialize 151 152 Returns the object as a W3CDTF string. 153 154 =cut 155 156 =back 157 158 =head1 AUTHOR 159 160 Tatsuhiko Miyagawa E<lt>miyagawa@bulknews.netE<gt> 161 162 See I<AUTHORS> file for the name of all the contributors. 163 164 =head1 LICENSE 165 166 Except where otherwise noted, Plagger is free software; you can 167 redistribute it and/or modify it under the same terms as Perl itself. 168 169 =head1 SEE ALSO 170 171 L<http://plagger.org/>, L<DateTime> 172 173 =cut trunk/plagger/lib/Plagger/Plugin.pm
r1592 r1638 162 162 163 163 1; 164 165 __END__ 166 167 =head1 NAME 168 169 Plagger::Plugin - Base class for Plagger Pluggins 170 171 =head1 SYNOPSIS 172 173 package Plagger::Plugin::Something; 174 use base qw(Plagger::Plugin); 175 176 # register hooks 177 sub register { 178 my ($self, $context) = @_; 179 $context->register_hook( $self, 180 'thingy.wosit' => $self->can('doodad'), 181 ) 182 } 183 184 sub doodad { ... } 185 186 =head1 DESCRIPTION 187 188 This is the base class for plagger plugins. Pretty much everything is done 189 by pluggins in Plagger. 190 191 To write a new plugin, simply inherit from Plagger::Plugin: 192 193 package Plagger::Plugin; 194 use base qw(Plagger::Plugin); 195 196 Then register some hooks: 197 198 # register hooks 199 sub register { 200 my ($self, $context) = @_; 201 $context->register_hook( $self, 202 'thingy.wosit' => $self->can('doodad'), 203 ) 204 } 205 206 207 This means that the "doodad" method will be called at the "thingy.wosit" 208 stage. 209 210 =head2 Methods 211 212 =over 213 214 =item new 215 216 Standard constructor. Calls init. 217 218 =item init 219 220 Initilises the plugin 221 222 =item walk_config_encryption 223 224 =item do_walk 225 226 =item decrypt_config 227 228 =item conf 229 230 =item rule 231 232 =item rule_hook 233 234 =item cache 235 236 =item dispatch_rule_on 237 238 =item class_id 239 240 =item assets_dir 241 242 =item log 243 244 =item cookie_jar 245 246 Access the Plagger::Cookies object. 247 248 =item templatize 249 250 =item load_assets 251 252 =back 253 254 =head1 AUTHOR 255 256 Tatsuhiko Miyagawa E<lt>miyagawa@bulknews.netE<gt> 257 258 See I<AUTHORS> file for the name of all the contributors. 259 260 =head1 LICENSE 261 262 Except where otherwise noted, Plagger is free software; you can 263 redistribute it and/or modify it under the same terms as Perl itself. 264 265 =head1 SEE ALSO 266 267 L<http://plagger.org/> 268 269 =cut trunk/plagger/lib/Plagger/Template.pm
r1412 r1638 32 32 1; 33 33 34 __END__ 35 36 37 =head1 NAME 38 39 Plagger::Template - Template Toolkit subclass for Plagger 40 41 =head1 SYNOPSIS 42 43 From within a plagger plugin 44 $self->templatize($file, $vars); 45 46 =head1 DESCRIPTION 47 48 A subclass of Template Toolkit that's used by the Plagger plugins. 49 As a plugin author, you really don't have to worry about this. See the 50 documentation for Plagger::Pluggin's templatize method instead. 51 52 The plugin calls the custom new routine like so: 53 54 Plagger::Template->new($plagger_context, $self); 55 56 Essentially this subclass uses this to know where the templates are 57 from the assests path. 58 59 It also does the right thing with encodings and utf8. 60 61 =head1 AUTHOR 62 63 Tatsuhiko Miyagawa E<lt>miyagawa@bulknews.netE<gt> 64 65 See I<AUTHORS> file for the name of all the contributors. 66 67 =head1 LICENSE 68 69 Except where otherwise noted, Plagger is free software; you can 70 redistribute it and/or modify it under the same terms as Perl itself. 71 72 =head1 SEE ALSO 73 74 L<http://plagger.org/>, L<Template>, L<http://tt2.org/> 75 76 =cut
