customization 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/customization.rb +23 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bc4e9ff270ea764dc80f0e1aee1d6728b041d20c759e08017ed68a1f0783d7f
|
4
|
+
data.tar.gz: 02ab73dc46fdb3a0962d69af665810f1389feb0d1ff28aa818fe1068d0ff3753
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4343a4cc9a30d1175b250c2ec981a6d6a7a42a24913af8c15941d27545a8024dba19a0428fdc5ab971b7ce837d18e434513c489688d7a348dcd9dc7426698bcd
|
7
|
+
data.tar.gz: 437ace4e60afc241bc748dd4553a199a81bfba47c6ee72ac39a26d32021866020787ce84788c866d35196e851e74e6161c4b04f387396cf206123087f04692eb
|
data/lib/customization.rb
CHANGED
@@ -254,6 +254,29 @@ module Customization
|
|
254
254
|
"#{TEXT_EFFECTS[:blink]}#{text}#{FORMATS[:reset]}"
|
255
255
|
end
|
256
256
|
|
257
|
+
def self.scroll_text(text, speed = 1)
|
258
|
+
# Simulate scrolling text with the specified speed
|
259
|
+
text_length = visible_length(text)
|
260
|
+
text_with_padding = " " * text_length + text + " " * text_length
|
261
|
+
delay = 1.0 / speed
|
262
|
+
|
263
|
+
text_with_padding.chars.each_with_index do |char, index|
|
264
|
+
print "\r#{text_with_padding[index, text_length]}"
|
265
|
+
sleep(delay)
|
266
|
+
end
|
267
|
+
print "\n"
|
268
|
+
end
|
269
|
+
|
270
|
+
def self.typewriter_text(text, speed = 0.1)
|
271
|
+
# Simulate a typewriter effect with the specified speed
|
272
|
+
text.each_char do |char|
|
273
|
+
print char
|
274
|
+
sleep(speed)
|
275
|
+
end
|
276
|
+
print "\n"
|
277
|
+
end
|
278
|
+
|
279
|
+
|
257
280
|
def self.color_text(text, color, custom_code = nil)
|
258
281
|
if COLORS.key?(color)
|
259
282
|
"#{COLORS[color]}#{text}#{FORMATS[:reset]}"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: customization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ThatAlecs
|
@@ -10,8 +10,11 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2023-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Customization is a
|
14
|
-
|
13
|
+
description: The Customization module is a versatile Ruby library designed to enhance
|
14
|
+
your text formatting capabilities in the terminal. This module empowers you to add
|
15
|
+
style, color, and effects to text, making it an excellent tool for creating visually
|
16
|
+
appealing command-line applications, generating stylish reports, or simply adding
|
17
|
+
a touch of flair to your terminal outputs.
|
15
18
|
email:
|
16
19
|
executables: []
|
17
20
|
extensions: []
|