class BitBucket::Repos::Sources

Public Instance Methods

all(user_name, repo_name, sha, path)
Alias for: list
find(user_name, repo_name, sha, path)
Alias for: get
get(user_name, repo_name, sha, path) click to toggle source

Gets information about an individual file. This method returns the file's size and contents. If the file is encoded, this method returns the files encoding; Currently, Bitbucket supports only base64 encoding.

Examples

@bitbucket = BitBucket.new
@bitbucket.repos.sources.get 'user-name', 'repo-name', '6dcb09b5b57875f334f61aebed6', 'app/assets/images/logo.jpg')
# File lib/bitbucket_rest_api/repos/sources.rb, line 29
def get(user_name, repo_name, sha, path)
  _update_user_repo_params(user_name, repo_name)
  _validate_user_repo_params(user, repo) unless user? && repo?
  _validate_presence_of(sha, path)

  get_request("/1.0/repositories/#{user}/#{repo.downcase}/raw/#{sha}/#{path}")
end
Also aliased as: find
list(user_name, repo_name, sha, path) click to toggle source

Gets a list of the src in a repository.

Examples

@bitbucket = BitBucket.new
@bitbucket.repos.sources.list 'user-name', 'repo-name', '6dcb09b5b57875f334f61aebed6', 'app/contorllers/')
# File lib/bitbucket_rest_api/repos/sources.rb, line 12
def list(user_name, repo_name, sha, path)
  _update_user_repo_params(user_name, repo_name)
  _validate_user_repo_params(user, repo) unless user? && repo?
  _validate_presence_of(sha, path)

  get_request("/1.0/repositories/#{user}/#{repo.downcase}/src/#{sha}/#{path}")
end
Also aliased as: all