Class: Geet::Services::OpenPr

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
Helpers::OsHelper, Helpers::ServicesWorkflowHelper
Defined in:
lib/geet/services/open_pr.rb

Overview

Open in the browser the PR for the current branch.

Constant Summary collapse

DEFAULT_GIT_CLIENT =
Geet::Utils::GitClient.new

Instance Method Summary collapse

Methods included from Helpers::ServicesWorkflowHelper

#checked_find_branch_pr

Methods included from Helpers::OsHelper

#execute_command, #open_file_with_default_application

Constructor Details

#initialize(repository, out: $stdout, git_client: DEFAULT_GIT_CLIENT) ⇒ OpenPr

Returns a new instance of OpenPr.



25
26
27
28
29
# File 'lib/geet/services/open_pr.rb', line 25

def initialize(repository, out: $stdout, git_client: DEFAULT_GIT_CLIENT)
  @repository = repository
  @out = out
  @git_client = git_client
end

Instance Method Details

#execute(delete_branch: false, **_) ⇒ Object



37
38
39
40
41
# File 'lib/geet/services/open_pr.rb', line 37

def execute(delete_branch: false, **_)
  pr = checked_find_branch_pr
  open_file_with_default_application(pr.link)
  pr
end