Class: Thegarage::Gitx::Cli::ReviewCommand
- Inherits:
-
BaseCommand
- Object
- Thor
- BaseCommand
- Thegarage::Gitx::Cli::ReviewCommand
- Includes:
- Github
- Defined in:
- lib/thegarage/gitx/cli/review_command.rb
Constant Summary collapse
- BUMP_COMMENT_PREFIX =
'[gitx] review bump :tada:'
- BUMP_COMMENT_FOOTER =
<<-EOS.dedent # Bump comments should include: # * summary of what changed # # This footer will automatically be stripped from the created comment EOS
- APPROVAL_COMMENT_PREFIX =
'[gitx] review approved :shipit:'
- APPROVAL_COMMENT_FOOTER =
<<-EOS.dedent # Approval comments can include: # * feedback # * post-release follow-up items # # This footer will automatically be stripped from the created comment EOS
- REJECTION_COMMENT_PREFIX =
'[gitx] review rejected'
- REJECTION_COMMENT_FOOTER =
<<-EOS.dedent # Rejection comments should include: # * feedback for fixes required before approved # # This footer will automatically be stripped from the created comment EOS
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 inherited from BaseCommand
Methods included from Thor::Actions
Constructor Details
This class inherits a constructor from Thegarage::Gitx::Cli::BaseCommand
Instance Method Details
#review ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/thegarage/gitx/cli/review_command.rb', line 44 def review 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 |