[Rt-commit] r17883 - in rt/3.999/branches/merge_to_3.8.2: .
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Thu Jan 22 04:23:46 EST 2009
Author: sunnavy
Date: Thu Jan 22 04:23:46 2009
New Revision: 17883
Modified:
rt/3.999/branches/merge_to_3.8.2/ (props changed)
rt/3.999/branches/merge_to_3.8.2/lib/RT/Plugin.pm
Log:
r18973 at sunnavys-mb: sunnavy | 2009-01-22 16:41:59 +0800
merged lib/RT/Plugin.pm
Modified: rt/3.999/branches/merge_to_3.8.2/lib/RT/Plugin.pm
==============================================================================
--- rt/3.999/branches/merge_to_3.8.2/lib/RT/Plugin.pm (original)
+++ rt/3.999/branches/merge_to_3.8.2/lib/RT/Plugin.pm Thu Jan 22 04:23:46 2009
@@ -59,7 +59,8 @@
=head2 new
-Instantiate a new RT::Plugin object. Takes a paramhash. currently the only key it cares about is 'name', the name of this plugin.
+Instantiate a new L<RT::Plugin> object. Takes a paramhash. currently the only key
+it cares about is 'name', the name of this plugin.
=cut
@@ -81,6 +82,24 @@
return $self->{name};
}
+=head2 path
+
+Takes a name of sub directory and returns its full path, for example:
+
+ my $plugin_etc_dir = $plugin->path('etc');
+
+See also L</component_root>, L</po_dir> and other shortcut methods.
+
+=cut
+
+sub path {
+ my $self = shift;
+ my $sub = shift;
+ return $self->_base_path . "/$sub";
+}
+
+
+
sub _base_path {
my $self = shift;
my $base = $self->{'name'};
@@ -92,15 +111,12 @@
=head2 component_root
-Returns the directory this plugin has installed its HTML::Mason templates into
+Returns the directory this plugin has installed its L<HTML::Mason> templates into
+
=cut
-sub component_root {
- my $self = shift;
-
- return $self->_base_path . "/html";
-}
+sub component_root { return $_[0]->path('html') }
=head2 po_dir
@@ -108,10 +124,6 @@
=cut
-sub po_dir {
- my $self = shift;
- return $self->_base_path . "/po";
-
-}
+sub po_dir { return $_[0]->path('po') }
1;
More information about the Rt-commit
mailing list