lib/github_api/repos/contents.rb in github_api-0.7.1 vs lib/github_api/repos/contents.rb in github_api-0.7.2
- old
+ new
@@ -11,10 +11,11 @@
# = Examples
# github = Github.new
# github.repos.contents.readme 'user-name', 'repo-name'
#
def readme(user_name, repo_name, params={})
+ set :user => user_name, :repo => repo_name
normalize! params
get_request("/repos/#{user_name}/#{repo_name}/readme", params)
end
@@ -28,10 +29,11 @@
# = Examples
# github = Github.new
# github.repos.contents.get 'user-name', 'repo-name', 'path'
#
def get(user_name, repo_name, path, params={})
+ set :user => user_name, :repo => repo_name
normalize! params
get_request("/repos/#{user_name}/#{repo_name}/contents/#{path}", params)
end
alias :find :get
@@ -54,9 +56,10 @@
# github.repos.contents.archive 'user-name', 'repo-name',
# "archive_format" => "tarball",
# "ref" => "master"
#
def archive(user_name, repo_name, params={})
+ set :user => user_name, :repo => repo_name
normalize! params
archive_format = params.delete('archive_format') || 'zipball'
ref = params.delete('ref') || 'master'
get_request("/repos/#{user_name}/#{repo_name}/#{archive_format}/#{ref}", params)