customization 1.0.0 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/customization.rb +23 -0
  3. data/lib/errors.rb +0 -6
  4. metadata +10 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5964699612cdc7dd15e9a0675e07875216e03db10720f389325d93fdd88e9ab
4
- data.tar.gz: b88e61a0bac781d682726e482bdc1a35e8aee9c5bb0257e69c88f4fb0b22de8f
3
+ metadata.gz: 3bc4e9ff270ea764dc80f0e1aee1d6728b041d20c759e08017ed68a1f0783d7f
4
+ data.tar.gz: 02ab73dc46fdb3a0962d69af665810f1389feb0d1ff28aa818fe1068d0ff3753
5
5
  SHA512:
6
- metadata.gz: e76e80e2f95ef60d55e81b7d9097069fe49c842994d1d8d90ceb3c3f59f843fb1ef4e9b0aa23e56a51611745485eceadd11ef79d242399656670875164a51d5d
7
- data.tar.gz: e7a2dcd6e4807a43db69a2686ccf4ede439bfc4099b741a81db38d7081b955e8be5a6fddc4d3daef8fedaf7773cca8e89fcc4db2d2751ef90aee39de2654643f
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]}"
data/lib/errors.rb CHANGED
@@ -13,12 +13,6 @@ module Customization
13
13
  end
14
14
  end
15
15
 
16
- class InvalidFontSizeError < StandardError
17
- def initialize(size)
18
- super("Invalid font size: #{size}")
19
- end
20
- end
21
-
22
16
  class InvalidBorderError < StandardError
23
17
  def initialize(border)
24
18
  super("Invalid text border style: #{border}")
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.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 library for customizing text with various effects
14
- and colors.
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: []
@@ -19,11 +22,12 @@ extra_rdoc_files: []
19
22
  files:
20
23
  - lib/customization.rb
21
24
  - lib/errors.rb
22
- homepage: https://github.com/thatalecs/customizationrb
25
+ homepage: https://github.com/thatalecs/customization
23
26
  licenses:
24
27
  - MIT
25
28
  metadata:
26
- source_code_uri: https://github.com/thatalecs/customizationrb
29
+ documentation_uri: https://github.com/thatalecs/customization/wiki
30
+ source_code_uri: https://github.com/thatalecs/customization
27
31
  post_install_message:
28
32
  rdoc_options: []
29
33
  require_paths:
@@ -32,7 +36,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
32
36
  requirements:
33
37
  - - ">="
34
38
  - !ruby/object:Gem::Version
35
- version: '0'
39
+ version: 2.5.0
36
40
  required_rubygems_version: !ruby/object:Gem::Requirement
37
41
  requirements:
38
42
  - - ">="