Class: Loca::Git::BranchDeleter
- Inherits:
-
Object
- Object
- Loca::Git::BranchDeleter
- Defined in:
- lib/loca/git/branch_deleter.rb
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(branch) ⇒ BranchDeleter
constructor
A new instance of BranchDeleter.
Methods included from Utils
Methods included from Common
#branches, #git, #git_urls_match?, #run_git_checkers
Constructor Details
#initialize(branch) ⇒ BranchDeleter
Returns a new instance of BranchDeleter.
7 8 9 |
# File 'lib/loca/git/branch_deleter.rb', line 7 def initialize(branch) @branch = branch end |
Instance Method Details
#delete ⇒ Object
11 12 13 14 15 16 |
# File 'lib/loca/git/branch_deleter.rb', line 11 def delete run_git_checkers # Cannot delete a branch you are currently on: checkout_another_branch if @branch == current_branch git "branch -D #{@branch}" end |