<commit_before># CLI Controller

class BookFinder::CLI

  def call
    greeting
    main_menu_input
  end

  def greeting
    puts "    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
    puts "    +    Welcome To The Top 100 Novels of All Time          +"
    puts "    +    To List Times Magazine's Top 100 Novels => Enter 1 +"
    puts "    +    To Randomly Generate a Book => Enter 2             +"
    puts "    +    To Exit Application => Enter 3                     +"
    puts "    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
  end

  def main_menu_input
    input = gets.strip

    case input
    when "1"
      puts ""
      novels = BookFinder::Scraper.top_100_novels
      BookFinder::Book.create_from_collection(novels)
      BookFinder::Book.list_books

      puts "    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
      puts "    +   Choose a Book Number To Receive a Description       +"
      puts "    +   Or Type Any Letter To Return To The Main Menu       +"
      puts "    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
      description_menu

    when "2"
      novels = BookFinder::Scraper.top_100_novels
      BookFinder::Book.create_from_collection(novels)
      BookFinder::Book.random_book
      puts ""
      puts "    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
      puts "    +         Type 'more' For a Description                 +"
      puts "    +  Or Type 'back' To Return to the Main Menu            +"
      puts "    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
      description_menu

    when "3"

    else
      puts ""
      puts "    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
      puts "    +               Invalid Entry                           +"
      puts "    +         Enter 1 For Complete Book List                +"
      puts "    +         Enter 2 For a Random Selection                +"
      puts "    +         Enter 3 to Exit Application                   +"
      puts "    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
      main_menu_input
    end
  end

  def description_menu
    input = gets.strip.to_i

    if input.between?(1, 100)
      book = BookFinder::Book.all[input - 1]
      puts ""
      puts "+++ A brief description of '#{book.title}' by #{book.author} +++"
      puts ""
      puts BookFinder::Scraper.book_description(book.book_link)
      puts ""
      greeting
      main_menu_input
    else
      greeting
      main_menu_input
    end
  end

end<commit_msg>removed random book functionality from app. Added Book link when description is displayed<commit_after># CLI Controller

class BookFinder::CLI

  def call
    greeting
    main_menu_input
  end

  def greeting
    puts "    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
    puts "    +    Welcome To The Top 100 Novels of All Time          +"
    puts "    +    To List Times Magazine's Top 100 Novels => Enter 1 +"
    puts "    +    To Exit Application => Enter 2                     +"
    puts "    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
  end

  def main_menu_input
    input = gets.strip

    case input
    when "1"
      puts ""
      novels = BookFinder::Scraper.top_100_novels
      BookFinder::Book.create_from_collection(novels)
      BookFinder::Book.list_books

      puts ""
      puts "    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
      puts "    +   Choose a Book Number To Receive a Description       +"
      puts "    +   Or Type Any Letter To Return To The Main Menu       +"
      puts "    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
      description_menu

    when "2"

    else
      puts ""
      puts "    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
      puts "    +               Invalid Entry                           +"
      puts "    +  To List Times Magazine's Top 100 Novels => Enter 1   +"
      puts "    +         To Exit Application => Enter 2                +"
      puts "    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
      main_menu_input
    end
  end

  def description_menu
    input = gets.strip.to_i

    if input.between?(1, 100)
      book = BookFinder::Book.all[input - 1]
      puts ""
      puts "+++ A brief description of '#{book.title}' by #{book.author} +++"
      puts ""
      puts BookFinder::Scraper.book_description(book.book_link)
      puts ""
      puts "For more information on this book, please visit:"
      puts "#{book.book_link}"
      puts ""
      greeting
      main_menu_input
    else
      greeting
      main_menu_input
    end
  end
end
{'fraction_non_alphanumeric': 0.23640256959314776, 'fraction_numerical': 0.010492505353319057, 'mean_word_length': 2.0710059171597632, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1512909', 'n_tokens_mistral': 1396, 'n_tokens_neox': 1278, 'n_words': 334}