Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve in NotifiedTask #22

Open
rperezperez opened this issue Dec 27, 2011 · 0 comments
Open

Improve in NotifiedTask #22

rperezperez opened this issue Dec 27, 2011 · 0 comments

Comments

@rperezperez
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant