Sha256: ce9f5ef32117424c0b1b712ed6a29258094eee582f3e78af43d4cdf24c748515

Contents?: true

Size: 550 Bytes

Versions: 51

Compression:

Stored size: 550 Bytes

Contents

module Ruco
  class StatusBar
    def initialize(editor, options)
      @editor = editor
      @options = options
    end

    def view
      "Ruco #{Ruco::VERSION} -- #{@editor.file}#{change_indicator}#{writable_indicator}"
    end

    def format
      Curses::A_REVERSE
    end

    def change_indicator
      @editor.modified? ? '*' : ' '
    end

    def writable_indicator
      @writeable ||= begin
        writable = (not File.exist?(@editor.file) or system("test -w #{@editor.file}"))
        writable ? ' ' : '!'
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
ruco-0.0.33 lib/ruco/status_bar.rb
ruco-0.0.32 lib/ruco/status_bar.rb
ruco-0.0.31 lib/ruco/status_bar.rb
ruco-0.0.30 lib/ruco/status_bar.rb
ruco-0.0.29 lib/ruco/status_bar.rb
ruco-0.0.28 lib/ruco/status_bar.rb
ruco-0.0.27 lib/ruco/status_bar.rb
ruco-0.0.26 lib/ruco/status_bar.rb
ruco-0.0.25 lib/ruco/status_bar.rb
ruco-0.0.24 lib/ruco/status_bar.rb
ruco-0.0.23 lib/ruco/status_bar.rb
ruco-0.0.22 lib/ruco/status_bar.rb
ruco-0.0.21 lib/ruco/status_bar.rb
ruco-0.0.20 lib/ruco/status_bar.rb
ruco-0.0.19 lib/ruco/status_bar.rb
ruco-0.0.18 lib/ruco/status_bar.rb
ruco-0.0.17 lib/ruco/status_bar.rb
ruco-0.0.16 lib/ruco/status_bar.rb
ruco-0.0.15 lib/ruco/status_bar.rb
ruco-0.0.14 lib/ruco/status_bar.rb