RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

rake-hooks after and before hooks for each task

I just launched rake-hoos, to add and after and before hooks to each task.

Comments

Post was too long. Including trimmed:

For example in your Rakefile or task.rake:

require 'rake/hooks'
task :say_hello do
  puts "Good Morning !"
end
after :say_hello do
  puts "GoodBye"
end
after :say_hello do
  puts "Now go to bed !"
end
before :say_hello do
  puts "Hi !"
end

Now run with rake:<pre>$ rake say_hello Hi ! Good Morning ! GoodBye Now go to bed !" </pre>

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in