Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Noah Zoschke
committed
Oct 4, 2011
1 parent
62d9736
commit 647da4d
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,22 @@ | |||
class Heroku::Client | |||
def routes(app_name) | |||
json_decode(get("/apps/#{app_name}/routes").to_s) | |||
end | |||
|
|||
def routes_create(app_name, proto=nil) | |||
query = (proto.nil? ? "" : "?proto=#{proto}") | |||
json_decode(post("/apps/#{app_name}/routes#{query}").to_s) | |||
end | |||
|
|||
def route_attach(app_name, url, ps) | |||
put("/apps/#{app_name}/routes/attach", {"url" => URI.escape(url), "ps" => URI.escape(ps)}) | |||
end | |||
|
|||
def route_detach(app_name, url, ps) | |||
put("/apps/#{app_name}/routes/detach", {"url" => URI.escape(url), "ps" => URI.escape(ps)}) | |||
end | |||
|
|||
def route_destroy(app_name, url) | |||
delete("/apps/#{app_name}/routes?url=#{URI.escape(url)}", {}) | |||
end | |||
end |