Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/wibrfake/String/string.rb
Direct Known Subclasses
Instance Method Summary collapse
- #br_colorize(input) ⇒ Object
- #print_blue(input, show = 0) ⇒ Object
- #print_blue_suave(input, show = 0) ⇒ Object
- #print_green(input, show = 0) ⇒ Object
- #print_morado(input, show = 0) ⇒ Object
- #print_red(input, show = 0) ⇒ Object
-
#print_white(input, show = 0) ⇒ Object
Print text string.
- #print_yellow(input, show = 0) ⇒ Object
- #puts_black(input, show = 0) ⇒ Object
- #puts_blue(input, show = 0) ⇒ Object
- #puts_blue_suave(input, show = 0) ⇒ Object
- #puts_green(input, show = 0) ⇒ Object
- #puts_morado(input, show = 0) ⇒ Object
- #puts_red(input, show = 0) ⇒ Object
-
#puts_spin(input) ⇒ Object
Define animations.
-
#puts_white(input, show = 0) ⇒ Object
Puts text string.
- #puts_yellow(input, show = 0) ⇒ Object
Instance Method Details
#br_colorize(input) ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/wibrfake/String/string.rb', line 79 def br_colorize(input) for i in input.chars if i == "░" i = "\033[38;5;196m#{i}\e[0m" elsif i == "▒" i = "\033[38;5;124m#{i}\e[0m" elsif i == "▓" i = "\033[38;5;124m#{i}\e[0m" else i = "\033[38;5;236m#{i}\e[0m" end print i end end |
#print_blue(input, show = 0) ⇒ Object
64 65 66 67 |
# File 'lib/wibrfake/String/string.rb', line 64 def print_blue(input, show = 0) return "\e[1;34m#{input}\e[0m" if show == 0 print "\e[1;34m#{input}\e[0m" end |
#print_blue_suave(input, show = 0) ⇒ Object
69 70 71 72 |
# File 'lib/wibrfake/String/string.rb', line 69 def print_blue_suave(input, show = 0) return "\e[1;36m#{input}\e[0m" if show == 0 print "\e[1;36m#{input}\e[0m" end |
#print_green(input, show = 0) ⇒ Object
54 55 56 57 |
# File 'lib/wibrfake/String/string.rb', line 54 def print_green(input, show = 0) return "\033[38;5;46m#{input}\e[0m" if show == 0 print "\033[38;5;46m#{input}\e[0m" end |
#print_morado(input, show = 0) ⇒ Object
74 75 76 77 |
# File 'lib/wibrfake/String/string.rb', line 74 def print_morado(input, show = 0) return "\e[1;35m#{input}\e[0m" if show == 0 print "\e[1;35m#{input}\e[0m" end |
#print_red(input, show = 0) ⇒ Object
49 50 51 52 |
# File 'lib/wibrfake/String/string.rb', line 49 def print_red(input, show = 0) return "\033[38;5;196m#{input}\e[0m" if show == 0 print "\033[38;5;196m#{input}\e[0m" end |
#print_white(input, show = 0) ⇒ Object
Print text string
44 45 46 47 |
# File 'lib/wibrfake/String/string.rb', line 44 def print_white(input, show = 0) return "\e[1;37m#{input}\e[0m" if show == 0 print "\e[1;37m#{input}\e[0m" end |
#print_yellow(input, show = 0) ⇒ Object
59 60 61 62 |
# File 'lib/wibrfake/String/string.rb', line 59 def print_yellow(input, show = 0) return "\e[1;33m#{input}\e[0m" if show == 0 print "\e[1;33m#{input}\e[0m" end |
#puts_black(input, show = 0) ⇒ Object
8 9 10 11 |
# File 'lib/wibrfake/String/string.rb', line 8 def puts_black(input, show = 0) return "\e[0m\033[38;5;236m#{input}\e[0m" if show == 0 puts "\e[0m\033[38;5;236m#{input}\e[0m" end |
#puts_blue(input, show = 0) ⇒ Object
28 29 30 31 |
# File 'lib/wibrfake/String/string.rb', line 28 def puts_blue(input, show = 0) return "\e[1;34m#{input}\e[0m" if show == 0 puts "\e[1;34m#{input}\e[0m" end |
#puts_blue_suave(input, show = 0) ⇒ Object
33 34 35 36 |
# File 'lib/wibrfake/String/string.rb', line 33 def puts_blue_suave(input, show = 0) return "\e[1;36m#{input}\e[0m" if show == 0 puts "\e[1;36m#{input}\e[0m" end |
#puts_green(input, show = 0) ⇒ Object
18 19 20 21 |
# File 'lib/wibrfake/String/string.rb', line 18 def puts_green(input, show = 0) return "\033[38;5;46m#{input}\e[0m" if show == 0 puts "\033[38;5;46m#{input}\e[0m" end |
#puts_morado(input, show = 0) ⇒ Object
38 39 40 41 |
# File 'lib/wibrfake/String/string.rb', line 38 def puts_morado(input, show = 0) return "\e[1;35m#{input}\e[0m" if show == 0 puts "\e[1;35m#{input}\e[0m" end |
#puts_red(input, show = 0) ⇒ Object
13 14 15 16 |
# File 'lib/wibrfake/String/string.rb', line 13 def puts_red(input, show = 0) return "\033[38;5;196m#{input}\e[0m" if show == 0 puts "\033[38;5;196m#{input}\e[0m" end |
#puts_spin(input) ⇒ Object
Define animations
95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/wibrfake/String/string.rb', line 95 def puts_spin(input) spin = %w[\\ | / -] count = 0 while true if count <= 40 spin.each {|line| print " #{input} [#{line}]\r" sleep(0.13) count += 1 } break if count >= 39 end end end |
#puts_white(input, show = 0) ⇒ Object
Puts text string
3 4 5 6 |
# File 'lib/wibrfake/String/string.rb', line 3 def puts_white(input, show = 0) return "\e[1;37m#{input}\e[0m" if show == 0 puts "\e[1;37m#{input}\e[0m" end |
#puts_yellow(input, show = 0) ⇒ Object
23 24 25 26 |
# File 'lib/wibrfake/String/string.rb', line 23 def puts_yellow(input, show = 0) return "\e[1;33m#{input}\e[0m" if show == 0 puts "\e[1;33m#{input}\e[0m" end |