[Rt-commit] rt branch, 4.2/rename-role-classes, created. rt-4.1.6-112-gd5d0791
Thomas Sibley
trs at bestpractical.com
Fri Jan 18 21:02:01 EST 2013
The branch, 4.2/rename-role-classes has been created
at d5d079110be946ddbb9062ca7178bc3a0d037f51 (commit)
- Log -----------------------------------------------------------------
commit d5d079110be946ddbb9062ca7178bc3a0d037f51
Author: Thomas Sibley <trs at bestpractical.com>
Date: Fri Jan 18 17:59:06 2013 -0800
Rename roles to be under RT::Record::Role:: or RT::SearchBuilder::Role::
Instead of creating another Record/SearchBuilder tree under RT::Role::.
This ordering reads much better.
diff --git a/lib/RT/Article.pm b/lib/RT/Article.pm
index d6d0fbf..19971a3 100644
--- a/lib/RT/Article.pm
+++ b/lib/RT/Article.pm
@@ -53,7 +53,7 @@ package RT::Article;
use base 'RT::Record';
use Role::Basic 'with';
-with "RT::Role::Record::Links" => { -excludes => ["AddLink", "_AddLinksOnCreate"] };
+with "RT::Record::Role::Links" => { -excludes => ["AddLink", "_AddLinksOnCreate"] };
use RT::Articles;
use RT::ObjectTopics;
diff --git a/lib/RT/Group.pm b/lib/RT/Group.pm
index 97174d4..4b6217b 100644
--- a/lib/RT/Group.pm
+++ b/lib/RT/Group.pm
@@ -709,7 +709,7 @@ sub RoleClass {
my $self = shift;
my $domain = shift || $self->Domain;
return unless $domain =~ /^(.+)-Role$/;
- return unless $1->DOES("RT::Role::Record::Roles");
+ return unless $1->DOES("RT::Record::Role::Roles");
return $1;
}
diff --git a/lib/RT/Queue.pm b/lib/RT/Queue.pm
index 2844b77..3db7597 100644
--- a/lib/RT/Queue.pm
+++ b/lib/RT/Queue.pm
@@ -70,9 +70,9 @@ use warnings;
use base 'RT::Record';
use Role::Basic 'with';
-with "RT::Role::Record::Lifecycle",
- "RT::Role::Record::Links" => { -excludes => ["_AddLinksOnCreate"] },
- "RT::Role::Record::Roles";
+with "RT::Record::Role::Lifecycle",
+ "RT::Record::Role::Links" => { -excludes => ["_AddLinksOnCreate"] },
+ "RT::Record::Role::Roles";
sub Table {'Queues'}
diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index ae26d6a..9338a2a 100644
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -1268,7 +1268,7 @@ control transactions on both base and target and with SilentBase and
SilentTarget respectively. By default both transactions are created.
If the link destination is a local object and does the
-L<RT::Role::Record::Status> role, this method ensures object Status is not
+L<RT::Record::Role::Status> role, this method ensures object Status is not
"deleted". Linking to deleted objects is forbidden.
If the link destination (i.e. not C<$self>) is a local object and the
@@ -1331,7 +1331,7 @@ sub _AddLink {
}
# Prevent linking to deleted objects
- if ($remote_obj->DOES("RT::Role::Record::Status")
+ if ($remote_obj->DOES("RT::Record::Role::Status")
and $remote_obj->Status eq "deleted") {
return (0, $self->loc("Linking to a deleted [_1] is not allowed", $self->loc(lc($remote_obj->RecordType))));
}
diff --git a/lib/RT/Role/Record.pm b/lib/RT/Record/Role.pm
similarity index 95%
rename from lib/RT/Role/Record.pm
rename to lib/RT/Record/Role.pm
index 71b0efd..bd66c03 100644
--- a/lib/RT/Role/Record.pm
+++ b/lib/RT/Record/Role.pm
@@ -49,19 +49,19 @@
use strict;
use warnings;
-package RT::Role::Record;
+package RT::Record::Role;
use Role::Basic;
=head1 NAME
-RT::Role::Record - Common requirements for roles which are consumed by records
+RT::Record::Role - Common requirements for roles which are consumed by records
=head1 DESCRIPTION
Various L<RT::Record> (and by inheritance L<DBIx::SearchBuilder::Record>)
methods are required by this role. It provides no methods on its own but is
simply a contract for other roles to require (usually under the
-I<RT::Role::Record::> namespace).
+I<RT::Record::Role::> namespace).
=cut
diff --git a/lib/RT/Role/Record/Lifecycle.pm b/lib/RT/Record/Role/Lifecycle.pm
similarity index 97%
rename from lib/RT/Role/Record/Lifecycle.pm
rename to lib/RT/Record/Role/Lifecycle.pm
index 2ee5e05..b2b4aa2 100644
--- a/lib/RT/Role/Record/Lifecycle.pm
+++ b/lib/RT/Record/Role/Lifecycle.pm
@@ -49,17 +49,17 @@
use strict;
use warnings;
-package RT::Role::Record::Lifecycle;
+package RT::Record::Role::Lifecycle;
use Role::Basic;
use Scalar::Util qw(blessed);
=head1 NAME
-RT::Role::Record::Lifecycle - Common methods for records which have a Lifecycle column
+RT::Record::Role::Lifecycle - Common methods for records which have a Lifecycle column
=head1 REQUIRES
-=head2 L<RT::Role::Record>
+=head2 L<RT::Record::Role>
=head2 LifecycleType
@@ -75,7 +75,7 @@ method isn't available in consuming classes, however.
=cut
-with 'RT::Role::Record';
+with 'RT::Record::Role';
requires 'LifecycleType';
# XXX: can't require column methods due to DBIx::SB::Record's AUTOLOAD
diff --git a/lib/RT/Role/Record/Links.pm b/lib/RT/Record/Role/Links.pm
similarity index 97%
rename from lib/RT/Role/Record/Links.pm
rename to lib/RT/Record/Role/Links.pm
index eb6bfd1..977db70 100644
--- a/lib/RT/Role/Record/Links.pm
+++ b/lib/RT/Record/Role/Links.pm
@@ -49,16 +49,16 @@
use strict;
use warnings;
-package RT::Role::Record::Links;
+package RT::Record::Role::Links;
use Role::Basic;
=head1 NAME
-RT::Role::Record::Links - Common methods for records which handle links
+RT::Record::Role::Links - Common methods for records which handle links
=head1 REQUIRES
-=head2 L<RT::Role::Record>
+=head2 L<RT::Record::Role>
=head2 _AddLink
@@ -76,7 +76,7 @@ The right name to check in L<AddLink> and L<DeleteLink>.
=cut
-with 'RT::Role::Record';
+with 'RT::Record::Role';
requires '_AddLink';
requires '_DeleteLink';
diff --git a/lib/RT/Role/Record/Roles.pm b/lib/RT/Record/Role/Roles.pm
similarity index 99%
rename from lib/RT/Role/Record/Roles.pm
rename to lib/RT/Record/Role/Roles.pm
index 1c19a72..83e302a 100644
--- a/lib/RT/Role/Record/Roles.pm
+++ b/lib/RT/Record/Role/Roles.pm
@@ -49,21 +49,21 @@
use strict;
use warnings;
-package RT::Role::Record::Roles;
+package RT::Record::Role::Roles;
use Role::Basic;
use Scalar::Util qw(blessed);
=head1 NAME
-RT::Role::Record::Roles - Common methods for records which "watchers" or "roles"
+RT::Record::Role::Roles - Common methods for records which "watchers" or "roles"
=head1 REQUIRES
-=head2 L<RT::Role::Record>
+=head2 L<RT::Record::Role>
=cut
-with 'RT::Role::Record';
+with 'RT::Record::Role';
require RT::System;
require RT::Principal;
diff --git a/lib/RT/Role/Record/Status.pm b/lib/RT/Record/Role/Status.pm
similarity index 97%
rename from lib/RT/Role/Record/Status.pm
rename to lib/RT/Record/Role/Status.pm
index 165c02c..ad96c2a 100644
--- a/lib/RT/Role/Record/Status.pm
+++ b/lib/RT/Record/Role/Status.pm
@@ -49,18 +49,18 @@
use strict;
use warnings;
-package RT::Role::Record::Status;
+package RT::Record::Role::Status;
use Role::Basic;
use Scalar::Util qw(blessed);
=head1 NAME
-RT::Role::Record::Status - Common methods for records which have a Status column
+RT::Record::Role::Status - Common methods for records which have a Status column
=head1 DESCRIPTION
Lifecycles are generally set on container records, and Statuses on records
-which belong to one of those containers. L<RT::Role::Record::Lifecycle>
+which belong to one of those containers. L<RT::Record::Role::Lifecycle>
handles the containers with the I<Lifecycle> column. This role is for the
records with a I<Status> column within those containers. It includes
convenience methods for grabbing an L<RT::Lifecycle> object as well setters for
@@ -68,12 +68,12 @@ validating I<Status> and the column which points to the container object.
=head1 REQUIRES
-=head2 L<RT::Role::Record>
+=head2 L<RT::Record::Role>
=head2 LifecycleColumn
Used as a role parameter. Must return a string of the column name which points
-to the container object that consumes L<RT::Role::Record::Lifecycle> (or
+to the container object that consumes L<RT::Record::Role::Lifecycle> (or
conforms to it). The resulting string is used to construct two method names:
as-is to fetch the column value and suffixed with "Obj" to fetch the object.
@@ -86,7 +86,7 @@ method isn't available in consuming classes, however.
=cut
-with 'RT::Role::Record';
+with 'RT::Record::Role';
requires 'LifecycleColumn';
# XXX: can't require column methods due to DBIx::SB::Record's AUTOLOAD
diff --git a/lib/RT/Role/SearchBuilder.pm b/lib/RT/SearchBuilder/Role.pm
similarity index 94%
rename from lib/RT/Role/SearchBuilder.pm
rename to lib/RT/SearchBuilder/Role.pm
index 766cd13..ec102ce 100644
--- a/lib/RT/Role/SearchBuilder.pm
+++ b/lib/RT/SearchBuilder/Role.pm
@@ -49,19 +49,19 @@
use strict;
use warnings;
-package RT::Role::SearchBuilder;
+package RT::SearchBuilder::Role;
use Role::Basic;
=head1 NAME
-RT::Role::SearchBuilder - Common requirements for roles which are consumed by collections
+RT::SearchBuilder::Role - Common requirements for roles which are consumed by collections
=head1 DESCRIPTION
Various L<RT::SearchBuilder> (and by inheritance L<DBIx::SearchBuilder>)
methods are required by this role. It provides no methods on its own but is
simply a contract for other roles to require (usually under the
-I<RT::Role::SearchBuilder::> namespace).
+I<RT::SearchBuilder::Role::> namespace).
=cut
diff --git a/lib/RT/Role/SearchBuilder/Roles.pm b/lib/RT/SearchBuilder/Role/Roles.pm
similarity index 98%
rename from lib/RT/Role/SearchBuilder/Roles.pm
rename to lib/RT/SearchBuilder/Role/Roles.pm
index 49af9c2..122278c 100644
--- a/lib/RT/Role/SearchBuilder/Roles.pm
+++ b/lib/RT/SearchBuilder/Role/Roles.pm
@@ -49,21 +49,21 @@
use strict;
use warnings;
-package RT::Role::SearchBuilder::Roles;
+package RT::SearchBuilder::Role::Roles;
use Role::Basic;
use Scalar::Util qw(blessed);
=head1 NAME
-RT::Role::Record::Roles - Common methods for records which "watchers" or "roles"
+RT::Record::Role::Roles - Common methods for records which "watchers" or "roles"
=head1 REQUIRES
-=head2 L<RT::Role::SearchBuilder>
+=head2 L<RT::SearchBuilder::Role>
=cut
-with 'RT::Role::SearchBuilder';
+with 'RT::SearchBuilder::Role';
require RT::System;
require RT::Principal;
diff --git a/lib/RT/System.pm b/lib/RT/System.pm
index 4c2912c..7bbca13 100644
--- a/lib/RT/System.pm
+++ b/lib/RT/System.pm
@@ -73,7 +73,7 @@ use warnings;
use base qw/RT::Record/;
use Role::Basic 'with';
-with "RT::Role::Record::Roles";
+with "RT::Record::Role::Roles";
use RT::ACL;
use RT::ACE;
@@ -138,7 +138,7 @@ sub AvailableRights {
# Only return rights on classes which support the role asked for
if ($principal and $principal->IsRoleGroup) {
my $role = $principal->Object->Type;
- @types = grep { $_->DOES('RT::Role::Record::Roles') and $_->HasRole($role) } @types;
+ @types = grep { $_->DOES('RT::Record::Role::Roles') and $_->HasRole($role) } @types;
%rights = ();
}
diff --git a/lib/RT/Ticket.pm b/lib/RT/Ticket.pm
index 9979f66..4f9bea4 100644
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@ -74,9 +74,9 @@ use Role::Basic 'with';
# SetStatus and _SetStatus are reimplemented below (using other pieces of the
# role) to deal with ACLs, moving tickets between queues, and automatically
# setting dates.
-with "RT::Role::Record::Status" => { -excludes => [qw(SetStatus _SetStatus)] },
- "RT::Role::Record::Links",
- "RT::Role::Record::Roles";
+with "RT::Record::Role::Status" => { -excludes => [qw(SetStatus _SetStatus)] },
+ "RT::Record::Role::Links",
+ "RT::Record::Role::Roles";
use RT::Queue;
use RT::User;
diff --git a/lib/RT/Tickets.pm b/lib/RT/Tickets.pm
index 4257cee..1052d5f 100644
--- a/lib/RT/Tickets.pm
+++ b/lib/RT/Tickets.pm
@@ -84,7 +84,7 @@ use warnings;
use base 'RT::SearchBuilder';
use Role::Basic 'with';
-with 'RT::Role::SearchBuilder::Roles';
+with 'RT::SearchBuilder::Role::Roles';
use RT::Ticket;
use RT::SQL;
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list