# File lib/heroku/client/cisaurus.rb, line 7 def initialize(uri) require 'rest_client' @uri = URI.parse(uri) end
# File lib/heroku/client/cisaurus.rb, line 12 def authenticated_resource(path) host = "#{@uri.scheme}://#{@uri.host}" host += ":#{@uri.port}" if @uri.port RestClient::Resource.new("#{host}#{path}", "", Heroku::Auth.api_key) end
# File lib/heroku/client/cisaurus.rb, line 18 def copy_slug(from, to) authenticated_resource("/v1/apps/#{from}/copy/#{to}").post(json_encode("description" => "Forked from #{from}"), :content_type => :json).headers[:location] end
# File lib/heroku/client/cisaurus.rb, line 22 def job_done?(job_location) 202 != authenticated_resource(job_location).get.code end