Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/object.rb
Instance Method Summary collapse
Instance Method Details
#is_sudo? ⇒ Boolean
3 4 5 |
# File 'lib/object.rb', line 3 def is_sudo? @sudo end |
#set_irb_prompt(conf) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/object.rb', line 11 def set_irb_prompt(conf) conf[:PROMPT][:CUSTOM] = { :PROMPT_N => "\e[1m:\e[m ", :PROMPT_I => "\e[1m#{BECOME.irb_prompt} #{is_sudo? ? " sudo ".danger : ""}>\e[m ", # high voltage :PROMPT_C => "\e[1m#{BECOME.irb_prompt} >\e[m ", :RETURN => ::VERBOSE ? "%s \n" : "\n" } conf[:PROMPT_MODE] = :CUSTOM end |
#sudo_state ⇒ Object
7 8 9 |
# File 'lib/object.rb', line 7 def sudo_state is_sudo? ? "on" : "off" end |