[Bast-commits] r9728 - in SQL-Abstract/1.x/trunk: lib/SQL/Abstract t

frew at dev.catalyst.perl.org frew at dev.catalyst.perl.org
Thu Sep 16 14:44:32 GMT 2010


Author: frew
Date: 2010-09-16 15:44:32 +0100 (Thu, 16 Sep 2010)
New Revision: 9728

Modified:
   SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Tree.pm
   SQL-Abstract/1.x/trunk/t/13whitespace_keyword.t
   SQL-Abstract/1.x/trunk/t/91podcoverage.t
Log:
add a bit more doc, test doc, and rename a method

Modified: SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Tree.pm
===================================================================
--- SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Tree.pm	2010-09-14 02:40:48 UTC (rev 9727)
+++ SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Tree.pm	2010-09-16 14:44:32 UTC (rev 9728)
@@ -318,7 +318,7 @@
    'delete from' => 1,
 );
 
-sub whitespace_keyword {
+sub pad_keyword {
    my ($self, $keyword, $depth) = @_;
 
    my $before = '';
@@ -382,7 +382,7 @@
     return join (" $car ", map $self->unparse($_, $bindargs, $depth), @{$cdr});
   }
   else {
-    my ($l, $r) = @{$self->whitespace_keyword($car, $depth)};
+    my ($l, $r) = @{$self->pad_keyword($car, $depth)};
     return sprintf "$l%s %s$r", $self->format_keyword($car), $self->unparse($cdr, $bindargs, $depth);
   }
 }
@@ -469,9 +469,9 @@
 Currently this just takes a keyword and puts the C<colormap> stuff around it.
 Later on it may do more and allow for coderef based transforms.
 
-=head2 whitespace_keyword
+=head2 pad_keyword
 
- my ($before, $after) = @{$sqlat->whitespace_keyword('SELECT')};
+ my ($before, $after) = @{$sqlat->pad_keyword('SELECT')};
 
 Returns whitespace to be inserted around a keyword.
 
@@ -481,3 +481,38 @@
 
 Removes last arg from passed arrayref and returns it, surrounded with
 the values in placeholder_surround, and then surrounded with single quotes.
+
+=head2 indent
+
+Returns as many indent strings as indent amounts times the first argument.
+
+=head1 ACCESSORS
+
+=head2 colormap
+
+See L</new>
+
+=head2 fill_in_placeholders
+
+See L</new>
+
+=head2 indent_amount
+
+See L</new>
+
+=head2 indent_string
+
+See L</new>
+
+=head2 indentmap
+
+See L</new>
+
+=head2 newline
+
+See L</new>
+
+=head2 placeholder_surround
+
+See L</new>
+

Modified: SQL-Abstract/1.x/trunk/t/13whitespace_keyword.t
===================================================================
--- SQL-Abstract/1.x/trunk/t/13whitespace_keyword.t	2010-09-14 02:40:48 UTC (rev 9727)
+++ SQL-Abstract/1.x/trunk/t/13whitespace_keyword.t	2010-09-16 14:44:32 UTC (rev 9728)
@@ -20,11 +20,11 @@
 });
 
 for ( keys %{$sqlat->indentmap}) {
-   my ($l, $r) = @{$sqlat->whitespace_keyword($_, 1)};
+   my ($l, $r) = @{$sqlat->pad_keyword($_, 1)};
    is($r, ' ', "right is a space for $_");
    is($l, "\n " . ' ' x $sqlat->indentmap->{$_}, "left calculated correctly for $_" );
 }
 
-is($sqlat->whitespace_keyword('select', 0)->[0], '', 'Select gets no newline or indent for depth 0');
+is($sqlat->pad_keyword('select', 0)->[0], '', 'Select gets no newline or indent for depth 0');
 
 done_testing;

Modified: SQL-Abstract/1.x/trunk/t/91podcoverage.t
===================================================================
--- SQL-Abstract/1.x/trunk/t/91podcoverage.t	2010-09-14 02:40:48 UTC (rev 9727)
+++ SQL-Abstract/1.x/trunk/t/91podcoverage.t	2010-09-16 14:44:32 UTC (rev 9728)
@@ -28,7 +28,6 @@
         ]
     },
     'SQL::Abstract::Test' => { skip => 1 },
-    'SQL::Abstract::Tree' => { skip => 1 },
     'DBIx::Class::Storage::Debug::PrettyPrint' => { skip => 1 },
 };
 




More information about the Bast-commits mailing list