Top Level Namespace

Defined Under Namespace

Modules: HerokuSanSanity

Instance Method Summary collapse

Instance Method Details

#check_answer(answer, name) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/heroku_san_sanity/tasks.rb', line 7

def check_answer(answer, name)
  @exec = true
  if answer.downcase != name
    raise " !    Input did not match #{name}. Aborted."
    false
  end
  true
end

#check_heroku_integrity(name) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/heroku_san_sanity/tasks.rb', line 16

def check_heroku_integrity(name)
  doc = Hpricot(open("https://status.heroku.com/"))
  incident = doc.search("li.yellow, li.red")
  if incident.size != 0
    puts ""
    puts " !    WARNING: Potentially Unstable Deploy"
    puts " !    "
    puts " !    Heroku is experiencing some issues at present as detailed"
    puts " !    on the heroku status blog http://status.heroku.com"
    puts ""
    puts " !    To continue, type \"OK\""
    puts ""
    answer = ask("> ")
    check_answer(answer.downcase, "ok")
  end
end