You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
Now, it is possible to call i.e. rake namespace:task[argsss]
Thanks,
Ramón.
The text was updated successfully, but these errors were encountered: