[Rt-commit] rt branch, 3.9-merge-rtfm, updated. rt-3.9.6-1060-g7834472

Shawn Moore sartak at bestpractical.com
Thu Dec 2 21:20:17 EST 2010


The branch, 3.9-merge-rtfm has been updated
       via  783447289eb09b1e580e369337422451f5471e46 (commit)
       via  ae8e596360e5592242521be0f9115af71c27db39 (commit)
       via  e00a6fcda099e816b8a57b64a04545529370b8aa (commit)
      from  9870a91dea4467950ca73b47cf06d1a4e03f6581 (commit)

Summary of changes:
 lib/RT/FM/System.pm                        |  168 ----------------------------
 share/html/SelfService/Article/autohandler |    2 +-
 t/articles/00smoke.t                       |    3 +-
 t/articles/04interface.t                   |    7 +-
 t/articles/05cfsearch.t                    |    3 +-
 t/articles/06search_interface.t            |    3 +-
 t/articles/10-queue-specific-class.t       |    3 +-
 t/articles/2basic_api.t                    |    8 +-
 t/articles/3upload-customfields.t          |    3 +-
 t/articles/ArticleCollection_Overlay.pm.t  |    3 +-
 t/articles/Article_Overlay.pm.t            |    3 +-
 t/articles/Class_Overlay.pm.t              |    7 +-
 t/articles/URI_a.t                         |    3 +-
 t/articles/URI_fsck_com_rtfm.t             |    3 +-
 t/lib/RT/FM/Test.pm.in                     |   39 -------
 15 files changed, 17 insertions(+), 241 deletions(-)
 delete mode 100644 lib/RT/FM/System.pm
 delete mode 100644 t/lib/RT/FM/Test.pm.in

- Log -----------------------------------------------------------------
commit e00a6fcda099e816b8a57b64a04545529370b8aa
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Dec 2 21:14:13 2010 -0500

    Remove t/lib/RT/FM/Test.pm.in

diff --git a/t/lib/RT/FM/Test.pm.in b/t/lib/RT/FM/Test.pm.in
deleted file mode 100644
index 0985434..0000000
--- a/t/lib/RT/FM/Test.pm.in
+++ /dev/null
@@ -1,39 +0,0 @@
-use strict;
-use warnings;
-
-### after: use lib qw(@RT_LIB_PATH@);
-use lib qw(/opt/rt3/local/lib /opt/rt3/lib);
-
-package RT::FM::Test;
-
-our @ISA;
-BEGIN {
-    local $@;
-    eval { require RT::Test; 1 } or do {
-        require Test::More;
-        Test::More::BAIL_OUT(
-            "requires 3.8 to run tests. Error:\n$@\n"
-            ."You may need to set PERL5LIB=/path/to/rt/lib"
-        );
-    };
-    push @ISA, 'RT::Test';
-}
-
-sub import {
-    my $class = shift;
-    my %args  = @_;
-
-    $args{'requires'} ||= [];
-    if ( $args{'testing'} ) {
-        unshift @{ $args{'requires'} }, 'RT::FM';
-    } else {
-        $args{'testing'} = 'RT::FM';
-    }
-
-    $class->SUPER::import( %args );
-
-    RT->Config->LoadConfig( File => 'RTFM_Config.pm' );
-    require RT::FM;
-}
-
-1;

commit ae8e596360e5592242521be0f9115af71c27db39
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Dec 2 21:16:06 2010 -0500

    Use RT::Test instead of RT::FM::Test

diff --git a/t/articles/00smoke.t b/t/articles/00smoke.t
index 6521798..77f69a0 100644
--- a/t/articles/00smoke.t
+++ b/t/articles/00smoke.t
@@ -3,8 +3,7 @@
 use strict;
 use warnings;
 
-use lib 't/lib';
-use RT::FM::Test;
+use RT::Test;
 
 use RT;
 ok(RT::LoadConfig);
diff --git a/t/articles/04interface.t b/t/articles/04interface.t
index 977ea7e..950f95c 100644
--- a/t/articles/04interface.t
+++ b/t/articles/04interface.t
@@ -3,8 +3,7 @@
 use strict;
 use warnings;
 
-use lib 't/lib';
-use RT::FM::Test tests => 55;
+use RT::Test tests => 55;
 
 use RT::CustomField;
 use RT::EmailParser;
diff --git a/t/articles/05cfsearch.t b/t/articles/05cfsearch.t
index 3682f3c..9b4719c 100644
--- a/t/articles/05cfsearch.t
+++ b/t/articles/05cfsearch.t
@@ -3,8 +3,7 @@
 use strict;
 use warnings;
 
-use lib 't/lib';
-use RT::FM::Test tests => 14;
+use RT::Test tests => 14;
 
 my $suffix = '-'. $$;
 
diff --git a/t/articles/06search_interface.t b/t/articles/06search_interface.t
index 1afe408..0cba9a8 100644
--- a/t/articles/06search_interface.t
+++ b/t/articles/06search_interface.t
@@ -3,8 +3,7 @@
 use strict;
 use warnings;
 
-use lib 't/lib';
-use RT::FM::Test tests => 24;
+use RT::Test tests => 24;
 
 use RT::CustomField;
 use RT::Queue;
diff --git a/t/articles/10-queue-specific-class.t b/t/articles/10-queue-specific-class.t
index 771b654..c22132d 100644
--- a/t/articles/10-queue-specific-class.t
+++ b/t/articles/10-queue-specific-class.t
@@ -3,8 +3,7 @@
 use strict;
 use warnings;
 
-use lib 't/lib';
-use RT::FM::Test tests => 57;
+use RT::Test tests => 57;
 
 my ( $url, $m ) = RT::Test->started_ok;
 $m->login;
diff --git a/t/articles/2basic_api.t b/t/articles/2basic_api.t
index ee9d442..490ceb1 100644
--- a/t/articles/2basic_api.t
+++ b/t/articles/2basic_api.t
@@ -3,8 +3,7 @@
 use warnings;
 use strict;
 
-use lib 't/lib';
-use RT::FM::Test tests => 43;
+use RT::Test tests => 43;
 
 use_ok 'RT::FM::System';
 my $sys = new RT::FM::System;
diff --git a/t/articles/3upload-customfields.t b/t/articles/3upload-customfields.t
index 0cc60ae..546e136 100644
--- a/t/articles/3upload-customfields.t
+++ b/t/articles/3upload-customfields.t
@@ -3,8 +3,7 @@
 use strict;
 use warnings;
 
-use lib 't/lib';
-use RT::FM::Test tests => 21;
+use RT::Test tests => 21;
 $RT::Test::SKIP_REQUEST_WORK_AROUND = 1;
 
 use RT;
diff --git a/t/articles/ArticleCollection_Overlay.pm.t b/t/articles/ArticleCollection_Overlay.pm.t
index 088bd83..9581342 100644
--- a/t/articles/ArticleCollection_Overlay.pm.t
+++ b/t/articles/ArticleCollection_Overlay.pm.t
@@ -3,8 +3,7 @@
 use strict;
 use warnings;
 
-use lib 't/lib';
-use RT::FM::Test tests => 33;
+use RT::Test tests => 33;
 
 use_ok 'RT::FM::ArticleCollection';
 use_ok 'RT::FM::ClassCollection';
diff --git a/t/articles/Article_Overlay.pm.t b/t/articles/Article_Overlay.pm.t
index b6b8da1..94b40fd 100644
--- a/t/articles/Article_Overlay.pm.t
+++ b/t/articles/Article_Overlay.pm.t
@@ -3,8 +3,7 @@
 use strict;
 use warnings;
 
-use lib 't/lib';
-use RT::FM::Test tests => 71;
+use RT::Test tests => 71;
 
 use_ok 'RT::FM::ArticleCollection';
 use_ok 'RT::FM::ClassCollection';
diff --git a/t/articles/Class_Overlay.pm.t b/t/articles/Class_Overlay.pm.t
index a371ae6..1f0bdeb 100644
--- a/t/articles/Class_Overlay.pm.t
+++ b/t/articles/Class_Overlay.pm.t
@@ -3,8 +3,7 @@
 use strict;
 use warnings;
 
-use lib 't/lib';
-use RT::FM::Test tests => 16;
+use RT::Test tests => 16;
 
 use_ok 'RT::FM::ArticleCollection';
 use_ok 'RT::FM::ClassCollection';
diff --git a/t/articles/URI_a.t b/t/articles/URI_a.t
index 88f6b68..260346c 100644
--- a/t/articles/URI_a.t
+++ b/t/articles/URI_a.t
@@ -3,8 +3,7 @@
 use strict;
 use warnings;
 
-use lib 't/lib';
-use RT::FM::Test tests => 10;
+use RT::Test tests => 10;
 
 use_ok("RT::URI::a");
 my $uri = RT::URI::a->new($RT::SystemUser);
diff --git a/t/articles/URI_fsck_com_rtfm.t b/t/articles/URI_fsck_com_rtfm.t
index fc40e5f..f90ceaf 100644
--- a/t/articles/URI_fsck_com_rtfm.t
+++ b/t/articles/URI_fsck_com_rtfm.t
@@ -3,8 +3,7 @@
 use strict;
 use warnings;
 
-use lib 't/lib';
-use RT::FM::Test tests => 12;
+use RT::Test tests => 12;
 
 use_ok "RT::URI::fsck_com_rtfm";
 my $uri = RT::URI::fsck_com_rtfm->new( $RT::SystemUser );

commit 783447289eb09b1e580e369337422451f5471e46
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Dec 2 21:20:08 2010 -0500

    Use RT::System instead of RT::FM::System

diff --git a/lib/RT/FM/System.pm b/lib/RT/FM/System.pm
deleted file mode 100644
index b11e7b7..0000000
--- a/lib/RT/FM/System.pm
+++ /dev/null
@@ -1,168 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/copyleft/gpl.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-=head1 NAME 
-
-RT::FM::System
-
-=head1 DESCRIPTION
-
-RT::FM::System is a simple global object used as a focal point for things
-that are system-wide.
-
-It works sort of like an RT::Record, except it's really a single object that has
-an id of "1" when instantiated.
-
-This gets used by the ACL system so that you can have rights for the scope "RT::FM::System"
-
-In the future, there will probably be other API goodness encapsulated here.
-
-=cut
-
-
-no warnings 'redefine';
-package RT::FM::System;
-use RT::ACL;
-use base qw /RT::Base/;
-use strict;
-use vars qw/ $RIGHTS/;
-
-
-# Tell RT::ACE that this sort of object can get acls granted
-$RT::ACE::OBJECT_TYPES{'RT::FM::System'} = 1;
-
-
-# System rights are rights granted to the whole system
-# XXX TODO Can't localize these outside of having an object around.
-$RIGHTS = {
-};
-
-
-__PACKAGE__->AddRights(%$RIGHTS);
-
-=head2 AddRights C<RIGHT>, C<DESCRIPTION> [, ...]
-
-Adds the given rights to the list of possible rights.  This method
-should be called during server startup, not at runtime.
-
-=cut
-
-sub AddRights {
-    my $self = shift if ref $_[0] or $_[0] eq __PACKAGE__;
-    my %new = @_;
-    $RIGHTS = { %$RIGHTS, %new };
-    %RT::ACE::LOWERCASERIGHTNAMES = ( %RT::ACE::LOWERCASERIGHTNAMES,
-                                      map { lc($_) => $_ } keys %new);
-}
-
-=head2 AvailableRights
-
-Returns a hash of available rights for this object. The keys are the right names and the values are a description of what the rights do
-
-=cut
-
-sub AvailableRights {
-    my $self = shift;
-    my $class = RT::FM::Class->new($RT::SystemUser);
-    my $classrights = $class->AvailableRights();
-    my $CustomField = RT::CustomField->new($RT::SystemUser);
-    my $cfrights = $CustomField->AvailableRights();
-    my %rights = (%{$RIGHTS}, %{$cfrights}, %{$classrights});
-    
-    return(\%rights);
-}
-
-
-=head2 new
-
-Create a new RT::FM::System object. Really, you should be using $RT::FM::System
-
-=cut
-
-                         
-sub new {
-    my $proto = shift;
-    my $class = ref($proto) || $proto;
-    my $self  = {};
-    bless( $self, $class );
-
-
-    return ($self);
-}
-
-=head2 id
-
-Returns RT::FM::System's id. It's 1. 
-
-
-=cut
-
-*Id = \&id;
-
-sub id {
-    return (1);
-}
-
-=head2 Load
-
-for compatibility. dummy method
-
-=cut
-
-sub Load {
-    return(1);
-}
-
-=head2 ACLEquivalenceObjects
-
-There are no rights granted globally from other objects
-
-=cut
-
-sub ACLEquivalenceObjects { } 
-
-1;
diff --git a/share/html/SelfService/Article/autohandler b/share/html/SelfService/Article/autohandler
index c5ba65e..c590a67 100755
--- a/share/html/SelfService/Article/autohandler
+++ b/share/html/SelfService/Article/autohandler
@@ -47,7 +47,7 @@
 <%INIT>
 
 if ( $session{'CurrentUser'}->HasRight( Right => 'ShowArticle',
-                   Object => $RT::FM::System )) {
+                   Object => $RT::System )) {
     $m->comp( { base_comp => $m->request_comp }, $m->fetch_next, %ARGS);    
 }
 else {
diff --git a/t/articles/04interface.t b/t/articles/04interface.t
index 950f95c..33361d8 100644
--- a/t/articles/04interface.t
+++ b/t/articles/04interface.t
@@ -63,8 +63,8 @@ ok($ret, "Topic 2 created");
 ok($ret, "Topic Class2 created");
 ($ret, $msg) = $gtopic->Create('Parent' => 0,
 			      'Name' => 'tlaTestTopicGlobal-'.$$,
-			      'ObjectType' => 'RT::FM::System',
-			      'ObjectId' => $RT::FM::System->Id );
+			      'ObjectType' => 'RT::System',
+			      'ObjectId' => $RT::System->Id );
 ok($ret, "Global Topic created");
 
 # Create some article custom fields
diff --git a/t/articles/2basic_api.t b/t/articles/2basic_api.t
index 490ceb1..88136d6 100644
--- a/t/articles/2basic_api.t
+++ b/t/articles/2basic_api.t
@@ -3,12 +3,7 @@
 use warnings;
 use strict;
 
-use RT::Test tests => 43;
-
-use_ok 'RT::FM::System';
-my $sys = new RT::FM::System;
-isa_ok $sys, 'RT::FM::System';
-is $sys->Id, 1;
+use RT::Test tests => 40;
 
 use_ok('RT::FM::Class');
 
diff --git a/t/articles/Class_Overlay.pm.t b/t/articles/Class_Overlay.pm.t
index 1f0bdeb..9ce5bd3 100644
--- a/t/articles/Class_Overlay.pm.t
+++ b/t/articles/Class_Overlay.pm.t
@@ -10,7 +10,7 @@ use_ok 'RT::FM::ClassCollection';
 use_ok 'RT::FM::Class';
 
 $RT::SystemUser || die ;# just shut up the warning
-$RT::FM::System || die; # just shut up the warning;
+$RT::System     || die; # just shut up the warning;
 
 
 my $root = RT::CurrentUser->new('root');
@@ -54,7 +54,7 @@ ok (UNIVERSAL::isa($cl, 'RT::FM::Class'), "the new class is a class");
 
 
 ok (!$id, $msg. "- Can not create classes as a random new user - " .$u->Id);
-$u->PrincipalObj->GrantRight(Right =>'AdminClass', Object => $RT::FM::System);
+$u->PrincipalObj->GrantRight(Right =>'AdminClass', Object => $RT::System);
 ($id, $msg) = $cl->Create(Name => 'Test-nobody-'.$$, Description => 'A test class');
 
 ok ($id, $msg. "- Can create classes as a random new user after ACL grant");

-----------------------------------------------------------------------


More information about the Rt-commit mailing list