Permalink
Browse files

Colorizing hirb table borders

  • Loading branch information...
1 parent 2b64d55 commit 6681d5305ab67bbeee854000edb2bb5a44f68f0a @halan committed Oct 9, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/irbtools/libraries.rb
View
@@ -62,6 +62,22 @@ def cd( path = File.expand_path('~') )
Hirb::View.enable
extend Hirb::Console
Hirb::View.formatter.add_view 'Object', :ancestor => true, :options => { :unicode => true } # unicode tables
+
+ #colorful
+ table_color = Wirb.schema[:class]
+ Hirb::Helpers::Table::CHARS.each do |place, group|
+ Hirb::Helpers::Table::CHARS[place] =
+ group.each do |name, part|
+ if part.kind_of? String
+ Hirb::Helpers::Table::CHARS[place][name] = Paint[part, *table_color]
+ elsif part.kind_of? Hash
+ part.each do |special, char|
+ Hirb::Helpers::Table::CHARS[place][name][special] = Paint[char, *table_color]
+ end
+ end
+ end
+ end
+
end
# command framework

0 comments on commit 6681d53

Please sign in to comment.