Module: Nehm::Configure

Defined in:
lib/nehm/configure.rb

Overview

Configure module responds to ‘nehm configure’ command

Class Method Summary collapse

Class Method Details



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/nehm/configure.rb', line 4

def self.menu
  loop do
    puts "Download path: #{Paint[Cfg[:dl_path], :magenta]}" if Cfg[:dl_path]
    puts "Permalink: #{Paint[Cfg[:permalink], :cyan]}" if Cfg[:permalink]
    puts "iTunes playlist: #{Paint[PlaylistManager.playlist, :cyan]}" if !OS.linux? && PlaylistManager.playlist
    puts "\n"

    HighLine.new.choose do |menu|
      menu.prompt = Paint['Choose setting', :yellow]

      menu.choice('Edit download path'.freeze) { PathManager.set_dl_path }
      menu.choice('Edit permalink'.freeze) { UserManager. }
      menu.choice('Edit iTunes playlist'.freeze) { PlaylistManager.set_playlist } unless OS.linux?
      menu.choice('Exit'.freeze) { puts 'Goodbye!'; exit }
    end
    sleep(1)
    puts "\n"
  end
end