Skip to content

Instantly share code, notes, and snippets.

@kmcphillips
Created April 14, 2016 14:28
Show Gist options
  • Save kmcphillips/d78bf7dafab622ff09b0d8837d335bea to your computer and use it in GitHub Desktop.
Save kmcphillips/d78bf7dafab622ff09b0d8837d335bea to your computer and use it in GitHub Desktop.
I'm already pro thanks
module TipOfTheDay
TIP_OF_THE_DAY_FILE = RAILS_ROOT + 'db/tip_of_the_day.txt'
WALRUS_FACT_OF_THE_DAY_FILE = RAILS_ROOT + 'db/walrus_fact_of_the_day.txt'
def self.run
return if Bootstrap.debug?
return if ENV["IM_ALRDY_PR0_AT_WALRUSES_THX"] && ENV["IM_ALREADY_PRO_THANKS"]
if ENV["IM_ALREADY_PRO_THANKS"]
read_pro_tip(WALRUS_FACT_OF_THE_DAY_FILE, "WalrusFact")
else
read_pro_tip(TIP_OF_THE_DAY_FILE, "ProTip")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment