Skip to content

Commit

Permalink
Item11808: perltidy them all, so people are not accidentally impacted…
Browse files Browse the repository at this point in the history
… by the new enforced rule

git-svn-id: http://svn.foswiki.org/trunk/SyntaxHighlightingPlugin@14680 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
OlivierRaginel authored and OlivierRaginel committed May 1, 2012
1 parent ac120b8 commit 5b48ff3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 26 deletions.
10 changes: 5 additions & 5 deletions lib/Foswiki/Plugins/SyntaxHighlightingPlugin/build.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
# Build for SyntaxHighlightingPlugin
#
BEGIN {
foreach my $pc (split(/:/, $ENV{FOSWIKI_LIBS})) {
unshift @INC, $pc;
}
foreach my $pc ( split( /:/, $ENV{FOSWIKI_LIBS} ) ) {
unshift @INC, $pc;
}
}

use Foswiki::Contrib::Build;

# Create the build object
$build = new Foswiki::Contrib::Build( 'SyntaxHighlightingPlugin' );
$build = new Foswiki::Contrib::Build('SyntaxHighlightingPlugin');

# Build the target on the command line, or the default target
$build->build($build->{target});
$build->build( $build->{target} );

46 changes: 25 additions & 21 deletions tools/SyntaxHighlightingPlugin_covert.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,30 @@
use File::Find::Rule;

#my @subdirs = File::Find::Rule->directory->in( '/eis/apps/twiki/test/data/' );
my @subdirs = File::Find::Rule->directory->in( '.' );
my @subdirs = File::Find::Rule->directory->in('.');

foreach $dir (@subdirs){
next if ($dir =~ m/^_|^\.|^Trash$/);
# open dir, loop through files, open files with .txt$, search for syntax, output if found
opendir( DIR, $dir) or die "can't opendir: $!";
while( defined ( $filename = readdir ( DIR ) ) ) {
if( $filename =~ /.*\.txt$/ ) {
#print $filename . "\n" if $filename =~ /Syntax/;
open INFILE, "<", "$dir/$filename" or print "$! $filename\n";
my $file;
while( <INFILE> ) {
$file .= $_;
}
close INFILE;
$file =~ s/^\%begin( numbered)?(?:\:(\d+))? ([^%]*?)%\n(.*?)^\%end%$/\%CODE{\"$3\" num=\"$2\"}\%\n$4\%ENDCODE\%/mgos;
#$file =~ s/^%begin( numbered)?(?:\:(\d+))? ([^%]*?)%\n(.*?)^%end%$/%CODE{\"$3\" num=\"$2\"}%code%ENDCODE%/mgos
open OUTFILE, ">", "$dir/$filename" or print "$! $filename\n";
print OUTFILE $file;
close OUTFILE;
}
}
foreach $dir (@subdirs) {
next if ( $dir =~ m/^_|^\.|^Trash$/ );

# open dir, loop through files, open files with .txt$, search for syntax, output if found
opendir( DIR, $dir ) or die "can't opendir: $!";
while ( defined( $filename = readdir(DIR) ) ) {
if ( $filename =~ /.*\.txt$/ ) {

#print $filename . "\n" if $filename =~ /Syntax/;
open INFILE, "<", "$dir/$filename" or print "$! $filename\n";
my $file;
while (<INFILE>) {
$file .= $_;
}
close INFILE;
$file =~
s/^\%begin( numbered)?(?:\:(\d+))? ([^%]*?)%\n(.*?)^\%end%$/\%CODE{\"$3\" num=\"$2\"}\%\n$4\%ENDCODE\%/mgos;

#$file =~ s/^%begin( numbered)?(?:\:(\d+))? ([^%]*?)%\n(.*?)^%end%$/%CODE{\"$3\" num=\"$2\"}%code%ENDCODE%/mgos
open OUTFILE, ">", "$dir/$filename" or print "$! $filename\n";
print OUTFILE $file;
close OUTFILE;
}
}
}

0 comments on commit 5b48ff3

Please sign in to comment.