Permalink
Browse files

vendor routes plugin

  • Loading branch information...
1 parent 62d9736 commit 647da4d0288da83c6d3e4361c1c597c6a8949991 Noah Zoschke committed Oct 4, 2011
Showing with 22 additions and 0 deletions.
  1. +22 −0 lib/heroku/client/routes.rb
@@ -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

0 comments on commit 647da4d

Please sign in to comment.