Module: NoteTaker

Defined in:
lib/note_taker.rb,
lib/note_taker/version.rb

Defined Under Namespace

Classes: Error

Constant Summary collapse

HELP_TEXT =
<<~HELP.freeze
  hello [OPTION] ... DIR

  -h, --help:
    show help

  --quick, -q:
    Open note for quick editing note taker exits after

  --view, -v:
    Output contents of selected note
HELP
DEFAULT_CONFIG =
{ 'general' => { 'directory' => 'work_notes' } }.freeze
VERSION =
"0.1.2"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject (readonly)

Returns the value of attribute config.



36
37
38
# File 'lib/note_taker.rb', line 36

def config
  @config
end

.optionsObject (readonly)

Returns the value of attribute options.



36
37
38
# File 'lib/note_taker.rb', line 36

def options
  @options
end

Class Method Details

.headerObject



52
53
54
55
56
57
# File 'lib/note_taker.rb', line 52

def header
  system("clear && printf '\e[3J'")
  puts('+------------------------------------------------------------------------------+')
  puts('|                                  Note Taker                                  |')
  puts('+------------------------------------------------------------------------------+')
end

.inline?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/note_taker.rb', line 48

def inline?
  options[:inline]
end

.runObject



38
39
40
41
42
43
44
45
46
# File 'lib/note_taker.rb', line 38

def run
  fetch_options

  catch(:app_quit) { inline? ? run_inline : run_fullscreen }

  return puts("\n") if inline?

  puts("\nGoodbye\n")
end