Module: UniFunctions
- Included in:
- Assumption::CLI, Assumption::DataImporter, Assumption::Game
- Defined in:
- lib/assumption/concerns/uni_functions.rb
Instance Method Summary collapse
Instance Method Details
#clear_terminal ⇒ Object
3 4 5 6 |
# File 'lib/assumption/concerns/uni_functions.rb', line 3 def clear_terminal system "clear" system "cls" end |
#get_char ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/assumption/concerns/uni_functions.rb', line 38 def get_char state = `stty -g` `stty raw -echo -icanon isig` Signal.trap("INT") do # SIGINT = control-C exit end self.input = STDIN.getc.chr ensure `stty #{state}` end |
#title ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/assumption/concerns/uni_functions.rb', line 16 def title puts ' ___ _ _ ' sleep(0.1) puts ' / _ \ | | (_) ' sleep(0.1) puts '/ /_\ \___ ___ _ _ _ __ ___ _ __ | |_ _ ___ _ __ ' sleep(0.1) puts '| _ / __/ __| | | | _ ` _ \| _ \| __| |/ _ \| _ \ ' sleep(0.1) puts '| | | \__ \__ \ |_| | | | | | | |_) | |_| | (_) | | | |' sleep(0.1) puts '\_| |_/___/___/\__,_|_| |_| |_| .__/ \__|_|\___/|_| |_|' sleep(0.1) puts ' | | ' sleep(0.1) puts ' |_| ' puts "" end |
#underline ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/assumption/concerns/uni_functions.rb', line 8 def underline 50.times do print "=" sleep(0.01) end puts "\n" end |