[libcode-tidyall-perl] 62/374: process_source_or_file only needs basename
Jonas Smedegaard
js at alioth.debian.org
Sun Sep 29 22:25:49 UTC 2013
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository libcode-tidyall-perl.
commit ec8e671ce7e9ae7e83c6d23ede3906c09f7690d9
Author: Jonathan Swartz <swartz at pobox.com>
Date: Mon Jul 2 16:58:02 2012 -0700
process_source_or_file only needs basename
---
lib/Code/TidyAll.pm | 7 ++-----
lib/Code/TidyAll/Plugin.pm | 4 ++--
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/lib/Code/TidyAll.pm b/lib/Code/TidyAll.pm
index aae3434..e73731f 100644
--- a/lib/Code/TidyAll.pm
+++ b/lib/Code/TidyAll.pm
@@ -180,18 +180,15 @@ sub _process_file {
}
$new_contents = $self->prefilter->($new_contents) if $self->prefilter;
-
foreach my $plugin (@plugins) {
try {
- $new_contents = $plugin->process_source_or_file( $new_contents, $file );
+ $new_contents = $plugin->process_source_or_file( $new_contents, basename($file) );
}
catch {
$error = sprintf( "*** '%s': %s", $plugin->name, $_ );
};
- last if $error;
}
-
- $new_contents = $self->postfilter->($new_contents) if $self->postfilter;
+ $new_contents = $self->postfilter->($new_contents) if !$error && $self->postfilter;
my $was_tidied = ( $orig_contents ne $new_contents ) && !$error;
unless ( $self->quiet ) {
diff --git a/lib/Code/TidyAll/Plugin.pm b/lib/Code/TidyAll/Plugin.pm
index 8a595cf..ffdf8a1 100644
--- a/lib/Code/TidyAll/Plugin.pm
+++ b/lib/Code/TidyAll/Plugin.pm
@@ -23,13 +23,13 @@ sub new {
}
sub process_source_or_file {
- my ( $self, $source, $file ) = @_;
+ my ( $self, $source, $basename ) = @_;
if ( $self->can('process_source') ) {
return $self->process_source($source);
}
elsif ( $self->can('process_file') ) {
- my $tempfile = join( "/", tempdir_simple(), basename($file) );
+ my $tempfile = join( "/", tempdir_simple(), $basename );
write_file( $tempfile, $source );
$self->process_file($tempfile);
return read_file($tempfile);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcode-tidyall-perl.git
More information about the Pkg-perl-cvs-commits
mailing list