class Nehm::ConfigureCommand

Public Instance Methods

execute() click to toggle source
# File lib/nehm/commands/configure_command.rb, line 4
def execute
  loop do
    show_info
    UI.newline
    show_menu
    UI.sleep
  end
end
program_name() click to toggle source
# File lib/nehm/commands/configure_command.rb, line 13
def program_name
  'nehm configure'
end
summary() click to toggle source
# File lib/nehm/commands/configure_command.rb, line 17
def summary
  'Configure nehm app'
end
usage() click to toggle source
# File lib/nehm/commands/configure_command.rb, line 21
def usage
  'nehm configure'
end

Private Instance Methods

show_info() click to toggle source
# File lib/nehm/commands/configure_command.rb, line 27
def show_info
  dl_path = PathManager.default_dl_path
  UI.say "Download path: #{dl_path.magenta}" if dl_path

  permalink = UserManager.default_permalink
  UI.say "Permalink: #{permalink.cyan}" if permalink

  if OS.mac?
    playlist = PlaylistManager.default_playlist
    UI.say "iTunes playlist: #{playlist.to_s.cyan}" if playlist
  end
end
show_menu() click to toggle source
# File lib/nehm/commands/configure_command.rb, line 40
def show_menu
  UI.menu do |menu|
    menu.choice(:inc, 'Edit download path'.freeze) { PathManager.set_dl_path }
    menu.choice(:inc, 'Edit permalink'.freeze) { UserManager.set_uid }
    menu.choice(:inc, 'Edit iTunes playlist'.freeze) { PlaylistManager.set_playlist } if OS.mac?
  end
end