diff options
author | Ryan Davis <ryand@zenspider.com> | 2009-06-17 14:52:41 -0800 |
---|---|---|
committer | Ryan Davis <ryand@zenspider.com> | 2009-06-17 14:52:41 -0800 |
commit | c43d09fad2c3eba94a942a3d25a7ce5b48c504fc (patch) | |
tree | 18e36c77204945c03f560e6ab736ee2b09a54a20 | |
parent | d0595d66ce51a649d85bc97843a555b18d3d5500 (diff) | |
download | hoe-c43d09fad2c3eba94a942a3d25a7ce5b48c504fc.tar.gz |
+ Alter task descriptions to say what plugin they come from. jbarnette
[git-p4: depot-paths = "//src/hoe/dev/": change = 5062]
-rw-r--r-- | lib/hoe.rb | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -452,13 +452,24 @@ class Hoe def load_plugin_tasks bad = [] + + $plugin_max = self.class.plugins.map { |s| s.to_s.size }.max + self.class.plugins.each do |plugin| warn plugin if $DEBUG + + old_tasks = Rake::Task.tasks.dup + begin send "define_#{plugin}_tasks" rescue NoMethodError => e warn "warning: couldn't activate the #{plugin} plugin, skipping" bad << plugin + next + end + + (Rake::Task.tasks - old_tasks).each do |task| + task.plugin = plugin # "%-#{max}s" % plugin end end @@plugins -= bad @@ -549,3 +560,13 @@ class File File.read(path).sub(/\A\xEF\xBB\xBF/, '') end end + +module Rake + class Task + attr_accessor :plugin + alias :old_comment :comment + def comment + "%-#{$plugin_max}s # %s" % [plugin, old_comment] if old_comment + end + end +end |