pboling/exception_notification — Issue #22: Improve in NotifiedTask
Author: rpperez
Created: 2011-12-27 11:39:47+00:00
State: open

Hi,

Thanks for code, it is very useful!!

I've updated the NotifiedTask to work with options and local variables. This is the code:

class NotifiedTask < Rake::TaskLib
attr_accessor :name, :block, :options

def initialize(name, options = {}, &block)
@name = name
@block = block
@options = options
define
end

def define
if options.size == 0
task name do |t, args|
notifiable {
block.call(t, args)
}
end
else
task name, options do |t, args|
notifiable {
block.call(t, args)
}
end

end

end

end

Now, it is possible to call i.e. rake namespace:task[argsss]

Thanks,
Ramón.