customization 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/customization.rb +23 -0
  3. metadata +8 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d2feb97fde32cea84f0d77e435fa77d8608082c23275f172396dd3d48525c15
4
- data.tar.gz: b063cc01c04171822e2aa42e9d1ffaeefab8c2bb5d69d36b55872455cdeed3b1
3
+ metadata.gz: 3bc4e9ff270ea764dc80f0e1aee1d6728b041d20c759e08017ed68a1f0783d7f
4
+ data.tar.gz: 02ab73dc46fdb3a0962d69af665810f1389feb0d1ff28aa818fe1068d0ff3753
5
5
  SHA512:
6
- metadata.gz: d439939227424de81721ffbc3e9528c943f95a612ea57107e1e8f3f75b90f046144d1fb84865b0cbf55b6d71ae656a37f0d6e917e7b830aabbab824dd7317673
7
- data.tar.gz: 5761eecb474822b5acc148c1e7d9c16c3cf2e87c55281a6f3aa378f8fb6e829647f0e2b9f4e094ff72b9d222fa51d1b75ad4eb2135bb1d842017aeb580e321f9
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.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ThatAlecs
@@ -9,23 +9,12 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2023-10-11 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: other_gem
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '2.0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '2.0'
27
- description: Customization is a library for customizing text with various effects
28
- and colors.
12
+ dependencies: []
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.
29
18
  email:
30
19
  executables: []
31
20
  extensions: []
@@ -47,7 +36,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
47
36
  requirements:
48
37
  - - ">="
49
38
  - !ruby/object:Gem::Version
50
- version: '0'
39
+ version: 2.5.0
51
40
  required_rubygems_version: !ruby/object:Gem::Requirement
52
41
  requirements:
53
42
  - - ">="