Class: Rprompt::GitNumbers
- Inherits:
-
PromptItem
- Object
- PromptItem
- Rprompt::GitNumbers
- Defined in:
- lib/rprompt.rb
Instance Attribute Summary
Attributes inherited from PromptItem
Instance Method Summary collapse
-
#numberOfFiles ⇒ Integer
Number of files returned by a git command.
-
#show ⇒ String
Terminal representation of the number of files.
Methods inherited from PromptItem
Methods included from Deco
Constructor Details
This class inherits a constructor from Rprompt::PromptItem
Instance Method Details
#numberOfFiles ⇒ Integer
Returns number of files returned by a git command.
30 31 32 |
# File 'lib/rprompt.rb', line 30 def numberOfFiles commandResult.split(/\r?\n/).count end |
#show ⇒ String
Returns terminal representation of the number of files.
35 36 37 |
# File 'lib/rprompt.rb', line 35 def show numberOfFiles != 0 ? termShow({:color => color, :symbol => symbol, :content => numberOfFiles}) : '' end |