Commits

Shlomi Fish committed b3b9be2

Remove trailing space.

Comments (0)

Files changed (8)

abc-path/Games-ABC_Path-Generator/Changes

     the RiddleObj documentation.
     - Got rid of lib/Games/ABC_Path/Generator/Constants.pm - it was no
     longer used.
+    - Add t/style-trailing-space.t .
 
 0.1.0       Sat Jul 23 21:34:59 IDT 2011
-    - Improved lib/Games/ABC_Path/Generator.pm with acknowldgements, a 
+    - Improved lib/Games/ABC_Path/Generator.pm with acknowldgements, a
     "SEE ALSO" section and a "DESCRIPTION" section.
     - Add the shuffle method to lib/Games/ABC_Path/MicrosoftRand.pm .
     - Convert the constants module to Games::ABC_Path::Solver::Constants
     to merge the common parts of Games::ABC_Path::Solver and
     Games::ABC_Path::Generator.
-    - Convert to the methods of Games::ABC_Path::Solver::Base . 
+    - Convert to the methods of Games::ABC_Path::Solver::Base .
         - Now requires Games::ABC_Path::Solver version 0.2.0.
-    
+
 0.0.1       Thu Jul 21 19:02:11 IDT 2011
     - First version, released on an unsuspecting world.
 

abc-path/Games-ABC_Path-Generator/MANIFEST

 t/pod-coverage.t
 t/pod.t
 t/riddle-obj.t
+t/style-trailing-space.t
 META.json

abc-path/Games-ABC_Path-Generator/inc/Test/Run/Builder.pm

         Test::Run::CmdLine::Iface->new(
             {
                 'test_files' => [glob("t/*.t")],
-            }   
+            }
             # 'backend_params' => $self->_get_backend_params(),
         );
 
 
 sub ACTION_tags
 {
-    return 
+    return
         system(qw(
             ctags -f tags --recurse --totals
     		--exclude=blib/** --exclude=t/lib/**

abc-path/Games-ABC_Path-Generator/lib/Games/ABC_Path/Generator.pm

 
 ABC Path puzzle games are puzzle games where one is given a 5*5 grid which
 should contain a consecutive path of the letters from 'A' to 'Y' (with vertical,
-horizontal, diagonal, or anti-diagonal steps). The position of the letter 'A' 
-is given, and two letters are given for each of the columns, rows, main 
+horizontal, diagonal, or anti-diagonal steps). The position of the letter 'A'
+is given, and two letters are given for each of the columns, rows, main
 diagonal and main anti-diagonal, which can appear anywhere there.
 
 ABC Path can be played online at L<http://www.brainbashers.com/abcpath.asp> .
 
 =head1 SUBROUTINES/METHODS
 
-=head2 my $gen = Games::ABC_Path::Generator->new({seed => $seed}); 
+=head2 my $gen = Games::ABC_Path::Generator->new({seed => $seed});
 
 Initialised a new generator with the random number generator seed $seed .
 
         my $int = pop(@connectivity_stack);
         if (!$connected{$int}++)
         {
-            push @connectivity_stack, 
-            (grep { !exists($connected{$_}) } 
+            push @connectivity_stack,
+            (grep { !exists($connected{$_}) }
                 @{ $self->_get_next_cells($l, $int) }
             );
         }
 
         if ( ( ! defined($next_idx) )
                 or
-            ($self->_get_num_connected($l) != 
+            ($self->_get_num_connected($l) !=
                 ($BOARD_SIZE - scalar(@dfs_stack))
             )
         )
 
     my $A_pos = $layout->get_A_pos;
 
-    my %init_state = (pos_taken => '', 
+    my %init_state = (pos_taken => '',
         clues =>
-        [ 
+        [
             map { +{ num_remaining => 5, } }
             (1 .. $NUM_CLUES),
         ]
 
     my $mark = sub {
         my ($state, $pos) = @_;
-        
+
         vec($state->{pos_taken}, $pos, 1) = 1;
-        
+
         my $coord = Games::ABC_Path::Generator::Coord->_from_int($pos);
 
         foreach my $clue (
                     my @cells = @{shift->{cells}};
                     return
                     [
-                        map { $layout->get_cell_contents($_) } 
+                        map { $layout->get_cell_contents($_) }
                         @{$self->_shuffle(\@cells)}
                     ];
                 };
                         A_pos => Games::ABC_Path::Generator::Coord->_from_int($A_pos),
                     }
                 );
-                
+
                 my $riddle_string = $riddle->get_riddle_v1_string();
 
-                my $solver = 
+                my $solver =
                     Games::ABC_Path::Solver::Board->input_from_v1_string(
                         $riddle_string
                     );
-                
+
                 $solver->solve();
 
                 if (@{$solver->get_successes_text_tables()} != 1)
 
             my @positions =
             (
-                grep { !vec($last_state->{pos_taken}, $_, 1) } 
+                grep { !vec($last_state->{pos_taken}, $_, 1) }
                 @{$_clues_positions[$clue_idx]}
             );
 

abc-path/Games-ABC_Path-Generator/lib/Games/ABC_Path/Generator/FinalLayoutObj.pm

 
 =head1 SUBROUTINES/METHODS
 
-=head2 my $layout = Games::ABC_Path::Generator::FinalLayoutObj->new({%args}); 
+=head2 my $layout = Games::ABC_Path::Generator::FinalLayoutObj->new({%args});
 
 Initializes a new layout. B<For internal use.>.
 
     my $render_row = sub {
         my $y = shift;
 
-        return join(" | ", 
+        return join(" | ",
             map {
-                my $x = $_; 
+                my $x = $_;
                 my $v = $l->get_cell_contents($l->_xy_to_int([$y,$x]));
             $v ? $letters[$v-1] : '*' } (0 .. $LEN - 1));
     };

abc-path/Games-ABC_Path-Generator/lib/Games/ABC_Path/Generator/RiddleObj.pm

 
 =head1 SUBROUTINES/METHODS
 
-=head2 my $riddle = Games::ABC_Path::Generator::RiddleObj->new({%args}); 
+=head2 my $riddle = Games::ABC_Path::Generator::RiddleObj->new({%args});
 
 Initialised a new riddle. Arguments are:
 
 
 =head2 my [$letter1, $letter2] = $riddle->get_letters_of_clue({ type => $type, index => $index, })
 
-Returns the two letters (as an array reference) associated with the 
+Returns the two letters (as an array reference) associated with the
 clue represented by the hash reference. Type can be:
 
 =over 4
     {
         Carp::confess ("Unknown type $type.");
     }
-    
+
     return [map { $letters[$_-1] } @{$self->_clues->[$clue_idx]}];
 }
 
     my $clues = $self->_clues();
     foreach my $clue_idx (0 .. $NUM_CLUES-1)
     {
-        my @pos = 
-            ($clue_idx == 0) ? ([0,0],[6,6]) 
+        my @pos =
+            ($clue_idx == 0) ? ([0,0],[6,6])
             : ($clue_idx == 1) ? ([0,6],[6,0])
             : ($clue_idx < (2+5)) ? ([1+$clue_idx-(2), 0], [1+$clue_idx-(2), 6])
             : ([0, 1+$clue_idx-(2+5)], [6, 1+$clue_idx-(2+5)])

abc-path/Games-ABC_Path-Generator/scripts/tag-release.pl

 
 use IO::All;
 
-my ($version) = 
-    (map { m{\$VERSION *= *'([^']+)'} ? ($1) : () } 
+my ($version) =
+    (map { m{\$VERSION *= *'([^']+)'} ? ($1) : () }
     io->file('lib/Games/ABC_Path/Generator.pm')->getlines()
     )
     ;

abc-path/Games-ABC_Path-Generator/t/style-trailing-space.t

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+eval "use Test::TrailingSpace";
+if ($@)
+{
+    plan skip_all => "Test::TrailingSpace required for trailing space test.";
+}
+else
+{
+    plan tests => 1;
+}
+
+my $finder = Test::TrailingSpace->new(
+    {
+        root => '.',
+        filename_regex => qr/(?:(?:\.(?:t|pm|pl|PL|yml|json|arc|vim))|README|Changes|LICENSE|MANIFEST)\z/,
+    },
+);
+
+# TEST
+$finder->no_trailing_space(
+    "No trailing space was found."
+);
+