module Nehm

Constants

HELP
VERSION

Public Class Methods

start(args) click to toggle source
# File lib/nehm.rb, line 17
def self.start(args)
  begin
    init unless initialized?

    if args.empty?
      UI.say HELP
      UI.term
    end

    CommandManager.run(args)
  rescue StandardError, Timeout::Error => ex
    Nehm::UI.term "While executing nehm ... (#{ex.class})\n    #{ex}"
  rescue Interrupt
  rescue NehmExit
  end
end

Public Instance Methods

init() click to toggle source
# File lib/nehm.rb, line 54
def init
  UI.say 'Hello!'.green
  UI.say 'Before using the nehm, you should set it up:'
  Cfg.create unless Cfg.exist?

  PathManager.set_dl_path
  UI.newline

  UserManager.set_uid
  UI.newline

  if OS.mac?
    PlaylistManager.set_playlist
    UI.newline
  end

  UI.success 'Now you can use nehm!'
  UI.newline

  UI.sleep
end
initialized?() click to toggle source
# File lib/nehm.rb, line 76
def initialized?
  Cfg.exist?
end