Class: Gitx::Cli::ReviewCommand
- Inherits:
-
BaseCommand
- Object
- Thor
- BaseCommand
- Gitx::Cli::ReviewCommand
- Includes:
- Github
- Defined in:
- lib/gitx/cli/review_command.rb
Constant Summary collapse
- BUMP_COMMENT_PREFIX =
'[gitx] review bump :tada:'- BUMP_COMMENT_FOOTER =
" # Bump comments should include:\n # * Summary of what changed\n #\n # This footer will automatically be stripped from the created comment\n".dedent
- APPROVAL_COMMENT_PREFIX =
'[gitx] review approved :shipit:'- APPROVAL_COMMENT_FOOTER =
" # Approval comments can include:\n # * Feedback\n # * Follow-up items for after release\n #\n # This footer will automatically be stripped from the created comment\n".dedent
- REJECTION_COMMENT_PREFIX =
'[gitx] review rejected'- REJECTION_COMMENT_FOOTER =
" # Rejection comments should include:\n # * Feedback\n # * Required changes before approved\n #\n # This footer will automatically be stripped from the created comment\n".dedent
Constants included from Github
Github::CLIENT_URL, Github::GLOBAL_CONFIG_FILE, Github::PULL_REQUEST_FOOTER, Github::REVIEW_CONTEXT
Instance Method Summary collapse
Methods included from Github
#ask_without_echo, #authorization_token, #branch_status, #create_authorization, #create_pull_request, #find_or_create_pull_request, #find_pull_request, #github_client, #github_client_name, #github_organization, #github_slug, #global_config, #global_config_file, #pull_request_body, #save_global_config, #update_review_status, #username
Methods included from Thor::Actions
Instance Method Details
#review(branch = nil) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/gitx/cli/review_command.rb', line 43 def review(branch = nil) fail 'Github authorization token not found' unless branch ||= current_branch.name pull_request = find_or_create_pull_request(branch) bump_pull_request(pull_request) if [:bump] approve_pull_request(pull_request) if [:approve] reject_pull_request(pull_request) if [:reject] assign_pull_request(pull_request) if [:assignee] run_cmd('open', pull_request.html_url) if [:open] end |