summaryrefslogtreecommitdiffhomepage
path: root/tasks/ruby_ext.rake
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-01-23 05:20:43 -0800
committerYukihiro "Matz" Matsumoto <[email protected]>2013-01-23 05:20:43 -0800
commit538bbfc15f75b9fbde553d2466d4e39c50e5785a (patch)
tree2f9596d1f9d5088a654ded7085d7ecaada6ea004 /tasks/ruby_ext.rake
parentf6195693b6e7be4acad6a2f36eb91775d76a0dbb (diff)
parent7f095534fdaad8dc6f378c1ea6c513c08a42ec01 (diff)
downloadmruby-538bbfc15f75b9fbde553d2466d4e39c50e5785a.tar.gz
mruby-538bbfc15f75b9fbde553d2466d4e39c50e5785a.zip
Merge pull request #773 from thecodeshop/ppp
Refine pretty printing
Diffstat (limited to 'tasks/ruby_ext.rake')
-rw-r--r--tasks/ruby_ext.rake8
1 files changed, 6 insertions, 2 deletions
diff --git a/tasks/ruby_ext.rake b/tasks/ruby_ext.rake
index 2536a2e4b..6817f6018 100644
--- a/tasks/ruby_ext.rake
+++ b/tasks/ruby_ext.rake
@@ -57,6 +57,10 @@ else
$pp_show = false if $verbose
end
-def _pp(msg)
- puts msg if $pp_show
+def _pp(cmd, src, tgt=nil, options={})
+ return unless $pp_show
+
+ width = 5
+ template = options[:indent] ? "%#{width*options[:indent]}s %s %s" : "%-#{width}s %s %s"
+ puts template % [cmd, src, tgt ? "-> #{tgt}" : nil]
end