[Bps-public-commit] rt-extension-admin-conditions-and-actions branch, master, updated. f316398e41e94c69f73d5bc13eef9628b3226bce

Kevin Falcone falcone at bestpractical.com
Fri Apr 4 10:52:25 EDT 2014


The branch, master has been updated
       via  f316398e41e94c69f73d5bc13eef9628b3226bce (commit)
       via  bbc6ce5b8f38a88ae5a6422724d3b893c825593f (commit)
       via  1b62a7f7662272f9a689a2ce634a4aa8c1337c23 (commit)
      from  da50b8937e494bc7402c97779e06658686b9f613 (commit)

Summary of changes:
 README                                        | 14 ++++--
 inc/Module/Install/RTx.pm                     | 64 +++++++++++++++------------
 lib/RT/Extension/AdminConditionsAndActions.pm | 13 ++++--
 3 files changed, 56 insertions(+), 35 deletions(-)

- Log -----------------------------------------------------------------
commit 1b62a7f7662272f9a689a2ce634a4aa8c1337c23
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Apr 4 10:49:25 2014 -0400

    Upgrade Module::Install::RTx

diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index ac04c79..00cf565 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -8,7 +8,7 @@ no warnings 'once';
 
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.32';
+our $VERSION = '0.33';
 
 use FindBin;
 use File::Glob     ();
@@ -136,7 +136,9 @@ install ::
         $has_etc{acl}++;
     }
     if ( -e 'etc/initialdata' ) { $has_etc{initialdata}++; }
-    if ( -d 'etc/upgrade/' )    { $has_etc{upgrade}++; }
+    if ( grep { /\d+\.\d+\.\d+.*$/ } glob('etc/upgrade/*.*.*') ) {
+        $has_etc{upgrade}++;
+    }
 
     $self->postamble("$postamble\n");
     unless ( $subdirs{'lib'} ) {
@@ -174,46 +176,50 @@ install ::
     }
 }
 
-# stolen from RT::Handle so we work on 3.6 (cmp_versions came in with 3.8)
-{ my %word = (
-    a     => -4,
-    alpha => -4,
-    b     => -3,
-    beta  => -3,
-    pre   => -2,
-    rc    => -1,
-    head  => 9999,
-);
-sub cmp_version($$) {
-    my ($a, $b) = (@_);
-    my @a = grep defined, map { /^[0-9]+$/? $_ : /^[a-zA-Z]+$/? $word{$_}|| -10 : undef }
-        split /([^0-9]+)/, $a;
-    my @b = grep defined, map { /^[0-9]+$/? $_ : /^[a-zA-Z]+$/? $word{$_}|| -10 : undef }
-        split /([^0-9]+)/, $b;
-    @a > @b
-        ? push @b, (0) x (@a- at b)
-        : push @a, (0) x (@b- at a);
-    for ( my $i = 0; $i < @a; $i++ ) {
-        return $a[$i] <=> $b[$i] if $a[$i] <=> $b[$i];
-    }
-    return 0;
-}}
 sub requires_rt {
     my ($self,$version) = @_;
 
     # if we're exactly the same version as what we want, silently return
     return if ($version eq $RT::VERSION);
 
-    my @sorted = sort cmp_version $version,$RT::VERSION;
+    _load_rt_handle();
+    my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
 
     if ($sorted[-1] eq $version) {
         # should we die?
-        warn "\nWarning: prerequisite RT $version not found. Your installed version of RT ($RT::VERSION) is too old.\n\n";
+        die "\nWarning: prerequisite RT $version not found. Your installed version of RT ($RT::VERSION) is too old.\n\n";
+    }
+}
+
+sub rt_too_new {
+    my ($self,$version,$msg) = @_;
+    $msg ||= "Your version %s is too new, this extension requires a release of RT older than %s\n";
+
+    _load_rt_handle();
+    my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
+
+    if ($sorted[0] eq $version) {
+        die sprintf($msg,$RT::VERSION,$version);
+    }
+}
+
+# RT::Handle runs FinalizeDatabaseType which calls RT->Config->Get
+# On 3.8, this dies.  On 4.0/4.2 ->Config transparently runs LoadConfig.
+# LoadConfig requires being able to read RT_SiteConfig.pm (root) so we'd
+# like to avoid pushing that on users.
+# Fake up just enough Config to let FinalizeDatabaseType finish, and
+# anyone later calling LoadConfig will overwrite our shenanigans.
+sub _load_rt_handle {
+    unless ($RT::Config) {
+        require RT::Config;
+        $RT::Config = RT::Config->new;
+        RT->Config->Set('DatabaseType','mysql');
     }
+    require RT::Handle;
 }
 
 1;
 
 __END__
 
-#line 336
+#line 362

commit bbc6ce5b8f38a88ae5a6422724d3b893c825593f
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Apr 4 10:49:32 2014 -0400

    Put our standard pointer to bug reporting on rt.cpan.org

diff --git a/README b/README
index 0169f87..b75f309 100644
--- a/README
+++ b/README
@@ -290,13 +290,21 @@ ADDITIONAL INFORMATION
     distribution and on the "Best Practical website"
     <http://docs.bestpractical.com>.
 
+BUGS
+    All bugs should be reported via email to
+    bug-RT-Extension-AdminConditionsAndActions at rt.cpan.org
+    <mailto:bug-RT-Extension-AdminConditionsAndActions at rt.cpan.org> or via
+    the web at rt.cpan.org
+    <http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-AdminCond
+    itionsAndActions>.
+
 AUTHOR
     sunnavy <sunnavy at bestpractical.com>
 
     Jim Brandt <jbrandt at bestpractical.com>
 
 LICENSE AND COPYRIGHT
-    Copyright 2013 Best Practical Solutions, LLC.
+    Copyright 2013,2014 Best Practical Solutions, LLC.
 
     This is free software, licensed under:
 
diff --git a/lib/RT/Extension/AdminConditionsAndActions.pm b/lib/RT/Extension/AdminConditionsAndActions.pm
index 5c8918d..8248fdb 100644
--- a/lib/RT/Extension/AdminConditionsAndActions.pm
+++ b/lib/RT/Extension/AdminConditionsAndActions.pm
@@ -373,6 +373,13 @@ the methods available from ticket and transaction objects in your RT
 distribution and on the
 L<"Best Practical website"|http://docs.bestpractical.com>.
 
+=head1 BUGS
+
+All bugs should be reported via email to
+L<bug-RT-Extension-AdminConditionsAndActions at rt.cpan.org|mailto:bug-RT-Extension-AdminConditionsAndActions at rt.cpan.org>
+or via the web at
+L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-AdminConditionsAndActions>.
+
 =head1 AUTHOR
 
 sunnavy <sunnavy at bestpractical.com>
@@ -381,7 +388,7 @@ Jim Brandt <jbrandt at bestpractical.com>
 
 =head1 LICENSE AND COPYRIGHT
 
-Copyright 2013 Best Practical Solutions, LLC.
+Copyright 2013,2014 Best Practical Solutions, LLC.
 
 This is free software, licensed under:
 

commit f316398e41e94c69f73d5bc13eef9628b3226bce
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Apr 4 10:51:23 2014 -0400

    Fix a Format URL error
    
    looks like when adding the example for Actions, we copied Conditions
    above but forgot to run s/Condition/Actions/g
    
    Reported by Blake McKeeby

diff --git a/README b/README
index b75f309..7d74f5b 100644
--- a/README
+++ b/README
@@ -32,8 +32,8 @@ INSTALLATION
                     .q{,'<a href="__WebPath__/Admin/Conditions/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
                     .q{,'__Description__','__UsedBy__},
                 Actions =>
-                    q{'<a href="__WebPath__/Admin/Conditions/Modify.html?&id=__id__">__id__</a>/TITLE:#'}
-                    .q{,'<a href="__WebPath__/Admin/Conditions/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
+                    q{'<a href="__WebPath__/Admin/Actions/Modify.html?&id=__id__">__id__</a>/TITLE:#'}
+                    .q{,'<a href="__WebPath__/Admin/Actions/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
                     .q{,'__Description__','__UsedBy__},
             );
 
diff --git a/lib/RT/Extension/AdminConditionsAndActions.pm b/lib/RT/Extension/AdminConditionsAndActions.pm
index 8248fdb..5e30e2b 100644
--- a/lib/RT/Extension/AdminConditionsAndActions.pm
+++ b/lib/RT/Extension/AdminConditionsAndActions.pm
@@ -106,8 +106,8 @@ You can customize Condition/Action list format by config C<%AdminSearchResultFor
             .q{,'<a href="__WebPath__/Admin/Conditions/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
             .q{,'__Description__','__UsedBy__},
         Actions =>
-            q{'<a href="__WebPath__/Admin/Conditions/Modify.html?&id=__id__">__id__</a>/TITLE:#'}
-            .q{,'<a href="__WebPath__/Admin/Conditions/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
+            q{'<a href="__WebPath__/Admin/Actions/Modify.html?&id=__id__">__id__</a>/TITLE:#'}
+            .q{,'<a href="__WebPath__/Admin/Actions/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
             .q{,'__Description__','__UsedBy__},
     );
 

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



More information about the Bps-public-commit mailing list