Sha256: 0cbe1d73c92a33d6e75de9fe4f89a640cc34a46aa4a32e196018aac86a664e92
Contents?: true
Size: 755 Bytes
Versions: 24
Compression:
Stored size: 755 Bytes
Contents
# $Id$ require 'pp' require 'stringio' namespace :bones do desc 'Show the PROJ open struct' task :debug do |t| atr = if ARGV.length == 2 t.application.top_level_tasks.pop end sio = StringIO.new sep = "\n" + ' '*27 fmt = "%23s => %s" if atr PP.pp(PROJ.send(atr.to_sym), sio, 49) sio.seek 0 val = sio.read val = val.split("\n").join(sep) puts fmt % [atr, val] else h = PROJ.instance_variable_get(:@table) h.keys.map {|k| k.to_s}.sort.each do |k| sio.truncate 0 PP.pp(h[k.to_sym], sio, 49) sio.seek 0 val = sio.read val = val.split("\n").join(sep) puts fmt % [k, val] end end end end # namespace :bones # EOF
Version data entries
24 entries across 23 versions & 11 rubygems