class View
Public Class Methods
header()
click to toggle source
# File lib/view.rb, line 47 def self.header puts puts ('-' * @width).yellow puts 'You have some NoteAble comments in your file...'.center(@width).green puts ('-' * @width).yellow end
help()
click to toggle source
# File lib/view.rb, line 29 def self.help puts puts ('-' * @width).yellow puts 'The following commands work with NoteAble'.center(@width).green puts ('-' * @width).yellow puts <<-eos -h, --help -s, --settings Alter settings -v, --version Display version -t, --tag TAG Personalize tag message eos puts end
render_file(file)
click to toggle source
# File lib/view.rb, line 19 def self.render_file(file) puts puts ' ' * 3 + "#{file}" end
render_note(note)
click to toggle source
# File lib/view.rb, line 24 def self.render_note(note) str = ' ' * 5 + "#{note}".rjust(5) puts str.length > @width ? str.slice(0, @width - 4) + '...' : str end
render_page() { || ... }
click to toggle source
# File lib/view.rb, line 6 def self.render_page system 'clear' header puts puts puts "To open file in Sublime: '$ notable #'".center(@width).light_magenta puts yield puts puts footer end
version()
click to toggle source
# File lib/view.rb, line 43 def self.version puts 'Version: 0.0.3' end