[Bps-public-commit] rt-extension-announce branch, master, updated. 1.00-14-g8b62e73

? sunnavy sunnavy at bestpractical.com
Mon Jul 20 09:45:43 EDT 2020


The branch, master has been updated
       via  8b62e73f8d6e3073dae2e6903e94590dbe2dd93b (commit)
       via  7ee30a3a7d1f15690debb3fd51444ce2cf81a61c (commit)
       via  e965fe01eac2d9841a63af4675782fbc68ea9429 (commit)
       via  29cf482a0ab1a4208dd42544941a5e9ca663cd06 (commit)
       via  3988c027f880a53e870e10404cb56a0f749a410d (commit)
      from  f97f7f95fd829ce43d7f045b1b7a90b6a1a0113e (commit)

Summary of changes:
 Changes                              |  3 +++
 META.yml                             |  4 ++--
 Makefile.PL                          |  1 +
 README                               |  8 ++++----
 inc/Module/Install/RTx.pm            | 36 ++++++++++++++++++++++++++----------
 lib/RT/Extension/Announce.pm         | 10 +++++-----
 lib/RT/Extension/Announce/Test.pm.in |  2 +-
 7 files changed, 42 insertions(+), 22 deletions(-)

- Log -----------------------------------------------------------------
commit 3988c027f880a53e870e10404cb56a0f749a410d
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Jul 20 21:31:20 2020 +0800

    Update M:I:RTx

diff --git a/META.yml b/META.yml
index ec5dd17..37e9c7a 100644
--- a/META.yml
+++ b/META.yml
@@ -27,5 +27,5 @@ resources:
   license: http://opensource.org/licenses/gpl-license.php
   repository: https://github.com/bestpractical/rt-extension-announce
 version: '1.02'
-x_module_install_rtx_version: '0.40'
+x_module_install_rtx_version: '0.42'
 x_requires_rt: 4.0.0
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 7cad529..2dd9489 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -6,9 +6,10 @@ use strict;
 use warnings;
 no warnings 'once';
 
+use Term::ANSIColor qw(:constants);
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.40';
+our $VERSION = '0.42';
 
 use FindBin;
 use File::Glob     ();
@@ -53,7 +54,7 @@ sub RTx {
         my @look = @INC;
         unshift @look, grep {defined and -d $_} @try;
         push @look, grep {defined and -d $_}
-            map { ( "$_/rt4/lib", "$_/lib/rt4", "$_/lib" ) } @prefixes;
+            map { ( "$_/rt5/lib", "$_/lib/rt5", "$_/rt4/lib", "$_/lib/rt4", "$_/lib" ) } @prefixes;
         last if eval {local @INC = @look; require RT; $RT::LocalLibPath};
 
         warn
@@ -76,6 +77,22 @@ sub RTx {
         $self->requires_rt('4.0.0');
     }
 
+    my $package = $name;
+    $package =~ s/-/::/g;
+    if ( $RT::CORED_PLUGINS{$package} ) {
+        my ($base_version) = $RT::VERSION =~ /(\d+\.\d+\.\d+)/;
+        die RED, <<"EOT";
+
+**** Error: Your installed version of RT ($RT::VERSION) already
+            contains this extension in core, so you don't need to
+            install it.
+
+            Check https://docs.bestpractical.com/rt/$base_version/RT_Config.html
+            to configure it.
+
+EOT
+    }
+
     # Installation locations
     my %path;
     my $plugin_path;
@@ -223,7 +240,7 @@ sub requires_rt {
     my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
 
     if ($sorted[-1] eq $version) {
-        die <<"EOT";
+        die RED, <<"EOT";
 
 **** Error: This extension requires RT $version. Your installed version
             of RT ($RT::VERSION) is too old.
@@ -249,12 +266,12 @@ sub requires_rt_plugin {
         unshift @INC, $path;
     } else {
         my $name = $self->name;
-        warn <<"EOT";
+        my $msg = <<"EOT";
 
 **** Warning: $name requires that the $plugin plugin be installed and
               enabled; it does not appear to be installed.
-
 EOT
+        warn RED, $msg, RESET, "\n";
     }
     $self->requires(@_);
 }
@@ -264,9 +281,8 @@ sub rt_too_new {
     my $name = $self->name;
     $msg ||= <<EOT;
 
-**** Error: Your installed version of RT (%s) is too new; this extension
-            only works with versions older than %s.
-
+**** Warning: Your installed version of RT (%s) is too new; this extension
+              has not been tested on your version of RT and may not work as expected.
 EOT
     $self->add_metadata("x_rt_too_new", $version) if $self->is_admin;
 
@@ -274,7 +290,7 @@ EOT
     my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
 
     if ($sorted[0] eq $version) {
-        die sprintf($msg,$RT::VERSION,$version);
+        warn RED, sprintf($msg,$RT::VERSION), RESET, "\n";
     }
 }
 
@@ -297,4 +313,4 @@ sub _load_rt_handle {
 
 __END__
 
-#line 468
+#line 484

commit 29cf482a0ab1a4208dd42544941a5e9ca663cd06
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Jul 20 21:31:56 2020 +0800

    Update copyright year to 2020

diff --git a/README b/README
index afddb1c..b192ce1 100644
--- a/README
+++ b/README
@@ -138,7 +138,7 @@ BUGS
         L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-Announce>.
 
 LICENSE AND COPYRIGHT
-    This software is Copyright (c) 2012-2019 by Best Practical Solutions,
+    This software is Copyright (c) 2012-2020 by Best Practical Solutions,
     LLC
 
     This is free software, licensed under:
diff --git a/lib/RT/Extension/Announce.pm b/lib/RT/Extension/Announce.pm
index 17350f5..5e71a2f 100644
--- a/lib/RT/Extension/Announce.pm
+++ b/lib/RT/Extension/Announce.pm
@@ -247,7 +247,7 @@ or via the web at
 
 =head1 LICENSE AND COPYRIGHT
 
-This software is Copyright (c) 2012-2019 by Best Practical Solutions, LLC
+This software is Copyright (c) 2012-2020 by Best Practical Solutions, LLC
 
 This is free software, licensed under:
 

commit e965fe01eac2d9841a63af4675782fbc68ea9429
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Jul 20 21:34:09 2020 +0800

    Update docs and default path for RT 5

diff --git a/README b/README
index b192ce1..3c34bcd 100644
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ NAME
     RT-Extension-Announce - Display announcements as a banner on RT pages.
 
 RT VERSION
-    Works with RT 4.0, 4.2 and 4.4.
+    Works with RT 4.0, 4.2, 4.4, 5.0.
 
 INSTALLATION
     perl Makefile.PL
@@ -10,7 +10,7 @@ INSTALLATION
     make install
         May need root permissions
 
-    Edit your /opt/rt4/etc/RT_SiteConfig.pm
+    Edit your /opt/rt5/etc/RT_SiteConfig.pm
         If you are using RT 4.2 or greater, add this line:
 
             Plugin('RT::Extension::Announce');
@@ -37,7 +37,7 @@ INSTALLATION
         in case changes need to be made to your database.
 
     Clear your mason cache
-            rm -rf /opt/rt4/var/mason_data/obj
+            rm -rf /opt/rt5/var/mason_data/obj
 
     Restart your webserver
 
diff --git a/lib/RT/Extension/Announce.pm b/lib/RT/Extension/Announce.pm
index 5e71a2f..020b375 100644
--- a/lib/RT/Extension/Announce.pm
+++ b/lib/RT/Extension/Announce.pm
@@ -90,7 +90,7 @@ RT-Extension-Announce - Display announcements as a banner on RT pages.
 
 =head1 RT VERSION
 
-Works with RT 4.0, 4.2 and 4.4.
+Works with RT 4.0, 4.2, 4.4, 5.0.
 
 =head1 INSTALLATION
 
@@ -104,7 +104,7 @@ Works with RT 4.0, 4.2 and 4.4.
 
 May need root permissions
 
-=item Edit your F</opt/rt4/etc/RT_SiteConfig.pm>
+=item Edit your F</opt/rt5/etc/RT_SiteConfig.pm>
 
 If you are using RT 4.2 or greater, add this line:
 
@@ -134,7 +134,7 @@ in case changes need to be made to your database.
 
 =item Clear your mason cache
 
-    rm -rf /opt/rt4/var/mason_data/obj
+    rm -rf /opt/rt5/var/mason_data/obj
 
 =item Restart your webserver
 
diff --git a/lib/RT/Extension/Announce/Test.pm.in b/lib/RT/Extension/Announce/Test.pm.in
index c0b8d14..b730822 100644
--- a/lib/RT/Extension/Announce/Test.pm.in
+++ b/lib/RT/Extension/Announce/Test.pm.in
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 
 ### after: use lib qw(@RT_LIB_PATH@);
-use lib qw(/opt/rt4/local/lib /opt/rt4/lib);
+use lib qw(/opt/rt5/local/lib /opt/rt5/lib);
 
 package RT::Extension::Announce::Test;
 

commit 7ee30a3a7d1f15690debb3fd51444ce2cf81a61c
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Jul 20 21:35:31 2020 +0800

    Add "." to @INC for perl 5.26+

diff --git a/Makefile.PL b/Makefile.PL
index 52c7822..f7c09a3 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,3 +1,4 @@
+use lib '.';
 use inc::Module::Install;
 
 RTx 'RT-Extension-Announce';

commit 8b62e73f8d6e3073dae2e6903e94590dbe2dd93b
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Jul 20 21:35:44 2020 +0800

    Prep 1.03

diff --git a/Changes b/Changes
index 5448487..de53368 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for RT-Extension-Announce
 
+1.03 2020-07-20
+ - Add RT 5 support
+
 1.02 2019-09-30
  - Allow HTML content as announce banner
 
diff --git a/META.yml b/META.yml
index 37e9c7a..e2f52aa 100644
--- a/META.yml
+++ b/META.yml
@@ -26,6 +26,6 @@ requires:
 resources:
   license: http://opensource.org/licenses/gpl-license.php
   repository: https://github.com/bestpractical/rt-extension-announce
-version: '1.02'
+version: '1.03'
 x_module_install_rtx_version: '0.42'
 x_requires_rt: 4.0.0
diff --git a/lib/RT/Extension/Announce.pm b/lib/RT/Extension/Announce.pm
index 020b375..1db4b04 100644
--- a/lib/RT/Extension/Announce.pm
+++ b/lib/RT/Extension/Announce.pm
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 package RT::Extension::Announce;
 
-our $VERSION = '1.02';
+our $VERSION = '1.03';
 
 RT->AddJavaScript('announce.js');
 RT->AddStyleSheets('announce.css');

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


More information about the Bps-public-commit mailing list