public
Rubygem
Description: A lightweight and flexible website management system.
Homepage: http://webby.rubyforge.org/
Clone URL: git://github.com/TwP/webby.git
adding colorization to the manifest:check task
TwP (author)
Sun Feb 03 17:28:33 -0800 2008
commit  b84fbe2a7e45bd6365fec772daea1bbd8c016cbf
tree    582ba933995b258d49858cac4339aebbb5d722d0
parent  48cfacf88d20776419a1f26c65e794d4795e1bc1
...
17
18
19
20
 
 
 
 
 
 
 
 
 
 
 
 
21
22
23
...
17
18
19
 
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
0
@@ -17,7 +17,18 @@ namespace :manifest do
0
     end
0
 
0
     File.open(fn, 'w') {|fp| fp.puts files.sort}
0
- system "#{DIFF} -du Manifest.txt #{fn}"
0
+ lines = %x(#{DIFF} -du Manifest.txt #{fn}).split("\n")
0
+ if HAVE_FACETS_ANSICODE and ENV.has_key?('TERM')
0
+ lines.map! do |line|
0
+ case line
0
+ when %r/^(-{3}|\+{3})/; nil
0
+ when %r/^@/; Console::ANSICode.blue line
0
+ when %r/^\+/; Console::ANSICode.green line
0
+ when %r/^\-/; Console::ANSICode.red line
0
+ else line end
0
+ end
0
+ end
0
+ puts lines.compact
0
     rm fn rescue nil
0
   end
0
 
...
102
103
104
105
 
106
107
108
...
102
103
104
 
105
106
107
108
0
@@ -102,7 +102,7 @@ SUDO = if WIN32 then ''
0
 RCOV = WIN32 ? 'rcov.cmd' : 'rcov'
0
 GEM = WIN32 ? 'gem.cmd' : 'gem'
0
 
0
-%w(rcov spec/rake/spectask rubyforge bones).each do |lib|
0
+%w(rcov spec/rake/spectask rubyforge bones facets/ansicode).each do |lib|
0
   begin
0
     require lib
0
     Object.instance_eval {const_set "HAVE_#{lib.tr('/','_').upcase}", true}

Comments

    No one has commented yet.