corol 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/corol.rb +46 -136
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3578120dbd755f65b382746932690e5b291d9cfe
|
4
|
+
data.tar.gz: 86e57b591989c420d82f59e8636f43eed20eff66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79ae21f34851b5a84e4f15bdf8e817f3e8d20adf51776f7fdb4fedba65321c491ecd67df4ee44e69199020941269535b14da089abde1b713d8a8eb8bb4ae1fac
|
7
|
+
data.tar.gz: 94a9a6dcb56122bf7e58c5bb85e366f482fd8f79041b4620d092209f27aa1d8c7fb8dd8ce754c99dcab6e3ee5c0322c41206704d1d02e04333d531c72f40ef5c
|
data/lib/corol.rb
CHANGED
@@ -1,139 +1,49 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
47
|
-
def black
|
48
|
-
return BLACK+"#{self}"+WHITE
|
49
|
-
end
|
50
|
-
def green
|
51
|
-
return GREEN+"#{self}"+WHITE
|
52
|
-
end
|
53
|
-
def yellow
|
54
|
-
return YELLOW+"#{self}"+WHITE
|
55
|
-
end
|
56
|
-
def blue
|
57
|
-
return BLUE+"#{self}"+WHITE
|
58
|
-
end
|
59
|
-
def magenta
|
60
|
-
return MAGENTA+"#{self}"+WHITE
|
61
|
-
end
|
62
|
-
def cyan
|
63
|
-
return CYAN+"#{self}"+WHITE
|
64
|
-
end
|
65
|
-
def light_red
|
66
|
-
return LIGHT_RED+"#{self}"+WHITE
|
67
|
-
end
|
68
|
-
def light_green
|
69
|
-
return LIGHT_GREEN+"#{self}"+WHITE
|
70
|
-
end
|
71
|
-
def light_yellow
|
72
|
-
return LIGHT_YELLOW+"#{self}"+WHITE
|
73
|
-
end
|
74
|
-
def light_blue
|
75
|
-
return LIGHT_BLUE+"#{self}"+WHITE
|
76
|
-
end
|
77
|
-
def light_magenta
|
78
|
-
return LIGHT_MAGENTA+"#{self}"+WHITE
|
79
|
-
end
|
80
|
-
def light_cyan
|
81
|
-
return LIGHT_CYAN+"#{self}"+WHITE
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
module BG_Colors
|
86
|
-
def back_red
|
87
|
-
return BACK_RED+"#{self}"+WHITE
|
88
|
-
end
|
89
|
-
def back_green
|
90
|
-
return BACK_GREEN+"#{self}"+WHITE
|
91
|
-
end
|
92
|
-
def back_yellow
|
93
|
-
return BACK_YELLOW+"#{self}"+WHITE
|
94
|
-
end
|
95
|
-
def back_blue
|
96
|
-
return BACK_BLUE+"#{self}"+WHITE
|
97
|
-
end
|
98
|
-
def back_magenta
|
99
|
-
return BACK_MAGENTA+"#{self}"+WHITE
|
100
|
-
end
|
101
|
-
def back_cyan
|
102
|
-
return BACK_CYAN+"#{self}"+WHITE
|
103
|
-
end
|
104
|
-
def back_light_red
|
105
|
-
return BACK_LIG_RED+"#{self}"+WHITE
|
106
|
-
end
|
107
|
-
def back_light_green
|
108
|
-
return BACK_LIG_GREEN+"#{self}"+WHITE
|
109
|
-
end
|
110
|
-
def back_light_yellow
|
111
|
-
return BACK_LIG_YELLOW+"#{self}"+WHITE
|
112
|
-
end
|
113
|
-
def back_light_blue
|
114
|
-
return BACK_BLUE+"#{self}"+WHITE
|
115
|
-
end
|
116
|
-
def back_light_magenta
|
117
|
-
return BACK_LIG_MAGENTA+"#{self}"+WHITE
|
118
|
-
end
|
119
|
-
def back_light_cyan
|
120
|
-
return BACK_LIG_CYAN+"#{self}"+WHITE
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
module Formatting
|
125
|
-
def bold
|
126
|
-
return BOLD+"#{self}"+WHITE
|
127
|
-
end
|
128
|
-
def dim
|
129
|
-
return DIM+"#{self}"+WHITE
|
130
|
-
end
|
131
|
-
def und_line
|
132
|
-
return UND_LINE+"#{self}"+WHITE
|
133
|
-
end
|
134
|
-
def hidden
|
135
|
-
return HIDDEN+"#{self}"+WHITE
|
1
|
+
module Corol
|
2
|
+
colors = {
|
3
|
+
RED:"\e[31m",
|
4
|
+
WHITE:"\e[0m",
|
5
|
+
BLACK:"\e[30m",
|
6
|
+
GREEN:"\e[32m",
|
7
|
+
YELLOW:"\e[33m",
|
8
|
+
BLUE:"\e[34m",
|
9
|
+
MAGENTA:"\e[35m",
|
10
|
+
CYAN:"\e[36m",
|
11
|
+
LIGHT_RED:"\e[91m",
|
12
|
+
LIGHT_GREEN:"\e[92m",
|
13
|
+
LIGHT_YELLOW:"\e[93m",
|
14
|
+
LIGHT_BLUE:"\e[94m",
|
15
|
+
LIGHT_MAGENTA:"\e[95m",
|
16
|
+
LIGHT_CYAN:"\e[96m"
|
17
|
+
}
|
18
|
+
back_colors = {
|
19
|
+
BACK_RED:"\e[41m",
|
20
|
+
BACK_GREEN:"\e[42m",
|
21
|
+
BACK_YELLOW:"\e[43m",
|
22
|
+
BACK_BLUE:"\e[44m",
|
23
|
+
BACK_MAGENTA:"\e[45m",
|
24
|
+
BACK_CYAN:"\e[46m",
|
25
|
+
BACK_LIGHT_RED:"\e[101m",
|
26
|
+
BACK_LIGHT_GREEN:"\e[102m",
|
27
|
+
BACK_LIGHT_YELLOW:"\e[103m",
|
28
|
+
BACK_LIGHT_BLUE:"\e[104m",
|
29
|
+
BACK_LIGHT_MAGENTA:"\e[105m",
|
30
|
+
BACK_LIGHT_CYAN:"\e[106m"
|
31
|
+
}
|
32
|
+
formatting = {
|
33
|
+
BOLD:"\e[1m",
|
34
|
+
DIM:"\e[2m",
|
35
|
+
UND_LINE:"\e[4m",
|
36
|
+
HIDDEN:"\e[8m"
|
37
|
+
}
|
38
|
+
arr = [colors,back_colors,formatting]
|
39
|
+
|
40
|
+
arr.size.times do |l|
|
41
|
+
arr[l].keys.size.times do |i|
|
42
|
+
define_method(arr[l].keys[i].downcase) do
|
43
|
+
return arr[l].values[i]+"#{self}"+"\e[0m"
|
44
|
+
end
|
45
|
+
end
|
136
46
|
end
|
137
47
|
end
|
138
|
-
class String ; include Colors, BG_Colors,Formatting ; end # include modules to using as instance methods
|
139
48
|
|
49
|
+
class String ; include Corol ; end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: corol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Farhad
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: farhad9801@gmail.com
|