manage custom domains
domains:add DOMAIN
add a custom domain to an app
# File lib/heroku/command/domains.rb, line 27 def add domain = args.shift.downcase rescue nil fail("Usage: heroku domains:add DOMAIN") if domain.to_s.strip.empty? heroku.add_domain(app, domain) display "Added #{domain} as a custom domain name for #{app}" end
domains:clear
remove all custom domains from an app
# File lib/heroku/command/domains.rb, line 49 def clear heroku.remove_domains(app) display "Removed all domain names for #{app}" end
domains
list custom domains for an app
# File lib/heroku/command/domains.rb, line 13 def index domains = heroku.list_domains(app) if domains.empty? display "No domain names for #{app_url}" else display "Domain names for #{app_url}:" display domains.map { |d| d[:domain] }.join("\n") end end
domains:remove DOMAIN
remove a custom domain from an app
# File lib/heroku/command/domains.rb, line 38 def remove domain = args.shift.downcase rescue nil fail("Usage: heroku domains:remove DOMAIN") if domain.to_s.strip.empty? heroku.remove_domain(app, domain) display "Removed #{domain} as a custom domain name for #{app}" end
# File lib/heroku/command/domains.rb, line 55 def app_url url = heroku.info(app)[:web_url] url.to_s.gsub('http://', '').gsub(%r\/$/, '') end