string_dot_gradient 0.1.8 → 0.1.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f734ad48d80c57969e3fb4598f5a89fafdb35b30c2b5dddbc1bbbf1a835a829
4
- data.tar.gz: 80c268d0c7754047bf1040d1ade34a3e9652180441ca3cbf23a0d67f8873d531
3
+ metadata.gz: 229c7c52d938962d064671617bd9c8ae622df4a52fa5dd7df0b4485ec14e55a1
4
+ data.tar.gz: 0d926f9ed11056c3870c3964a7497c345b890582e8816296baa2c38eaa07836d
5
5
  SHA512:
6
- metadata.gz: 0102ffe6acc5355cc7d29dea013439eb245fc5ec11415eea6cc91f1025a6128f639120b74d29d0dec44ebf085f73d41411d6027480b4270dc832d17e5e353cf7
7
- data.tar.gz: d0d2c157c03af2a8688fcba1ade8d5177e0d8656512b9293a26672faf9dddb492a530e409df9e6ffa5f32f75f05d0c6c041ac13f4cc0a75c4067b4fc59bf9144
6
+ metadata.gz: 9baf8ae5b7a5e0285db981cc3d4426493cd44864f40a44cbefecde30b7742602f5424275bfe676a330dd9a8eb5c9117c4c50b055811c76d072c2f9c632ab7e07
7
+ data.tar.gz: 3186f138e9036fc98801a0810913524c16508a2468126c41a9482d3043b0accaf41bbcbf9aa2c6600365e30d043e6b311aaec8db6b43d83eea6cfe3e75f47565
@@ -1,6 +1,6 @@
1
1
  class String
2
2
  ##
3
- # = gradient(*arg_colours, bg: false, exclude_spaces: true) # => string or nil
3
+ # = gradient(*arg_colours, bg: false, exclude_spaces: true, bold: false, blink: false) # => string or nil
4
4
  #
5
5
  # Prettifies your string by adding gradient colours.
6
6
  #
@@ -40,7 +40,13 @@ class String
40
40
  # This is because \r wipes out the previous characters, and using \u0000 in
41
41
  # a string is uncommon, and developers are requested to delete
42
42
  # \u0000 from string if such situations arise.
43
- def gradient(*arg_colours, bg: false, exclude_spaces: true)
43
+ #
44
+ # The option bold makes texts bold, but it also makes the string bigger.
45
+ # Set bold to anything truthy or falsey, but better just go with true and false or nil
46
+ #
47
+ # The option blink makes the texts blink on supported terminals.
48
+ # Set blink to anything truthy or falsey, but better just go with true and false or nil
49
+ def gradient(*arg_colours, bg: false, exclude_spaces: true, bold: false, blink: false)
44
50
  temp = ''
45
51
  flatten_colours = arg_colours.flatten
46
52
 
@@ -59,6 +65,9 @@ class String
59
65
  init = bg ? 48 : 38
60
66
 
61
67
  each_line do |c|
68
+ temp << "\e[1m".freeze if bold
69
+ temp << "\e[5m".freeze if blink
70
+
62
71
  _r, _g, _b = r, g, b
63
72
  chomped = !!c.chomp!(''.freeze)
64
73
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StringDotGradient
4
- VERSION = "0.1.8"
4
+ VERSION = "0.1.9"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: string_dot_gradient
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sourav Goswami
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-12 00:00:00.000000000 Z
11
+ date: 2021-01-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: An itty-bitty extension that adds gradient method to String class that
14
14
  supports any hex colour, for Linux | Unix terminals only