Method: Hash#prettyPrint
- Defined in:
- lib/rake/extensions.rb
#prettyPrint(result, prefix) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rake/extensions.rb', line 12 def prettyPrint(result, prefix) if empty? then result.puts(prefix+'=emptyHash'); else keys.sort{ |x,y| x.to_s <=> y.to_s }.each do | aKey | aValue = self[aKey]; if aValue.respond_to?(:prettyPrint) then aValue.prettyPrint(result, prefix+'.'+aKey.to_s); else result.puts(prefix+'.'+aKey.to_s+"="+aValue.to_s); end end end end |