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.53 lib/ruco/status_bar.rb
ruco-0.0.52 lib/ruco/status_bar.rb
ruco-0.0.51 lib/ruco/status_bar.rb
ruco-0.0.50 lib/ruco/status_bar.rb
ruco-0.0.49 lib/ruco/status_bar.rb
ruco-0.0.48 lib/ruco/status_bar.rb
ruco-0.0.47 lib/ruco/status_bar.rb
ruco-0.0.46 lib/ruco/status_bar.rb
ruco-0.0.45 lib/ruco/status_bar.rb
ruco-0.0.44 lib/ruco/status_bar.rb
ruco-0.0.43 lib/ruco/status_bar.rb
ruco-0.0.42 lib/ruco/status_bar.rb
ruco-0.0.41 lib/ruco/status_bar.rb
ruco-0.0.40 lib/ruco/status_bar.rb
ruco-0.0.39 lib/ruco/status_bar.rb
ruco-0.0.38 lib/ruco/status_bar.rb
ruco-0.0.37 lib/ruco/status_bar.rb
ruco-0.0.36 lib/ruco/status_bar.rb
ruco-0.0.35 lib/ruco/status_bar.rb
ruco-0.0.34 lib/ruco/status_bar.rb