sonne 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +176 -0
- data/README.md +300 -0
- data/lib/sonne.rb +282 -0
- metadata +46 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a162545c0d0bf8e075a6d428d424dc4148bccbf19333dd024a485c12d9e31209
|
4
|
+
data.tar.gz: e19ad442a0130f758ee7663a008065d3250d82d139ff581467e29a34fdd394ff
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 46e7a3fef99255209cce6a5abab1cebb391ff786c89f5941bcc7096a18a8b215d92011c74279c907013f4e1ccae102ccecfc6ee5b1244d3d223452011c21f88d
|
7
|
+
data.tar.gz: 83aa441ac5fb86a68a1789d62477c92519b63f269fdf6da7d03268a2fadd06242754d884db44bb545571e7ab11c4c6ace6327d013596b5c430e7ac8f4d85164a
|
data/LICENSE
ADDED
@@ -0,0 +1,176 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
data/README.md
ADDED
@@ -0,0 +1,300 @@
|
|
1
|
+
![Logo](https://raw.githubusercontent.com/sonnelib/sonne.rb/main/logo.png)
|
2
|
+
|
3
|
+
# Sonne.rb
|
4
|
+
|
5
|
+
**Sonne.rb**: Ruby port of Sonne.
|
6
|
+
|
7
|
+
![Features](https://raw.githubusercontent.com/sonnelib/sonne.rb/main/sonne.png)
|
8
|
+
|
9
|
+
# Setup
|
10
|
+
|
11
|
+
***All the features in Sonne, the Python library, will be added to Sonne.rb as soon as possible.***
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem install sonne
|
15
|
+
```
|
16
|
+
|
17
|
+
# Documentation
|
18
|
+
|
19
|
+
## Text
|
20
|
+
|
21
|
+
**Sonne.rb** has a ``Text`` function that you can use wherever strings are accepted and customize it with parameters.
|
22
|
+
|
23
|
+
Example usage:
|
24
|
+
```ruby
|
25
|
+
require "sonne"
|
26
|
+
|
27
|
+
x = Sonne.Text("Hello, World!", fg: "blue", bg: "white", style: "italic")
|
28
|
+
puts x
|
29
|
+
```
|
30
|
+
This will print colored and styled ``Hello, World!`` in the terminal.
|
31
|
+
|
32
|
+
Also you can use like this:
|
33
|
+
```ruby
|
34
|
+
require "sonne"
|
35
|
+
|
36
|
+
x = Sonne.Text("Hello,", "World!", fg: "blue", bg: "white", style: "italic")
|
37
|
+
puts x
|
38
|
+
```
|
39
|
+
This will also print colored and styled ``Hello, World!`` in the terminal.
|
40
|
+
|
41
|
+
## Other Functions
|
42
|
+
``clear()``: Clears the terminal screen.
|
43
|
+
|
44
|
+
``typewrite(*text, duration)``: Prints strings with typewriter effect.
|
45
|
+
|
46
|
+
## Styles
|
47
|
+
|
48
|
+
A list of ``Text`` styles in **Sonne.rb**.
|
49
|
+
|
50
|
+
| Name | Number |
|
51
|
+
|-------|---------|
|
52
|
+
| normal | 0 |
|
53
|
+
| bold | 1 |
|
54
|
+
| italic | 3 |
|
55
|
+
| underlined | 4 |
|
56
|
+
| reversed | 7 |
|
57
|
+
| hidden | 8 |
|
58
|
+
| strike | 9 |
|
59
|
+
|
60
|
+
## Colors
|
61
|
+
|
62
|
+
A list of the 8-bit ``Text`` colors in **Sonne.rb**.
|
63
|
+
|
64
|
+
| Name | Number |
|
65
|
+
|-------|---------|
|
66
|
+
| black | 0 |
|
67
|
+
| red | 1 |
|
68
|
+
| green | 2 |
|
69
|
+
| yellow | 3 |
|
70
|
+
| blue | 4 |
|
71
|
+
| magenta | 5 |
|
72
|
+
| cyan | 6 |
|
73
|
+
| white | 7 |
|
74
|
+
| brightblack | 8 |
|
75
|
+
| brightred | 9 |
|
76
|
+
| brightgreen | 10 |
|
77
|
+
| brightyellow | 11 |
|
78
|
+
| brightblue | 12 |
|
79
|
+
| brightmagenta | 13 |
|
80
|
+
| brightcyan | 14 |
|
81
|
+
| brightwhite | 15 |
|
82
|
+
| grey0 | 16 |
|
83
|
+
| gray0 | 16 |
|
84
|
+
| navyblue | 17 |
|
85
|
+
| darkblue | 18 |
|
86
|
+
| blue3 | 20 |
|
87
|
+
| blue1 | 21 |
|
88
|
+
| darkgreen | 22 |
|
89
|
+
| deepskyblue4 | 25 |
|
90
|
+
| dodgerblue3 | 26 |
|
91
|
+
| dodgerblue2 | 27 |
|
92
|
+
| green4 | 28 |
|
93
|
+
| springgreen4 | 29 |
|
94
|
+
| turquoise4 | 30 |
|
95
|
+
| deepskyblue3 | 32 |
|
96
|
+
| dodgerblue1 | 33 |
|
97
|
+
| green3 | 40 |
|
98
|
+
| springgreen3 | 41 |
|
99
|
+
| darkcyan | 36 |
|
100
|
+
| lightseagreen | 37 |
|
101
|
+
| deepskyblue2 | 38 |
|
102
|
+
| deepskyblue1 | 39 |
|
103
|
+
| springgreen2 | 47 |
|
104
|
+
| cyan3 | 43 |
|
105
|
+
| darkturquoise | 44 |
|
106
|
+
| turquoise2 | 45 |
|
107
|
+
| green1 | 46 |
|
108
|
+
| springgreen1 | 48 |
|
109
|
+
| mediumspringgreen | 49 |
|
110
|
+
| cyan2 | 50 |
|
111
|
+
| cyan1 | 51 |
|
112
|
+
| darkred | 88 |
|
113
|
+
| deeppink4 | 125 |
|
114
|
+
| purple4 | 55 |
|
115
|
+
| purple3 | 56 |
|
116
|
+
| blueviolet | 57 |
|
117
|
+
| orange4 | 94 |
|
118
|
+
| grey37 | 59 |
|
119
|
+
| gray37 | 59 |
|
120
|
+
| mediumpurple4 | 60 |
|
121
|
+
| slateblue3 | 62 |
|
122
|
+
| royalblue1 | 63 |
|
123
|
+
| chartreuse4 | 64 |
|
124
|
+
| darkseagreen4 | 71 |
|
125
|
+
| paleturquoise4 | 66 |
|
126
|
+
| steelblue | 67 |
|
127
|
+
| steelblue3 | 68 |
|
128
|
+
| cornflowerblue | 69 |
|
129
|
+
| chartreuse3 | 76 |
|
130
|
+
| cadetblue | 73 |
|
131
|
+
| skyblue3 | 74 |
|
132
|
+
| steelblue1 | 81 |
|
133
|
+
| palegreen3 | 114 |
|
134
|
+
| seagreen3 | 78 |
|
135
|
+
| aquamarine3 | 79 |
|
136
|
+
| mediumturquoise | 80 |
|
137
|
+
| chartreuse2 | 112 |
|
138
|
+
| seagreen2 | 83 |
|
139
|
+
| seagreen1 | 85 |
|
140
|
+
| aquamarine1 | 122 |
|
141
|
+
| darkslategray2 | 87 |
|
142
|
+
| darkmagenta | 91 |
|
143
|
+
| darkviolet | 128 |
|
144
|
+
| purple | 129 |
|
145
|
+
| lightpink4 | 95 |
|
146
|
+
| plum4 | 96 |
|
147
|
+
| mediumpurple3 | 98 |
|
148
|
+
| slateblue1 | 99 |
|
149
|
+
| yellow4 | 106 |
|
150
|
+
| wheat4 | 101 |
|
151
|
+
| grey53 | 102 |
|
152
|
+
| gray53 | 102 |
|
153
|
+
| lightslategrey | 103 |
|
154
|
+
| lightslategray | 103 |
|
155
|
+
| mediumpurple | 104 |
|
156
|
+
| lightslateblue | 105 |
|
157
|
+
| darkolivegreen3 | 149 |
|
158
|
+
| darkseagreen | 108 |
|
159
|
+
| lightskyblue3 | 110 |
|
160
|
+
| skyblue2 | 111 |
|
161
|
+
| darkseagreen3 | 150 |
|
162
|
+
| darkslategray3 | 116 |
|
163
|
+
| skyblue1 | 117 |
|
164
|
+
| chartreuse1 | 118 |
|
165
|
+
| lightgreen | 120 |
|
166
|
+
| palegreen1 | 156 |
|
167
|
+
| darkslategray1 | 123 |
|
168
|
+
| red3 | 160 |
|
169
|
+
| mediumvioletred | 126 |
|
170
|
+
| magenta3 | 164 |
|
171
|
+
| darkorange3 | 166 |
|
172
|
+
| indianred | 167 |
|
173
|
+
| hotpink3 | 168 |
|
174
|
+
| mediumorchid3 | 133 |
|
175
|
+
| mediumorchid | 134 |
|
176
|
+
| mediumpurple2 | 140 |
|
177
|
+
| darkgoldenrod | 136 |
|
178
|
+
| lightsalmon3 | 173 |
|
179
|
+
| rosybrown | 138 |
|
180
|
+
| grey63 | 139 |
|
181
|
+
| gray63 | 139 |
|
182
|
+
| mediumpurple1 | 141 |
|
183
|
+
| gold3 | 178 |
|
184
|
+
| darkkhaki | 143 |
|
185
|
+
| navajowhite3 | 144 |
|
186
|
+
| grey69 | 145 |
|
187
|
+
| gray69 | 145 |
|
188
|
+
| lightsteelblue3 | 146 |
|
189
|
+
| lightsteelblue | 147 |
|
190
|
+
| yellow3 | 184 |
|
191
|
+
| darkseagreen2 | 157 |
|
192
|
+
| lightcyan3 | 152 |
|
193
|
+
| lightskyblue1 | 153 |
|
194
|
+
| greenyellow | 154 |
|
195
|
+
| darkolivegreen2 | 155 |
|
196
|
+
| darkseagreen1 | 193 |
|
197
|
+
| paleturquoise1 | 159 |
|
198
|
+
| deeppink3 | 162 |
|
199
|
+
| magenta2 | 200 |
|
200
|
+
| hotpink2 | 169 |
|
201
|
+
| orchid | 170 |
|
202
|
+
| mediumorchid1 | 207 |
|
203
|
+
| orange3 | 172 |
|
204
|
+
| lightpink3 | 174 |
|
205
|
+
| pink3 | 175 |
|
206
|
+
| plum3 | 176 |
|
207
|
+
| violet | 177 |
|
208
|
+
| lightgoldenrod3 | 179 |
|
209
|
+
| tan | 180 |
|
210
|
+
| mistyrose3 | 181 |
|
211
|
+
| thistle3 | 182 |
|
212
|
+
| plum2 | 183 |
|
213
|
+
| khaki3 | 185 |
|
214
|
+
| lightgoldenrod2 | 222 |
|
215
|
+
| lightyellow3 | 187 |
|
216
|
+
| grey84 | 188 |
|
217
|
+
| gray84 | 188 |
|
218
|
+
| lightsteelblue1 | 189 |
|
219
|
+
| yellow2 | 190 |
|
220
|
+
| darkolivegreen1 | 192 |
|
221
|
+
| honeydew2 | 194 |
|
222
|
+
| lightcyan1 | 195 |
|
223
|
+
| red1 | 196 |
|
224
|
+
| deeppink2 | 197 |
|
225
|
+
| deeppink1 | 199 |
|
226
|
+
| magenta1 | 201 |
|
227
|
+
| orangered1 | 202 |
|
228
|
+
| indianred1 | 204 |
|
229
|
+
| hotpink | 206 |
|
230
|
+
| darkorange | 208 |
|
231
|
+
| salmon1 | 209 |
|
232
|
+
| lightcoral | 210 |
|
233
|
+
| palevioletred1 | 211 |
|
234
|
+
| orchid2 | 212 |
|
235
|
+
| orchid1 | 213 |
|
236
|
+
| orange1 | 214 |
|
237
|
+
| sandybrown | 215 |
|
238
|
+
| lightsalmon1 | 216 |
|
239
|
+
| lightpink1 | 217 |
|
240
|
+
| pink1 | 218 |
|
241
|
+
| plum1 | 219 |
|
242
|
+
| gold1 | 220 |
|
243
|
+
| navajowhite1 | 223 |
|
244
|
+
| mistyrose1 | 224 |
|
245
|
+
| thistle1 | 225 |
|
246
|
+
| yellow1 | 226 |
|
247
|
+
| lightgoldenrod1 | 227 |
|
248
|
+
| khaki1 | 228 |
|
249
|
+
| wheat1 | 229 |
|
250
|
+
| cornsilk1 | 230 |
|
251
|
+
| grey100 | 231 |
|
252
|
+
| gray100 | 231 |
|
253
|
+
| grey3 | 232 |
|
254
|
+
| gray3 | 232 |
|
255
|
+
| grey7 | 233 |
|
256
|
+
| gray7 | 233 |
|
257
|
+
| grey11 | 234 |
|
258
|
+
| gray11 | 234 |
|
259
|
+
| grey15 | 235 |
|
260
|
+
| gray15 | 235 |
|
261
|
+
| grey19 | 236 |
|
262
|
+
| gray19 | 236 |
|
263
|
+
| grey23 | 237 |
|
264
|
+
| gray23 | 237 |
|
265
|
+
| grey27 | 238 |
|
266
|
+
| gray27 | 238 |
|
267
|
+
| grey30 | 239 |
|
268
|
+
| gray30 | 239 |
|
269
|
+
| grey35 | 240 |
|
270
|
+
| gray35 | 240 |
|
271
|
+
| grey39 | 241 |
|
272
|
+
| gray39 | 241 |
|
273
|
+
| grey42 | 242 |
|
274
|
+
| gray42 | 242 |
|
275
|
+
| grey46 | 243 |
|
276
|
+
| gray46 | 243 |
|
277
|
+
| grey50 | 244 |
|
278
|
+
| gray50 | 244 |
|
279
|
+
| grey54 | 245 |
|
280
|
+
| gray54 | 245 |
|
281
|
+
| grey58 | 246 |
|
282
|
+
| gray58 | 246 |
|
283
|
+
| grey62 | 247 |
|
284
|
+
| gray62 | 247 |
|
285
|
+
| grey66 | 248 |
|
286
|
+
| gray66 | 248 |
|
287
|
+
| grey70 | 249 |
|
288
|
+
| gray70 | 249 |
|
289
|
+
| grey74 | 250 |
|
290
|
+
| gray74 | 250 |
|
291
|
+
| grey78 | 251 |
|
292
|
+
| gray78 | 251 |
|
293
|
+
| grey82 | 252 |
|
294
|
+
| gray82 | 252 |
|
295
|
+
| grey85 | 253 |
|
296
|
+
| gray85 | 253 |
|
297
|
+
| grey89 | 254 |
|
298
|
+
| gray89 | 254 |
|
299
|
+
| grey93 | 255 |
|
300
|
+
| gray93 | 255 |
|
data/lib/sonne.rb
ADDED
@@ -0,0 +1,282 @@
|
|
1
|
+
module Sonne
|
2
|
+
@@colorlist = {
|
3
|
+
"black" => 0,
|
4
|
+
"red" => 1,
|
5
|
+
"green" => 2,
|
6
|
+
"yellow" => 3,
|
7
|
+
"blue" => 4,
|
8
|
+
"magenta" => 5,
|
9
|
+
"cyan" => 6,
|
10
|
+
"white" => 7,
|
11
|
+
"brightblack" => 8,
|
12
|
+
"brightred" => 9,
|
13
|
+
"brightgreen" => 10,
|
14
|
+
"brightyellow" => 11,
|
15
|
+
"brightblue" => 12,
|
16
|
+
"brightmagenta" => 13,
|
17
|
+
"brightcyan" => 14,
|
18
|
+
"brightwhite" => 15,
|
19
|
+
"grey0" => 16,
|
20
|
+
"gray0" => 16,
|
21
|
+
"navyblue" => 17,
|
22
|
+
"darkblue" => 18,
|
23
|
+
"blue3" => 20,
|
24
|
+
"blue1" => 21,
|
25
|
+
"darkgreen" => 22,
|
26
|
+
"deepskyblue4" => 25,
|
27
|
+
"dodgerblue3" => 26,
|
28
|
+
"dodgerblue2" => 27,
|
29
|
+
"green4" => 28,
|
30
|
+
"springgreen4" => 29,
|
31
|
+
"turquoise4" => 30,
|
32
|
+
"deepskyblue3" => 32,
|
33
|
+
"dodgerblue1" => 33,
|
34
|
+
"green3" => 40,
|
35
|
+
"springgreen3" => 41,
|
36
|
+
"darkcyan" => 36,
|
37
|
+
"lightseagreen" => 37,
|
38
|
+
"deepskyblue2" => 38,
|
39
|
+
"deepskyblue1" => 39,
|
40
|
+
"springgreen2" => 47,
|
41
|
+
"cyan3" => 43,
|
42
|
+
"darkturquoise" => 44,
|
43
|
+
"turquoise2" => 45,
|
44
|
+
"green1" => 46,
|
45
|
+
"springgreen1" => 48,
|
46
|
+
"mediumspringgreen" => 49,
|
47
|
+
"cyan2" => 50,
|
48
|
+
"cyan1" => 51,
|
49
|
+
"darkred" => 88,
|
50
|
+
"deeppink4" => 125,
|
51
|
+
"purple4" => 55,
|
52
|
+
"purple3" => 56,
|
53
|
+
"blueviolet" => 57,
|
54
|
+
"orange4" => 94,
|
55
|
+
"grey37" => 59,
|
56
|
+
"gray37" => 59,
|
57
|
+
"mediumpurple4" => 60,
|
58
|
+
"slateblue3" => 62,
|
59
|
+
"royalblue1" => 63,
|
60
|
+
"chartreuse4" => 64,
|
61
|
+
"darkseagreen4" => 71,
|
62
|
+
"paleturquoise4" => 66,
|
63
|
+
"steelblue" => 67,
|
64
|
+
"steelblue3" => 68,
|
65
|
+
"cornflowerblue" => 69,
|
66
|
+
"chartreuse3" => 76,
|
67
|
+
"cadetblue" => 73,
|
68
|
+
"skyblue3" => 74,
|
69
|
+
"steelblue1" => 81,
|
70
|
+
"palegreen3" => 114,
|
71
|
+
"seagreen3" => 78,
|
72
|
+
"aquamarine3" => 79,
|
73
|
+
"mediumturquoise" => 80,
|
74
|
+
"chartreuse2" => 112,
|
75
|
+
"seagreen2" => 83,
|
76
|
+
"seagreen1" => 85,
|
77
|
+
"aquamarine1" => 122,
|
78
|
+
"darkslategray2" => 87,
|
79
|
+
"darkmagenta" => 91,
|
80
|
+
"darkviolet" => 128,
|
81
|
+
"purple" => 129,
|
82
|
+
"lightpink4" => 95,
|
83
|
+
"plum4" => 96,
|
84
|
+
"mediumpurple3" => 98,
|
85
|
+
"slateblue1" => 99,
|
86
|
+
"yellow4" => 106,
|
87
|
+
"wheat4" => 101,
|
88
|
+
"grey53" => 102,
|
89
|
+
"gray53" => 102,
|
90
|
+
"lightslategrey" => 103,
|
91
|
+
"lightslategray" => 103,
|
92
|
+
"mediumpurple" => 104,
|
93
|
+
"lightslateblue" => 105,
|
94
|
+
"darkolivegreen3" => 149,
|
95
|
+
"darkseagreen" => 108,
|
96
|
+
"lightskyblue3" => 110,
|
97
|
+
"skyblue2" => 111,
|
98
|
+
"darkseagreen3" => 150,
|
99
|
+
"darkslategray3" => 116,
|
100
|
+
"skyblue1" => 117,
|
101
|
+
"chartreuse1" => 118,
|
102
|
+
"lightgreen" => 120,
|
103
|
+
"palegreen1" => 156,
|
104
|
+
"darkslategray1" => 123,
|
105
|
+
"red3" => 160,
|
106
|
+
"mediumvioletred" => 126,
|
107
|
+
"magenta3" => 164,
|
108
|
+
"darkorange3" => 166,
|
109
|
+
"indianred" => 167,
|
110
|
+
"hotpink3" => 168,
|
111
|
+
"mediumorchid3" => 133,
|
112
|
+
"mediumorchid" => 134,
|
113
|
+
"mediumpurple2" => 140,
|
114
|
+
"darkgoldenrod" => 136,
|
115
|
+
"lightsalmon3" => 173,
|
116
|
+
"rosybrown" => 138,
|
117
|
+
"grey63" => 139,
|
118
|
+
"gray63" => 139,
|
119
|
+
"mediumpurple1" => 141,
|
120
|
+
"gold3" => 178,
|
121
|
+
"darkkhaki" => 143,
|
122
|
+
"navajowhite3" => 144,
|
123
|
+
"grey69" => 145,
|
124
|
+
"gray69" => 145,
|
125
|
+
"lightsteelblue3" => 146,
|
126
|
+
"lightsteelblue" => 147,
|
127
|
+
"yellow3" => 184,
|
128
|
+
"darkseagreen2" => 157,
|
129
|
+
"lightcyan3" => 152,
|
130
|
+
"lightskyblue1" => 153,
|
131
|
+
"greenyellow" => 154,
|
132
|
+
"darkolivegreen2" => 155,
|
133
|
+
"darkseagreen1" => 193,
|
134
|
+
"paleturquoise1" => 159,
|
135
|
+
"deeppink3" => 162,
|
136
|
+
"magenta2" => 200,
|
137
|
+
"hotpink2" => 169,
|
138
|
+
"orchid" => 170,
|
139
|
+
"mediumorchid1" => 207,
|
140
|
+
"orange3" => 172,
|
141
|
+
"lightpink3" => 174,
|
142
|
+
"pink3" => 175,
|
143
|
+
"plum3" => 176,
|
144
|
+
"violet" => 177,
|
145
|
+
"lightgoldenrod3" => 179,
|
146
|
+
"tan" => 180,
|
147
|
+
"mistyrose3" => 181,
|
148
|
+
"thistle3" => 182,
|
149
|
+
"plum2" => 183,
|
150
|
+
"khaki3" => 185,
|
151
|
+
"lightgoldenrod2" => 222,
|
152
|
+
"lightyellow3" => 187,
|
153
|
+
"grey84" => 188,
|
154
|
+
"gray84" => 188,
|
155
|
+
"lightsteelblue1" => 189,
|
156
|
+
"yellow2" => 190,
|
157
|
+
"darkolivegreen1" => 192,
|
158
|
+
"honeydew2" => 194,
|
159
|
+
"lightcyan1" => 195,
|
160
|
+
"red1" => 196,
|
161
|
+
"deeppink2" => 197,
|
162
|
+
"deeppink1" => 199,
|
163
|
+
"magenta1" => 201,
|
164
|
+
"orangered1" => 202,
|
165
|
+
"indianred1" => 204,
|
166
|
+
"hotpink" => 206,
|
167
|
+
"darkorange" => 208,
|
168
|
+
"salmon1" => 209,
|
169
|
+
"lightcoral" => 210,
|
170
|
+
"palevioletred1" => 211,
|
171
|
+
"orchid2" => 212,
|
172
|
+
"orchid1" => 213,
|
173
|
+
"orange1" => 214,
|
174
|
+
"sandybrown" => 215,
|
175
|
+
"lightsalmon1" => 216,
|
176
|
+
"lightpink1" => 217,
|
177
|
+
"pink1" => 218,
|
178
|
+
"plum1" => 219,
|
179
|
+
"gold1" => 220,
|
180
|
+
"navajowhite1" => 223,
|
181
|
+
"mistyrose1" => 224,
|
182
|
+
"thistle1" => 225,
|
183
|
+
"yellow1" => 226,
|
184
|
+
"lightgoldenrod1" => 227,
|
185
|
+
"khaki1" => 228,
|
186
|
+
"wheat1" => 229,
|
187
|
+
"cornsilk1" => 230,
|
188
|
+
"grey100" => 231,
|
189
|
+
"gray100" => 231,
|
190
|
+
"grey3" => 232,
|
191
|
+
"gray3" => 232,
|
192
|
+
"grey7" => 233,
|
193
|
+
"gray7" => 233,
|
194
|
+
"grey11" => 234,
|
195
|
+
"gray11" => 234,
|
196
|
+
"grey15" => 235,
|
197
|
+
"gray15" => 235,
|
198
|
+
"grey19" => 236,
|
199
|
+
"gray19" => 236,
|
200
|
+
"grey23" => 237,
|
201
|
+
"gray23" => 237,
|
202
|
+
"grey27" => 238,
|
203
|
+
"gray27" => 238,
|
204
|
+
"grey30" => 239,
|
205
|
+
"gray30" => 239,
|
206
|
+
"grey35" => 240,
|
207
|
+
"gray35" => 240,
|
208
|
+
"grey39" => 241,
|
209
|
+
"gray39" => 241,
|
210
|
+
"grey42" => 242,
|
211
|
+
"gray42" => 242,
|
212
|
+
"grey46" => 243,
|
213
|
+
"gray46" => 243,
|
214
|
+
"grey50" => 244,
|
215
|
+
"gray50" => 244,
|
216
|
+
"grey54" => 245,
|
217
|
+
"gray54" => 245,
|
218
|
+
"grey58" => 246,
|
219
|
+
"gray58" => 246,
|
220
|
+
"grey62" => 247,
|
221
|
+
"gray62" => 247,
|
222
|
+
"grey66" => 248,
|
223
|
+
"gray66" => 248,
|
224
|
+
"grey70" => 249,
|
225
|
+
"gray70" => 249,
|
226
|
+
"grey74" => 250,
|
227
|
+
"gray74" => 250,
|
228
|
+
"grey78" => 251,
|
229
|
+
"gray78" => 251,
|
230
|
+
"grey82" => 252,
|
231
|
+
"gray82" => 252,
|
232
|
+
"grey85" => 253,
|
233
|
+
"gray85" => 253,
|
234
|
+
"grey89" => 254,
|
235
|
+
"gray89" => 254,
|
236
|
+
"grey93" => 255,
|
237
|
+
"gray93" => 255
|
238
|
+
}
|
239
|
+
|
240
|
+
@@stylelist = {
|
241
|
+
"normal" => 0,
|
242
|
+
"bold" => 1,
|
243
|
+
"italic" => 3,
|
244
|
+
"underlined" => 4,
|
245
|
+
"reversed" => 7,
|
246
|
+
"hidden" => 8,
|
247
|
+
"strike" => 9
|
248
|
+
}
|
249
|
+
|
250
|
+
def self.Text(*text, fg: nil, bg: nil, style: nil)
|
251
|
+
system("")
|
252
|
+
formattedText = ""
|
253
|
+
|
254
|
+
if style
|
255
|
+
formattedText += "\033[#{@@stylelist[style]}m"
|
256
|
+
end
|
257
|
+
|
258
|
+
if fg && bg
|
259
|
+
formattedText += "\033[38;5;#{@@colorlist[fg]}m\033[48;5;#{@@colorlist[bg]}m"
|
260
|
+
elsif fg
|
261
|
+
formattedText += "\033[38;5;#{@@colorlist[fg]}m"
|
262
|
+
elsif bg
|
263
|
+
formattedText += "\033[48;5;#{@@colorlist[bg]}m"
|
264
|
+
end
|
265
|
+
|
266
|
+
"#{formattedText}#{text.join(" ")}\033[0m"
|
267
|
+
end
|
268
|
+
|
269
|
+
def self.clear
|
270
|
+
system("cls" || "clear")
|
271
|
+
end
|
272
|
+
|
273
|
+
def self.typewrite(*text, duration)
|
274
|
+
require "io/console"
|
275
|
+
newtext = text.join(" ") + "\n"
|
276
|
+
newtext.each_char do |character|
|
277
|
+
sleep(duration)
|
278
|
+
print character
|
279
|
+
$stdout.flush
|
280
|
+
end
|
281
|
+
end
|
282
|
+
end
|
metadata
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sonne
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ekin Aksu
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-08-16 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Ruby port of Sonne (Python library).
|
14
|
+
email:
|
15
|
+
- sonnelib@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- LICENSE
|
21
|
+
- README.md
|
22
|
+
- lib/sonne.rb
|
23
|
+
homepage: https://github.com/sonnelib/sonne.rb
|
24
|
+
licenses:
|
25
|
+
- Apache-2.0
|
26
|
+
metadata: {}
|
27
|
+
post_install_message:
|
28
|
+
rdoc_options: []
|
29
|
+
require_paths:
|
30
|
+
- lib
|
31
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
36
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
requirements: []
|
42
|
+
rubygems_version: 3.4.18
|
43
|
+
signing_key:
|
44
|
+
specification_version: 4
|
45
|
+
summary: Ruby port of Sonne.
|
46
|
+
test_files: []
|