view.rb 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. class ResgenView
  2. def green text
  3. # add some color to the prompt
  4. print " \e[32m>> #{text}\e[0m"
  5. end
  6. def yellow text
  7. print " \e[33m\e[1m >> #{text}\e[0m"
  8. end
  9. def center text
  10. columns = $stdout.winsize[1]
  11. text_length = text.length
  12. column_location = columns / 2 - text_length / 2
  13. "\e[#{column_location}G#{text}"
  14. end
  15. def prompt_position
  16. puts green("What position are you applying for?")
  17. end
  18. def prompt_company
  19. puts green("At what company?")
  20. end
  21. def prompt_url
  22. puts green("Job posting URL?")
  23. end
  24. def dir_exists
  25. puts "\e[31m\e[1m >> Hey, you may have applied here already!\nWant to continue?\n\tn to cancel; any other key to proceed.\e[0m"
  26. end
  27. def job_scrape url
  28. puts " >> Obtaining a copy of the job posting for you, one moment..\nIt may take a few seconds, depending on the speed of your internet and proximity to the remote host."
  29. if url.include? "linkedin"
  30. puts yellow("Linkedin are notorious turds about automated visits, you might want to double check your applied directory to ensure the posting was scraped properly.")
  31. end
  32. end
  33. def completion
  34. puts green("\t\e[1mYour resume has been processed!")
  35. end
  36. def active_process
  37. puts "LibreOffice is still running. Please save your work & close it; press any key to continue."
  38. end
  39. def heading text
  40. puts center("\e[42m" + text + "LY REPORT\e[0m")
  41. end
  42. def save_report
  43. print "\e[1;96mWant to save a copy of this report?\e[0m\n\ty to save; any other key to cancel: "
  44. end
  45. def report_saved here
  46. puts "\nA copy of your report was saved to: " + here
  47. end
  48. def reports_first_save
  49. puts "If you wish to modify it's desintation for future reports, modify the \"reports:\" value in config.yml"
  50. end
  51. def arg_error
  52. puts "Sorry, that argument was not recognized. Did you mean \e[1m\e[3mruby resgen week\e[23m\e[22m?"
  53. end
  54. def welcome
  55. puts "\n\e[35m\e[1mThanks for using Resgen!\e[22m\nIf you find the program useful, please share it!\n\n"
  56. puts "Since this was your first run, Resgen created config settings based on your operating system in config.yml, to save you some time."
  57. puts "\e[1mIn order for these to take effect, please restart Resgen.\e[22m\n\n"
  58. puts "Good luck in your search!\e[0m"
  59. end
  60. def name_choice
  61. puts "What's your name? Resgen will use it to make an appropriate filename for your resume:"
  62. end
  63. def missing this
  64. puts yellow("WARNING! A setting in config.yml is not correct.\n\tPlease review the issue below and fix: ")
  65. puts this + "\n\n"
  66. exit
  67. end
  68. def dependencies
  69. puts yellow("Installing Resgen's Ruby Gem dependencies...")
  70. end
  71. def os_detection_failed
  72. puts "Your operating system either cannot be detected or is not yet supported."
  73. puts "Please open a bug report and let me know: https://notabug.org/angela/resgen/issues"
  74. end
  75. end