Skip to content
Browse files

cloud isnt a thing

  • Loading branch information...
1 parent 9c8680f commit f77693a2357a58a7c25f8610a891355357c733ba @ddollar committed
Showing with 0 additions and 65 deletions.
  1. +0 −1 init.rb
  2. +0 −64 lib/anvil/heroku/command/cloud.rb
View
1 init.rb
@@ -4,6 +4,5 @@
require "anvil/heroku/client"
require "anvil/heroku/command/build"
-require "anvil/heroku/command/cloud"
require "anvil/heroku/command/release"
require "anvil/heroku/command/start"
View
64 lib/anvil/heroku/command/cloud.rb
@@ -1,64 +0,0 @@
-require "heroku/auth"
-require "heroku/command/base"
-
-class Heroku::Auth
- class << self
- @api = nil
-
- def host
- ENV["HEROKU_HOST"] || read_heroku_host || "heroku.com"
- end
-
- def heroku_host_file
- "#{home_directory}/.heroku/host"
- end
-
- def read_heroku_host
- File.read(heroku_host_file).chomp rescue nil
- end
-
- def write_heroku_host(host)
- if host == "heroku.com"
- FileUtils.rm_f heroku_host_file
- else
- File.open(heroku_host_file, "w") { |file| file.puts host }
- end
- end
- end
-end
-
-class Heroku::Command::Cloud < Heroku::Command::Base
-
- include Heroku::Helpers
-
- # cloud CLOUD
- #
- # switch clouds
- #
- # valid clouds:
- # standard
- # shadow
- #
- def index
- cloud = shift_argument
- validate_arguments!
-
- if cloud
- action("Switching to #{cloud} cloud") do
- heroku_host = case cloud
- when "standard" then "heroku.com"
- when "shadow" then "heroku-shadow.com"
- else "#{cloud}.herokudev.com"
- end
- Heroku::Auth.write_heroku_host heroku_host
- end
- else
- puts case Heroku::Auth.host
- when "heroku.com" then "standard"
- when "heroku-shadow.com" then "shadow"
- when /^(\w+).herokudev.com/ then $1
- end
- end
- end
-
-end

0 comments on commit f77693a

Please sign in to comment.
Something went wrong with that request. Please try again.