Skip to content

Instantly share code, notes, and snippets.

@fidelisrafael
Created August 30, 2015 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fidelisrafael/f17371eb988d9c44ce0c to your computer and use it in GitHub Desktop.
Save fidelisrafael/f17371eb988d9c44ce0c to your computer and use it in GitHub Desktop.
Simple DSL
module MyCusthomMethods
def after(action_name, &block)
puts "(before) after action #{action_name}"
instance_eval(&block)
puts "(after) after action #{action_name}"
end
def deploy!
puts "(before) deploy!"
puts "to deploiando ein"
puts "(after) deploy!"
end
end
extend MyCusthomMethods
after :initialize do
puts "Limpando banco de dados"
# Database.cleaner(tables: [:temp_records])
deploy! do
after :deploy do
# FeddbackMailer.notify_deploy.deliver
puts "deployado esse caraio"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment