Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Make 'status' dynamic with HEROKU_HOST
Browse files Browse the repository at this point in the history
  • Loading branch information
asenchi committed May 17, 2012
1 parent fe54493 commit 8584df1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/heroku/command/status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
#
class Heroku::Command::Status < Heroku::Command::Base



# status
#
# display current status of Heroku platform
#
def index
status = json_decode(heroku.get("https://status.heroku.com/status.json"))
heroku_host = ENV['HEROKU_HOST'] || "heroku.com"
status = json_decode(heroku.get("https://status.#{heroku_host}/status.json"))

display('')
if status.values.all? {|value| value == 'green'}
Expand All @@ -18,7 +21,7 @@ def index
status.each do |key, value|
display("#{key}: #{value}")
end
response = heroku.xml(heroku.get("https://status.heroku.com/feed"))
response = heroku.xml(heroku.get("https://status.#{heroku_host}/feed"))
entry = response.elements.to_a("//entry").first
display('')
display(entry.elements['title'].text)
Expand Down

0 comments on commit 8584df1

Please sign in to comment.