Permalink
Browse files

Add support for creating repositories

  • Loading branch information...
halorgium committed Mar 21, 2009
1 parent 4050371 commit 985554e473f3ea7cc7a2b35bf0c345e59c2877e0
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/github-control/user.rb
View
@@ -18,6 +18,16 @@ def private_repositories
end
end
+ def add_repository(name, access)
+ @cli.scrape_post("/repositories",
+ {"repository[name]" => name,
+ "repository[description]" => "",
+ "repository[homepage]" => "",
+ "repository[public]" => (access == :public)},
+ :accept => 'text/html')
+ repo_for(name, access)
+ end
+
def repositories
json_data["user"]["repositories"].sort_by {|r| r["name"]}.map do |data|
@cli.user_for(data["owner"]).repo_for(data["name"], data["private"] ? :private : :public)

0 comments on commit 985554e

Please sign in to comment.