Module: Rib::Anchor
- Extended by:
- Plugin
- Defined in:
- lib/rib/more/anchor.rb
Defined Under Namespace
Modules: Imp
Instance Attribute Summary
Attributes included from Plugin
Instance Method Summary collapse
- #anchor? ⇒ Boolean
-
#prompt ⇒ Object
————— Rib API —————.
Methods included from Plugin
const_missing, disable, disabled?, enable, enabled?, extended
Instance Method Details
#anchor? ⇒ Boolean
25 26 27 |
# File 'lib/rib/more/anchor.rb', line 25 def anchor? !!config[:prompt_anchor] end |
#prompt ⇒ Object
————— Rib API —————
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rib/more/anchor.rb', line 10 def prompt return super if Rib::Anchor.disabled? return super unless anchor? level = "(#{Rib.shells.size - 1})" if Rib.const_defined?(:Color) && kind_of?(Rib::Color) && Rib::Color.enabled? "#{format_color(eval_binding, prompt_anchor)}#{level}#{super}" else "#{prompt_anchor}#{level}#{super}" end end |