Class: Rprompt::GitBranch

Inherits:
PromptItem show all
Defined in:
lib/rprompt.rb

Instance Attribute Summary

Attributes inherited from PromptItem

#color, #symbol

Instance Method Summary collapse

Methods inherited from PromptItem

#commandResult, #initialize

Methods included from Deco

#termShow

Constructor Details

This class inherits a constructor from Rprompt::PromptItem

Instance Method Details

#shortBranchNameString

Returns branch name.

Returns:



42
43
44
# File 'lib/rprompt.rb', line 42

def shortBranchName
	commandResult.chomp.split('/').last
end

#showString

Returns terminal representation of the branch name.

Returns:

  • (String)

    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