Class: View

Inherits:
Object
  • Object
show all
Defined in:
lib/view.rb

Class Method Summary collapse

Class Method Details



54
55
56
57
58
59
# File 'lib/view.rb', line 54

def self.footer
  puts ('-' * @width).yellow
  puts 'Made with <3.. by Carolyn Phil James Aaron'.center(@width)
  puts ('-' * @width).yellow
  puts
end

.headerObject



47
48
49
50
51
52
# 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

.helpObject



29
30
31
32
33
34
35
36
37
38
39
40
41
# 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) ⇒ Object



19
20
21
22
# File 'lib/view.rb', line 19

def self.render_file(file)
  puts
  puts ' ' * 3 + "#{file}"
end

.render_note(note) ⇒ Object



24
25
26
27
# 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_pageObject



6
7
8
9
10
11
12
13
14
15
16
17
# 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

.versionObject



43
44
45
# File 'lib/view.rb', line 43

def self.version
  puts 'Version: 0.0.3'
end