Created
August 30, 2015 16:02
-
-
Save fidelisrafael/f17371eb988d9c44ce0c to your computer and use it in GitHub Desktop.
Simple DSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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