Class: Rprompt::RvmGemset

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

#gemsetString

Returns gemset used.

Returns:



104
105
106
107
108
109
110
111
# File 'lib/rprompt.rb', line 104

def gemset
	text = commandResult.chomp
	if text.include?('@')
		text.match(/.+@(.+)/)[1]
	else
		''
	end
end

#showString

Returns terminal representation of the gemset used.

Returns:

  • (String)

    terminal representation of the gemset used



114
115
116
# File 'lib/rprompt.rb', line 114

def show
	!gemset.empty? ? termShow({:color => color, :symbol => symbol, :content => gemset}) : ''
end