[Bast-commits] r9730 - SQL-Abstract/1.x/trunk/lib/SQL/Abstract
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Tue Sep 21 05:11:08 GMT 2010
Author: ribasushi
Date: 2010-09-21 06:11:08 +0100 (Tue, 21 Sep 2010)
New Revision: 9730
Modified:
SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Tree.pm
Log:
Move the colordefs to the profile def
Modified: SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Tree.pm
===================================================================
--- SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Tree.pm 2010-09-16 14:45:33 UTC (rev 9729)
+++ SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Tree.pm 2010-09-21 05:11:08 UTC (rev 9730)
@@ -132,6 +132,33 @@
newline => "\n",
colormap => {},
indentmap => { %indents },
+
+ eval { require Term::ANSIColor }
+ ? do {
+ my $c = \&Term::ANSIColor::color;
+ (
+ placeholder_surround => [$c->('black on_cyan'), $c->('reset')],
+ colormap => {
+ select => [$c->('red'), $c->('reset')],
+ 'insert into' => [$c->('red'), $c->('reset')],
+ update => [$c->('red'), $c->('reset')],
+ 'delete from' => [$c->('red'), $c->('reset')],
+
+ set => [$c->('cyan'), $c->('reset')],
+ from => [$c->('cyan'), $c->('reset')],
+
+ where => [$c->('green'), $c->('reset')],
+ values => [$c->('yellow'), $c->('reset')],
+
+ join => [$c->('magenta'), $c->('reset')],
+ 'left join' => [$c->('magenta'), $c->('reset')],
+ on => [$c->('blue'), $c->('reset')],
+
+ 'group by' => [$c->('yellow'), $c->('reset')],
+ 'order by' => [$c->('yellow'), $c->('reset')],
+ }
+ );
+ } : (),
},
console_monochrome => {
fill_in_placeholders => 1,
@@ -171,33 +198,6 @@
},
);
-eval {
- require Term::ANSIColor;
-
- $profiles{console}->{placeholder_surround} =
- [Term::ANSIColor::color('black on_cyan'), Term::ANSIColor::color('reset')];
-
- $profiles{console}->{colormap} = {
- select => [Term::ANSIColor::color('red'), Term::ANSIColor::color('reset')],
- 'insert into' => [Term::ANSIColor::color('red'), Term::ANSIColor::color('reset')],
- update => [Term::ANSIColor::color('red'), Term::ANSIColor::color('reset')],
- 'delete from' => [Term::ANSIColor::color('red'), Term::ANSIColor::color('reset')],
-
- set => [Term::ANSIColor::color('cyan'), Term::ANSIColor::color('reset')],
- from => [Term::ANSIColor::color('cyan'), Term::ANSIColor::color('reset')],
-
- where => [Term::ANSIColor::color('green'), Term::ANSIColor::color('reset')],
- values => [Term::ANSIColor::color('yellow'), Term::ANSIColor::color('reset')],
-
- join => [Term::ANSIColor::color('magenta'), Term::ANSIColor::color('reset')],
- 'left join' => [Term::ANSIColor::color('magenta'), Term::ANSIColor::color('reset')],
- on => [Term::ANSIColor::color('blue'), Term::ANSIColor::color('reset')],
-
- 'group by' => [Term::ANSIColor::color('yellow'), Term::ANSIColor::color('reset')],
- 'order by' => [Term::ANSIColor::color('yellow'), Term::ANSIColor::color('reset')],
- };
-};
-
sub new {
my $class = shift;
my $args = shift || {};
More information about the Bast-commits
mailing list