Skip to content

Commit

Permalink
These methods are depreciated in V3 of the API
Browse files Browse the repository at this point in the history
We can leave them around, but they need to be removed when v2 support is
dropped.
  • Loading branch information
catsby committed Feb 12, 2012
1 parent e78ab5e commit 5033580
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions lib/octokit/client/objects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,24 @@ def blob(repo, tree_sha, path, options={})
get("/api/v2/json/blob/show/#{Repository.new(repo)}/#{tree_sha}/#{path}", options)['blob']
end

# Depreciated
def blobs(repo, tree_sha, options={})
get("/api/v2/json/blob/all/#{Repository.new(repo)}/#{tree_sha}", options)['blobs']
get("/api/v2/json/blob/all/#{Repository.new(repo)}/#{tree_sha}", options, 2)['blobs']
end

# Depreciated
def blob_metadata(repo, tree_sha, options={})
get("/api/v2/json/blob/full/#{Repository.new(repo)}/#{tree_sha}", options)['blobs']
get("/api/v2/json/blob/full/#{Repository.new(repo)}/#{tree_sha}", options, 2)['blobs']
end
alias :blob_meta :blob_metadata

# Depreciated
def tree_metadata(repo, tree_sha, options={})
get("/api/v2/json/tree/full/#{Repository.new(repo)}/#{tree_sha}", options)['tree']
get("/api/v2/json/tree/full/#{Repository.new(repo)}/#{tree_sha}", options, 2)['tree']
end
alias :tree_meta :tree_metadata

# Depreciated
def raw(repo, sha, options={})
get("/api/v2/json/blob/show/#{Repository.new(repo)}/#{sha}", options, 2, true, true).body
end
Expand Down
2 changes: 1 addition & 1 deletion lib/octokit/client/organizations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def organizations(user=nil, options={})

def organization_repositories(org=nil, options={})
if org.nil?
# This is no longer supported in API v3
# Depreciated
get("/api/v2/json/organizations/repositories", options, 2)
else
get("orgs/#{org}/repos", options, 3)
Expand Down
2 changes: 1 addition & 1 deletion lib/octokit/client/repositories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Octokit
class Client
module Repositories
def search_repositories(q, options={})
# depreciated in v3
# Depreciated
get("/api/v2/json/repos/search/#{q}", options, 2)['repositories']
end
alias :search_repos :search_repositories
Expand Down
2 changes: 1 addition & 1 deletion lib/octokit/client/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Octokit
class Client
module Users
EMAIL_RE = /[\w.!#\$%+-]+@[\w-]+(?:\.[\w-]+)+/
# V3 of the API does not allow searching users
# Depreciated: V3 of the API does not allow searching users
def search_users(search, options={})
if search.match(EMAIL_RE)
get("/api/v2/json/user/email/#{search}", options, 2)['user']
Expand Down

0 comments on commit 5033580

Please sign in to comment.