sai 0.2.0 → 0.3.0

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.
@@ -13,7 +13,7 @@ module Sai
13
13
  # @author {https://aaronmallen.me Aaron Allen}
14
14
  # @since 0.2.0
15
15
  #
16
- # @api private
16
+ # @api public
17
17
  #
18
18
  # @example
19
19
  # Sai.mode.advanced #=> 3
@@ -46,31 +46,31 @@ module Sai
46
46
  # @api public
47
47
  #
48
48
  # @example With color support enabled
49
- # ENV['COLORTERM'] #=> nil
50
- # ENV['TERM'] #=> 'xterm-256color'
51
- # Sai.mode.ansi_auto #=> 3
52
- # Sai.mode.four_bit_auto #=> 3
53
- # Sai.mode.color_16_auto #=> 3
49
+ # ENV['COLORTERM'] #=> nil
50
+ # ENV['TERM'] #=> 'xterm-256color'
51
+ # Sai.mode.advanced_auto #=> 3
52
+ # Sai.mode.eight_bit_auto #=> 3
53
+ # Sai.mode.color256_auto #=> 3
54
54
  #
55
55
  # @example With only 4-bit color support
56
- # ENV['NO_COLOR'] #=> nil
57
- # ENV['TERM'] #=> 'ansi'
58
- # Sai.mode.ansi_auto #=> 2
59
- # Sai.mode.four_bit_auto #=> 2
60
- # Sai.mode.color_16_auto #=> 2
56
+ # ENV['NO_COLOR'] #=> nil
57
+ # ENV['TERM'] #=> 'ansi'
58
+ # Sai.mode.advanced_auto #=> 2
59
+ # Sai.mode.eight_bit_auto #=> 2
60
+ # Sai.mode.color256_auto #=> 2
61
61
  #
62
62
  # @example With only 3-bit color support
63
63
  # ENV['TERM'] #=> nil
64
64
  # ENV['NO_COLOR'] #=> nil
65
- # Sai.mode.ansi_auto #=> 1
66
- # Sai.mode.four_bit_auto #=> 1
67
- # Sai.mode.color16_auto #=> 1
65
+ # Sai.mode.advanced_auto #=> 1
66
+ # Sai.mode.eight_bit_auto #=> 1
67
+ # Sai.mode.color256_auto #=> 1
68
68
  #
69
69
  # @example With color support disabled
70
70
  # ENV['NO_COLOR'] #=> 'true'
71
- # Sai.mode.ansi_auto #=> 0
72
- # Sai.mode.four_bit_auto #=> 0
73
- # Sai.mode.color16_auto #=> 0
71
+ # Sai.mode.advanced_auto #=> 0
72
+ # Sai.mode.eight_bit_auto #=> 0
73
+ # Sai.mode.color256_auto #=> 0
74
74
  #
75
75
  # @return [Integer] the color mode
76
76
  # @rbs () -> Integer
@@ -128,7 +128,7 @@ module Sai
128
128
  # ENV['TERM'] #=> 'ansi'
129
129
  # Sai.mode.ansi_auto #=> 2
130
130
  # Sai.mode.four_bit_auto #=> 2
131
- # Sai.mode.color_16_auto #=> 2
131
+ # Sai.mode.color16_auto #=> 2
132
132
  #
133
133
  # @example With only 3-bit color support
134
134
  # ENV['TERM'] #=> nil
@@ -295,7 +295,7 @@ module Sai
295
295
  # @author {https://aaronmallen.me Aaron Allen}
296
296
  # @since 0.2.0
297
297
  #
298
- # @api private
298
+ # @api public
299
299
  #
300
300
  # @example
301
301
  # Sai.mode.true_color #=> 4
data/sig/sai.rbs CHANGED
@@ -11,6 +11,7 @@
11
11
  # adaptive color to your terminal interfaces
12
12
  #
13
13
  # When included in a class or module, Sai provides the following instance methods:
14
+ # * {#color_mode} - Returns an interface to select Sai color modes
14
15
  # * {#decorator} - Returns a new instance of {Decorator} for method chaining
15
16
  # * {#terminal_color_support} - Returns the color support capabilities of the current terminal
16
17
  #
@@ -149,6 +150,22 @@ module Sai
149
150
 
150
151
  def yellow: () -> Decorator
151
152
 
153
+ # Sequence a string with ANSI escape codes
154
+ #
155
+ # @author {https://aaronmallen.me Aaron Allen}
156
+ # @since 0.3.0
157
+ #
158
+ # @api public
159
+ #
160
+ # @example Sequence a string with ANSI escape codes
161
+ # Sai.sequence("\e[38;2;205;0;0mHello, World!\e[0m") #=> #<Sai::ANSI::SequencedString:0x123>
162
+ #
163
+ # @param text [String] the text to sequence
164
+ #
165
+ # @return [ANSI::SequencedString] the sequenced string
166
+ # @rbs (String text) -> ANSI::SequencedString
167
+ def self.sequence: (String text) -> ANSI::SequencedString
168
+
152
169
  # The supported color modes for the terminal
153
170
  #
154
171
  # @author {https://aaronmallen.me Aaron Allen}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Allen
@@ -22,8 +22,11 @@ files:
22
22
  - CHANGELOG.md
23
23
  - LICENSE
24
24
  - README.md
25
+ - docs/USAGE.md
25
26
  - lib/sai.rb
26
27
  - lib/sai/ansi.rb
28
+ - lib/sai/ansi/sequence_processor.rb
29
+ - lib/sai/ansi/sequenced_string.rb
27
30
  - lib/sai/conversion/color_sequence.rb
28
31
  - lib/sai/conversion/rgb.rb
29
32
  - lib/sai/decorator.rb
@@ -31,8 +34,11 @@ files:
31
34
  - lib/sai/support.rb
32
35
  - lib/sai/terminal/capabilities.rb
33
36
  - lib/sai/terminal/color_mode.rb
37
+ - sig/manifest.yaml
34
38
  - sig/sai.rbs
35
39
  - sig/sai/ansi.rbs
40
+ - sig/sai/ansi/sequence_processor.rbs
41
+ - sig/sai/ansi/sequenced_string.rbs
36
42
  - sig/sai/conversion/color_sequence.rbs
37
43
  - sig/sai/conversion/rgb.rbs
38
44
  - sig/sai/decorator.rbs
@@ -45,10 +51,10 @@ licenses:
45
51
  - MIT
46
52
  metadata:
47
53
  bug_tracker_uri: https://github.com/aaronmallen/sai/issues
48
- changelog_uri: https://github.com/aaronmallen/sai/releases/tag/0.2.0
54
+ changelog_uri: https://github.com/aaronmallen/sai/releases/tag/0.3.0
49
55
  homepage_uri: https://github.com/aaronmallen/sai
50
56
  rubygems_mfa_required: 'true'
51
- source_code_uri: https://github.com/aaronmallen/sai/tree/0.2.0
57
+ source_code_uri: https://github.com/aaronmallen/sai/tree/0.3.0
52
58
  rdoc_options: []
53
59
  require_paths:
54
60
  - lib