class System
Simple User Prompts
Public Class Methods
new()
click to toggle source
# File lib/utils/prompts/system.rb, line 11 def initialize @prompt = TTY::Prompt.new end
Public Instance Methods
boot()
click to toggle source
# File lib/utils/prompts/system.rb, line 21 def boot Activity.new.boot_warning if @prompt.yes?('Would you like to boot up your work machine?') Reporter.new.timed_success('Booted Up!', 3) true else Activity.new.choose boot end end
ide_distractions()
click to toggle source
# File lib/utils/prompts/system.rb, line 53 def ide_distractions Activity.new.choose Activity.new.warning vpn_expired Notifications.new.reddit Notifications.new.warning end
ide_update()
click to toggle source
# File lib/utils/prompts/system.rb, line 47 def ide_update @prompt.warn("\nThere is an IDE update") ide_distractions until @prompt.yes?('Do you update your IDE now?') updating end
stress_vpn()
click to toggle source
# File lib/utils/prompts/system.rb, line 32 def stress_vpn Timeout.timeout(1) do vpn end rescue Timeout::Error @prompt.warn('The 2FA timed out, TYPE FASTER') vpn end
updating()
click to toggle source
# File lib/utils/prompts/system.rb, line 61 def updating puts 'Updating IDE' Terminal.new.amazing_update end
vpn()
click to toggle source
# File lib/utils/prompts/system.rb, line 15 def vpn Terminal.new.two_factor Terminal.new.r_progress(100) Reporter.new.success('Jacked into the network.') end
vpn_expired()
click to toggle source
# File lib/utils/prompts/system.rb, line 41 def vpn_expired @prompt.error("\nYou return to your machine to find your VPN session has expired!") Terminal.new.two_factor Terminal.new.r_progress(100) end