[Rt-commit] rt branch, 4.2/centralize-develmode, updated. rt-4.0.0rc6-172-g711b2d7

Alex Vandiver alexmv at bestpractical.com
Wed Aug 3 18:46:37 EDT 2011


The branch, 4.2/centralize-develmode has been updated
       via  711b2d74101d672765c4a7a5caaee9d48adbd866 (commit)
      from  5692ee78152d3d891a60ca1769a8fd45861bcc2e (commit)

Summary of changes:
 lib/RT.pm               |    2 --
 lib/RT/Interface/Web.pm |    6 ++++--
 2 files changed, 4 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit 711b2d74101d672765c4a7a5caaee9d48adbd866
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Aug 3 18:43:36 2011 -0400

    Enforce loading of Module::Refresh, whenever and however DevelMode gets set
    
    t/web/squish.t uses the RT::Test infrastructure to set DevelMode halfway
    through a test file, which walks around the standard codepaths in
    RT::LoadConfig where we tried to require Module::Refresh.  Move the
    require to just before the module is used, to ensure that it is loaded
    if necessary.  While this imposes a slight run-time penalty to each
    request, it can be safely assumed that if one is running in DevelMode,
    extra milliseconds are not a priority.

diff --git a/lib/RT.pm b/lib/RT.pm
index 662b653..c6b6668 100644
--- a/lib/RT.pm
+++ b/lib/RT.pm
@@ -125,8 +125,6 @@ sub LoadConfig {
         $gpgopts->{homedir} = File::Spec->catfile( $BasePath, $gpgopts->{homedir} );
     }
 
-    require Module::Refresh if RT->Config->Get('DevelMode');
-
     return $Config;
 }
 
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index c02166f..63d4302 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -188,8 +188,10 @@ sub WebExternalAutoInfo {
 sub HandleRequest {
     my $ARGS = shift;
 
-    Module::Refresh->refresh
-          if RT->Config->Get('DevelMode');
+    if (RT->Config->Get('DevelMode')) {
+        require Module::Refresh;
+        Module::Refresh->refresh;
+    }
 
     $HTML::Mason::Commands::r->content_type("text/html; charset=utf-8");
 

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


More information about the Rt-commit mailing list