[Bps-public-commit] Module-Install-RTx branch, master, updated. 0.32-4-g66dca36

Kevin Falcone falcone at bestpractical.com
Wed Jan 8 15:24:10 EST 2014


The branch, master has been updated
       via  66dca369a7c846abd13e4dd499f85fca2d809c69 (commit)
      from  73e645bc5071f59857b2f4c867378953d4782960 (commit)

Summary of changes:
 lib/Module/Install/RTx.pm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

- Log -----------------------------------------------------------------
commit 66dca369a7c846abd13e4dd499f85fca2d809c69
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed Jan 8 15:23:18 2014 -0500

    Provide rt_too_new
    
    This allows you to require 4.0.1 but forbid use on anything 4.2.0 or
    greater.  Useful for things like RTIR that don't run except on a
    particular release series, or RTFM where we merged it into core and want
    to stop people from installing on 4.0+

diff --git a/lib/Module/Install/RTx.pm b/lib/Module/Install/RTx.pm
index a769617..53a8962 100644
--- a/lib/Module/Install/RTx.pm
+++ b/lib/Module/Install/RTx.pm
@@ -188,6 +188,18 @@ sub requires_rt {
     }
 }
 
+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";
+
+    require RT::Handle;
+    my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
+
+    if ($sorted[0] eq $version) {
+        die sprintf($msg,$RT::VERSION,$version);
+    }
+}
+
 1;
 
 __END__

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



More information about the Bps-public-commit mailing list