Class: Rprompt::GitBranch
- Inherits:
-
PromptItem
- Object
- PromptItem
- Rprompt::GitBranch
- Defined in:
- lib/rprompt.rb
Instance Attribute Summary
Attributes inherited from PromptItem
Instance Method Summary collapse
-
#shortBranchName ⇒ String
Branch name.
-
#show ⇒ String
Terminal representation of the branch name.
Methods inherited from PromptItem
Methods included from Deco
Constructor Details
This class inherits a constructor from Rprompt::PromptItem
Instance Method Details
#shortBranchName ⇒ String
Returns branch name.
42 43 44 |
# File 'lib/rprompt.rb', line 42 def shortBranchName commandResult.chomp.split('/').last end |
#show ⇒ String
Returns terminal representation of the branch name.
47 48 49 |
# File 'lib/rprompt.rb', line 47 def show termShow({:color => color, :symbol => symbol, :content => shortBranchName}) end |