Class: Geet::Services::OpenRepo
- Inherits:
-
Object
- Object
- Geet::Services::OpenRepo
- Includes:
- Helpers::OsHelper
- Defined in:
- lib/geet/services/open_repo.rb
Overview
Open in the browser the current repository.
Constant Summary collapse
Instance Method Summary collapse
- #execute(upstream: false) ⇒ Object
-
#initialize(repository, out: $stdout, git_client: DEFAULT_GIT_CLIENT) ⇒ OpenRepo
constructor
A new instance of OpenRepo.
Methods included from Helpers::OsHelper
#execute_command, #open_file_with_default_application
Constructor Details
#initialize(repository, out: $stdout, git_client: DEFAULT_GIT_CLIENT) ⇒ OpenRepo
Returns a new instance of OpenRepo.
14 15 16 17 18 |
# File 'lib/geet/services/open_repo.rb', line 14 def initialize(repository, out: $stdout, git_client: DEFAULT_GIT_CLIENT) @repository = repository @out = out @git_client = git_client end |
Instance Method Details
#execute(upstream: false) ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/geet/services/open_repo.rb', line 20 def execute(upstream: false) = upstream ? {name: Utils::GitClient::UPSTREAM_NAME} : {} repo_url = @git_client.remote(**) repo_url = convert_repo_url_to_http_protocol(repo_url) open_file_with_default_application(repo_url) repo_url end |