Last active
January 3, 2016 19:59
-
-
Save andrei512/8512447 to your computer and use it in GitHub Desktop.
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
class Array | |
def random_element | |
self[Random.rand(length)] | |
end | |
end | |
namespace :events do | |
desc "Do stuff every hour" | |
task every_hour: :environment do | |
habit_triggers = [ | |
"How about some tea?", | |
"Let's get active!", | |
"I wonder what's new on the internet?" | |
] | |
random_habit_trigger = habit_triggers.random_element | |
`say -v Vicki "#{random_habit_trigger}"` | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment