[Rt-commit] rt branch, 4.0/pod-spell, updated. rt-4.0.0rc6-143-g7b1ba99
Shawn Moore
sartak at bestpractical.com
Thu Mar 17 18:04:34 EDT 2011
The branch, 4.0/pod-spell has been updated
via 7b1ba99ab072259d2337843e420a2a1d3fdf1d19 (commit)
via 78742fd532c214be2aaae63942483b264f47a923 (commit)
via e28059da0351fce06899dc025303d14bf7ae579e (commit)
via 2095f6a97872364526c1035371263888ac824df2 (commit)
from 2b5a98990b72542381dc140f0792d69260bfd64d (commit)
Summary of changes:
lib/RT/Config.pm | 97 ++++++++++++++++++++++++++++++-------------------
lib/RT/CurrentUser.pm | 6 ++-
lib/RT/CustomField.pm | 29 ++++++++-------
t/99-pod-spelling.t | 2 +
4 files changed, 81 insertions(+), 53 deletions(-)
- Log -----------------------------------------------------------------
commit 2095f6a97872364526c1035371263888ac824df2
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Thu Mar 17 17:56:56 2011 -0400
Spellcheck lib/RT/Config.pm
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 3126035..99298ba 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -58,7 +58,7 @@ use File::Spec ();
RT::Config - RT's config
-=head1 SYNOPSYS
+=head1 SYNOPSIS
# get config object
use RT::Config;
@@ -88,13 +88,13 @@ Second file is F<RT_SiteConfig.pm> - site config file. You can use it
to customize your RT instance. In this file you can override any option
listed in core config file.
-RT extensions could also provide thier config files. Extensions should
+RT extensions could also provide their config files. Extensions should
use F<< <NAME>_Config.pm >> and F<< <NAME>_SiteConfig.pm >> names for
config files, where <NAME> is extension name.
-B<NOTE>: All options from RT's config and extensions' configs are saved
-in one place and thus extension could override RT's options, but it is not
-recommended.
+B<NOTE>: All options from RT's config and extensions' configuration files are
+saved in one place and thus extension could override RT's options, but it is
+not recommended.
=cut
@@ -104,7 +104,7 @@ Hash of Config options that may be user overridable
or may require more logic than should live in RT_*Config.pm
Keyed by config name, there are several properties that
-can be set for each config optin:
+can be set for each config option:
Section - What header this option should be grouped
under on the user Settings page
@@ -113,7 +113,7 @@ can be set for each config optin:
for display to the user
Widget - Mason component path to widget that should be used
to display this config option
- WidgetArguments - An argument hash passed to the WIdget
+ WidgetArguments - An argument hash passed to the Widget
Description - Friendly description to show the user
Values - Arrayref of options (for select Widget)
ValuesLabel - Hashref, key is the Value from the Values
@@ -598,7 +598,7 @@ sub _Init {
=head2 InitConfig
-Do nothin right now.
+Currently does nothing.
=cut
@@ -611,9 +611,8 @@ sub InitConfig {
=head2 LoadConfigs
-Load all configs. First of all load RT's config then load
-extensions' config files in alphabetical order.
-Takes no arguments.
+Load all configuration files. RT's config is loaded first, followed by
+extensions' config in alphabetical order. Takes no arguments.
=cut
@@ -631,16 +630,16 @@ sub LoadConfigs {
=head1 LoadConfig
-Takes param hash with C<File> field.
-First, the site configuration file is loaded, in order to establish
-overall site settings like hostname and name of RT instance.
-Then, the core configuration file is loaded to set fallback values
-for all settings; it bases some values on settings from the site
-configuration file.
+Takes a paramhash with a C<File> field. First, the site configuration file is
+loaded, in order to establish overall site settings like hostname and the name
+of the RT instance. Then, the core configuration file is loaded to set fallback
+values for all settings; it bases some values (such as C<WebBaseURL>) on
+settings from the site configuration file.
-B<Note> that core config file don't change options if site config
-has set them so to add value to some option instead of
-overriding you have to copy original value from core config file.
+B<Note> that core config file doesn't change an option if the site config has
+already set it. So to add a value to an option, instead of simply overriding
+(such as C<HomepageComponents>), you have to copy the original value from the
+core config file.
=cut
@@ -775,31 +774,55 @@ sub Configs {
=head2 Get
-Takes name of the option as argument and returns its current value.
+Takes the name of the option as its argument and returns its current value.
In the case of a user-overridable option, first checks the user's
preferences before looking for site-wide configuration.
-Returns values from RT_SiteConfig, RT_Config and then the %META hash
-of configuration variables's "Default" for this config variable,
-in that order.
+Returns values from F<RT_SiteConfig.pm>, F<RT_Config.pm> and then the C<%META>
+hash of configuration variable's "Default" for this config variable, in that
+order.
-Returns different things in scalar and array contexts. For scalar
-options it's not that important, however for arrays and hash it's.
-In scalar context returns references to arrays and hashes.
+This returns different values in scalar and array contexts. For scalar options
+it's not that important, however for options that return arrays and hash,
+context is important. In scalar context, returns references to arrays and
+hashes.
-Use C<scalar> perl's op to force context, especially when you use
-C<(..., Argument => RT->Config->Get('ArrayOpt'), ...)>
-as perl's '=>' op doesn't change context of the right hand argument to
-scalar. Instead use C<(..., Argument => scalar RT->Config->Get('ArrayOpt'), ...)>.
+Use Perl's C<scalar> operator to force context, especially when you are
+constructing a hash, like:
-It's also important for options that have no default value(no default
+ my %options = (
+ ...,
+ Argument => RT->Config->Get('ArrayOpt'),
+ ...,
+ );
+
+This is broken because Perl's C<< => >> operator doesn't change the context of
+the right-hand side to scalar context. Instead, use:
+
+ my %options = (
+ ...,
+ Argument => scalar RT->Config->Get('ArrayOpt'),
+ ...,
+ );
+
+It's also important for options that have no default value (i.e. not set
in F<etc/RT_Config.pm>). If you don't force scalar context then you'll
-get empty list and all your named args will be messed up. For example
-C<(arg1 => 1, arg2 => RT->Config->Get('OptionDoesNotExist'), arg3 => 3)>
-will result in C<(arg1 => 1, arg2 => 'arg3', 3)> what is most probably
-unexpected, or C<(arg1 => 1, arg2 => RT->Config->Get('ArrayOption'), arg3 => 3)>
-will result in C<(arg1 => 1, arg2 => 'element of option', 'another_one' => ..., 'arg3', 3)>.
+get the empty list and all your named arguments will be messed up. For example:
+
+ my %options = (
+ Arg1 => 1,
+ Arg2 => RT->Config->Get('OptionDoesNotExist'),
+ Arg3 => 3,
+ );
+
+will result in:
+
+ my %options = (
+ Arg1 => 1,
+ Arg2 => 'Arg3',
+ 3 => undef,
+ );
=cut
diff --git a/t/99-pod-spelling.t b/t/99-pod-spelling.t
index 386e704..3f2c64b 100644
--- a/t/99-pod-spelling.t
+++ b/t/99-pod-spelling.t
@@ -84,6 +84,8 @@ longtext
ENTRYAGGREGATOR
deserializing
recursing
+overridable
+variable's
# RT JARGON
ACEs
commit e28059da0351fce06899dc025303d14bf7ae579e
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Thu Mar 17 17:58:19 2011 -0400
Spellcheck lib/RT/CurrentUser.pm and justify RT::CurrentUser->CurrentUser
diff --git a/lib/RT/CurrentUser.pm b/lib/RT/CurrentUser.pm
index 57ee1eb..34b4b48 100644
--- a/lib/RT/CurrentUser.pm
+++ b/lib/RT/CurrentUser.pm
@@ -204,7 +204,7 @@ sub LoadByName {
=head2 LanguageHandle
-Returns this current user's langauge handle. Should take a language
+Returns this current user's language handle. Should take a language
specification. but currently doesn't
=cut
@@ -260,7 +260,9 @@ sub loc_fuzzy {
=head2 CurrentUser
-Return the current currentuser object
+Return the current L<RT::CurrentUser> object. This is of course what you
+already have, but this means you can call C<< ->CurrentUser >> a bit more
+freely.
=cut
commit 78742fd532c214be2aaae63942483b264f47a923
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Thu Mar 17 18:01:23 2011 -0400
Remove useless use of /o; it only matters if there's a variable in the regex
diff --git a/lib/RT/CustomField.pm b/lib/RT/CustomField.pm
index bfb6e54..dc17618 100644
--- a/lib/RT/CustomField.pm
+++ b/lib/RT/CustomField.pm
@@ -1150,17 +1150,16 @@ sub CollectionClassFromLookupType {
=head1 ApplyGlobally
-Certain custom fields (users, groups) should only be applied globally
-but rather than regexing in code for LookupType =~ RT::Queue, we'll codify
-the rules here.
+Certain custom fields (users, groups) should only be applied globally but
+rather than regex matching in code for C<LookupType =~ /^RT::(?:Group|User)/>,
+we'll codify the rules here.
=cut
sub ApplyGlobally {
my $self = shift;
- return ($self->LookupType =~ /^RT::(?:Group|User)/io);
-
+ return $self->LookupType =~ /^RT::(?:Group|User)/i;
}
=head1 AppliedTo
commit 7b1ba99ab072259d2337843e420a2a1d3fdf1d19
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Thu Mar 17 18:04:26 2011 -0400
Spellcheck lib/RT/CustomField.pm
diff --git a/lib/RT/CustomField.pm b/lib/RT/CustomField.pm
index dc17618..3bd36a7 100644
--- a/lib/RT/CustomField.pm
+++ b/lib/RT/CustomField.pm
@@ -440,7 +440,7 @@ If the Queue parameter is '0', look for global ticket custom fields.
If no queue parameter is specified, look for any and all custom fields with this name.
-BUG/TODO, this won't let you specify that you only want user or group CFs.
+BUG/TODO, this won't let you specify that you only want user or group custom fields.
=cut
@@ -612,7 +612,7 @@ sub ValidateQueue {
=head2 Types
-Retuns an array of the types of CustomField that are supported
+Returns a list of the types of CustomField that are supported.
=cut
@@ -623,8 +623,8 @@ sub Types {
=head2 IsSelectionType
-Retuns a boolean value indicating whether the C<Values> method makes sense
-to this Custom Field.
+Returns a boolean value indicating whether the C<Values> method applies to this
+Custom Field.
=cut
@@ -905,8 +905,10 @@ sub _Value {
=head2 SetDisabled
Takes a boolean.
-1 will cause this custom field to no longer be avaialble for objects.
-0 will re-enable this field.
+
+True values will cause this custom field to no longer be available for objects.
+
+False will re-enable this field.
=cut
@@ -1343,7 +1345,7 @@ sub RemoveFromObject {
=head2 AddValueForObject HASH
Adds a custom field value for a record object of some kind.
-Takes a param hash of
+Takes a paramhash of:
Required:
@@ -1495,7 +1497,7 @@ sub FriendlyPattern {
=head2 DeleteValueForObject HASH
-Deletes a custom field value for a ticket. Takes a param hash of Object and Content
+Deletes a custom field value for a ticket. Takes a paramhash of Object and Content.
Returns a tuple of (STATUS, MESSAGE). If the call succeeded, the STATUS is true. otherwise it's false
@@ -1640,7 +1642,7 @@ sub LinkValueTo {
With one argument, returns the _URLTemplate named C<NAME>, but only if
the current user has the right to see this custom field.
-With two arguments, attemptes to set the relevant template value.
+With two arguments, this attempts to set the relevant template value.
=cut
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list