Class: BitBucket::Repos::Changesets
- Defined in:
- lib/bitbucket_rest_api/repos/changesets.rb
Constant Summary collapse
- REQUIRED_COMMENT_PARAMS =
%w[ body changeset_id line path position ].freeze
Constants included from Validations
Constants included from Validations::Token
Validations::Token::TOKEN_REQUIRED, Validations::Token::TOKEN_REQUIRED_REGEXP
Constants included from BitBucket::Request
BitBucket::Request::METHODS, BitBucket::Request::METHODS_WITH_BODIES
Constants included from Connection
Instance Method Summary collapse
-
#get(user_name, repo_name, sha, params = {}) ⇒ Object
(also: #find)
Gets a single changeset.
-
#list(user_name, repo_name, params = {}) ⇒ Object
(also: #all)
List changesets on a repository.
Methods inherited from API
#_merge_mime_type, #_merge_user_into_params!, #_merge_user_repo_into_params!, #_update_user_repo_params, #api_methods_in, inherited, #initialize, #method_missing, #process_basic_auth, #set_api_client, #setup, #update_and_validate_user_repo_params
Methods included from Normalizer
Methods included from ParameterFilter
Methods included from AutoloadHelper
#autoload_all, #lookup_constant, #register_constant
Methods included from Validations::Required
#assert_required_keys, #assert_required_values_present, #parse_values
Methods included from Validations::Token
Methods included from Validations::Format
Methods included from Validations::Presence
#_validate_presence_of, #_validate_user_repo_params
Methods included from BitBucket::Request
#delete_request, #get_request, #patch_request, #post_request, #put_request, #request
Methods included from Connection
caching?, clear_cache, connection, default_middleware, default_options, stack
Methods included from Authorization
#authenticated?, #authentication, #basic_authed?
Constructor Details
This class inherits a constructor from BitBucket::API
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class BitBucket::API
Instance Method Details
#get(user_name, repo_name, sha, params = {}) ⇒ Object Also known as: find
Gets a single changeset
Examples
@bitbucket = BitBucket.new
@bitbucket.repos.changesets.get 'user-name', 'repo-name', '6dcb09b5b57875f334f61aebed6')
42 43 44 45 46 47 48 49 |
# File 'lib/bitbucket_rest_api/repos/changesets.rb', line 42 def get(user_name, repo_name, sha, params = {}) _update_user_repo_params(user_name, repo_name) _validate_user_repo_params(user, repo) unless user? && repo? _validate_presence_of sha normalize! params get_request("/1.0/repositories/#{user}/#{repo.downcase}/changesets/#{sha}", params) end |
#list(user_name, repo_name, params = {}) ⇒ Object Also known as: all
List changesets on a repository
Parameters
-
:limit
Optional integer. An integer representing how many changesets to return. You can specify a limit between 0 and 50. -
:start
Optional string. A hash value representing the earliest node to start with.
Examples
bitbucket = BitBucket.new
bitbucket.repos.changesets.list 'user-name', 'repo-name', :start => '...'
bitbucket.repos.changesets.list 'user-name', 'repo-name', :start => '...' { |changeset| ... }
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/bitbucket_rest_api/repos/changesets.rb', line 23 def list(user_name, repo_name, params = {}) _update_user_repo_params(user_name, repo_name) _validate_user_repo_params(user, repo) unless user? && repo? normalize! params filter! %w[limit start], params response = get_request("/1.0/repositories/#{user}/#{repo.downcase}/changesets", params) return response unless block_given? response.each { |el| yield el } end |