Class: Geet::Services::CommentPr
- Inherits:
-
Object
- Object
- Geet::Services::CommentPr
- Extended by:
- T::Sig
- Includes:
- Helpers::OsHelper, Helpers::ServicesWorkflowHelper
- Defined in:
- lib/geet/services/comment_pr.rb
Overview
Add a comment to the PR for the current branch.
Constant Summary collapse
Instance Method Summary collapse
- #execute(comment, open_browser: false) ⇒ Object
-
#initialize(repository, out: $stdout, git_client: DEFAULT_GIT_CLIENT) ⇒ CommentPr
constructor
A new instance of CommentPr.
Methods included from Helpers::ServicesWorkflowHelper
Methods included from Helpers::OsHelper
#execute_command, #open_file_with_default_application
Constructor Details
#initialize(repository, out: $stdout, git_client: DEFAULT_GIT_CLIENT) ⇒ CommentPr
Returns a new instance of CommentPr.
19 20 21 22 23 |
# File 'lib/geet/services/comment_pr.rb', line 19 def initialize(repository, out: $stdout, git_client: DEFAULT_GIT_CLIENT) @repository = repository @out = out @git_client = git_client end |
Instance Method Details
#execute(comment, open_browser: false) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/geet/services/comment_pr.rb', line 32 def execute(comment, open_browser: false) pr = checked_find_branch_pr pr.comment(comment) open_file_with_default_application(pr.link) if open_browser pr end |