Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/wibrfake/String/string.rb

Direct Known Subclasses

WibrFake::CLI

Instance Method Summary collapse

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

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

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

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

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

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 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

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