Class: Ruco::StatusBar
Instance Method Summary collapse
- #change_indicator ⇒ Object
- #format ⇒ Object
-
#initialize(editor, options) ⇒ StatusBar
constructor
A new instance of StatusBar.
- #view ⇒ Object
- #writable_indicator ⇒ Object
Constructor Details
#initialize(editor, options) ⇒ StatusBar
Returns a new instance of StatusBar.
3 4 5 6 |
# File 'lib/ruco/status_bar.rb', line 3 def initialize(editor, ) @editor = editor @options = end |
Instance Method Details
#change_indicator ⇒ Object
16 17 18 |
# File 'lib/ruco/status_bar.rb', line 16 def change_indicator @editor.modified? ? '*' : ' ' end |
#format ⇒ Object
12 13 14 |
# File 'lib/ruco/status_bar.rb', line 12 def format Curses::A_REVERSE end |
#view ⇒ Object
8 9 10 |
# File 'lib/ruco/status_bar.rb', line 8 def view "Ruco #{Ruco::VERSION} -- #{@editor.file}#{change_indicator}#{writable_indicator}" end |
#writable_indicator ⇒ Object
20 21 22 23 24 25 |
# File 'lib/ruco/status_bar.rb', line 20 def writable_indicator @writeable ||= begin writable = (not File.exist?(@editor.file) or system("test -w #{@editor.file}")) writable ? ' ' : '!' end end |