[Bps-public-commit] Test-Spelling branch, master, updated. 9897ed8c91201601c7df6d9c0e8e41f8f6a64505

Shawn Moore sartak at bestpractical.com
Mon Apr 25 12:40:02 EDT 2011


The branch, master has been updated
       via  9897ed8c91201601c7df6d9c0e8e41f8f6a64505 (commit)
      from  f42e47ee8a557e4b0fa372eec59562fdc61aee96 (commit)

Summary of changes:
 Changes              |    2 ++
 lib/Test/Spelling.pm |    7 ++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 9897ed8c91201601c7df6d9c0e8e41f8f6a64505
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Apr 25 12:37:53 2011 -0400

    Use a lexical for the tempfile so it's reliably cleaned up [rt.cpan.org #41586]

diff --git a/Changes b/Changes
index d05e0fd..79116f9 100644
--- a/Changes
+++ b/Changes
@@ -2,6 +2,8 @@ Revision history for Test-Spelling
 
 0.12  2011-04-25
         - Best Practical has taken over maintainership of this module
+        - Clean up temporary files more aggressively [rt.cpan.org #41586]
+          (reported by Tokuhiro Matsuno)
 
 0.11  2005-11-15
         - Some documentation fixes.
diff --git a/lib/Test/Spelling.pm b/lib/Test/Spelling.pm
index d27fbee..1556c77 100644
--- a/lib/Test/Spelling.pm
+++ b/lib/Test/Spelling.pm
@@ -22,7 +22,6 @@ our $VERSION = '0.11';
 
 my $Test        = Test::Builder->new;
 my $Spell_cmd   = 'spell';
-my $Spell_temp  = File::Temp->new->filename;
 
 sub pod_file_spelling_ok {
     my $file = shift;
@@ -34,12 +33,14 @@ sub pod_file_spelling_ok {
         return;
     }
 
+    my $scratch = File::Temp->new->filename;
+
     # save digested POD to temp file
     my $checker = Pod::Spell->new;
-    $checker->parse_from_file($file, $Spell_temp);
+    $checker->parse_from_file($file, $scratch);
 
     # run spell command and fetch output
-    open ASPELL, "$Spell_cmd < $Spell_temp|"
+    open ASPELL, "$Spell_cmd < $scratch|"
         or croak "Couldn't run spellcheck command '$Spell_cmd'";
     my @words = <ASPELL>;
     close ASPELL or die;

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



More information about the Bps-public-commit mailing list