paint 2.0.3 → 2.1.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.
- checksums.yaml +4 -4
- data/.travis.yml +8 -4
- data/CHANGELOG.md +4 -0
- data/MIT-LICENSE.txt +1 -1
- data/README.md +8 -8
- data/lib/paint.rb +2 -4
- data/lib/paint/constants.rb +3 -3
- data/lib/paint/version.rb +3 -1
- data/paint.gemspec +2 -3
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfd28984ff2d7677f689aaa7f3c5088b941cd3682deba38e3ecb1f7e51fb930b
|
4
|
+
data.tar.gz: 3e9e5792bdf51a5581b462af95db13f95de0dfa8b3f8d8c282dae5af36334977
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f833aefb6b50f8ca869b123dd27318460283bd8c583628513302b4553e32c81d5633ed90246d5730a6eba3140986ccc3e810b513baca6ff9bb21a9c01165a29
|
7
|
+
data.tar.gz: 356fbec4208038763fd7ef1f967669ade4392ba4a171fc92db56e17b689ccb5976befc27f71cec65f0bd4ca06d74c2efa8bd72113889f8f503570751113e3ae5
|
data/.travis.yml
CHANGED
@@ -2,20 +2,24 @@ sudo: false
|
|
2
2
|
language: ruby
|
3
3
|
|
4
4
|
rvm:
|
5
|
-
- 2.
|
6
|
-
- 2.
|
7
|
-
- 2.
|
5
|
+
- 2.6.0
|
6
|
+
- 2.5.3
|
7
|
+
- 2.4.5
|
8
|
+
- 2.3.8
|
8
9
|
- 2.2
|
9
10
|
- 2.1
|
10
11
|
- 2.0
|
11
12
|
- 1.9.3
|
12
13
|
- ruby-head
|
13
14
|
- jruby-head
|
14
|
-
- jruby-9.
|
15
|
+
- jruby-9.2.5.0
|
16
|
+
- truffleruby
|
15
17
|
|
16
18
|
matrix:
|
17
19
|
allow_failures:
|
18
20
|
- rvm: jruby-head
|
21
|
+
- rvm: 2.2
|
19
22
|
- rvm: 2.1
|
20
23
|
- rvm: 2.0
|
21
24
|
- rvm: 1.9.3
|
25
|
+
- rvm: truffleruby
|
data/CHANGELOG.md
CHANGED
data/MIT-LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Ruby Paint [<img src="https://badge.fury.io/rb/paint.svg" />](
|
1
|
+
# Ruby Paint [<img src="https://badge.fury.io/rb/paint.svg" />](https://badge.fury.io/rb/paint) [<img src="https://travis-ci.org/janlelis/paint.svg" />](https://travis-ci.org/janlelis/paint)
|
2
2
|
|
3
3
|
Paint creates terminal colors and effects for you. It combines the strengths of **term-ansicolor**, **rainbow**, and similar projects into a simple to use, however still flexible terminal colors gem with no core extensions by default.
|
4
4
|
|
@@ -6,7 +6,7 @@ Paint creates terminal colors and effects for you. It combines the strengths of
|
|
6
6
|
|
7
7
|
* No string extensions (suitable for library development)
|
8
8
|
* Simple API
|
9
|
-
* Faster than other terminal color gems ([as of December
|
9
|
+
* Faster than other terminal color gems ([as of December 2018](https://gist.github.com/janlelis/91413b9295c81ee873dc))
|
10
10
|
* Supports *true color* or 256 colors (for capable terminals)
|
11
11
|
* Allows you to set any terminal effects
|
12
12
|
* `Paint.mode`: Fall-back modes for terminals with less colors, supported modes:
|
@@ -25,11 +25,11 @@ Starting with **Paint 2.0**, *true color* mode is the new default mode, since mo
|
|
25
25
|
|
26
26
|
## Supported Rubies
|
27
27
|
|
28
|
-
* **2.
|
28
|
+
* **2.6**, **2.5**, **2.4**, **2.3**
|
29
29
|
|
30
30
|
Unsupported, but might still work:
|
31
31
|
|
32
|
-
* **2.1**, **2.0**, **1.9**
|
32
|
+
* **2.2**, **2.1**, **2.0**, **1.9**
|
33
33
|
|
34
34
|
## Setup
|
35
35
|
|
@@ -79,7 +79,7 @@ When you pass multiple colors, the first one is taken as foreground color and th
|
|
79
79
|
|
80
80
|
## Windows Support
|
81
81
|
|
82
|
-
For ANSI support in Windows OS, you can use [ansicon](https://github.com/adoxa/ansicon) or [ConEmu](
|
82
|
+
For ANSI support in Windows OS, you can use [ansicon](https://github.com/adoxa/ansicon) or [ConEmu](https://conemu.github.io/) or WSL(https://docs.microsoft.com/en-us/windows/wsl/install-win10).
|
83
83
|
|
84
84
|
## `Paint.mode`
|
85
85
|
|
@@ -95,7 +95,7 @@ Paint tries to automatically detect the proper value your terminal is capable of
|
|
95
95
|
|
96
96
|
## More Details About Terminal Colors and Effects
|
97
97
|
|
98
|
-
Terminal colors/effects get created by [ANSI escape sequences](
|
98
|
+
Terminal colors/effects get created by [ANSI escape sequences](https://en.wikipedia.org/wiki/ANSI_escape_code). These are strings that look like this: `\e[X;X;X;X;X]m` where X are integers with some meaning. For example, `0` means *reset*, `31` means *red foreground* and `41` stands for red background. When you tell **Paint** to use one of the eight ANSI base colors as foreground color, it just inserts a number between `30` and `37` into the sequence. The following colors are available:
|
99
99
|
|
100
100
|
* `:black`
|
101
101
|
* `:red`
|
@@ -115,7 +115,7 @@ When using the `Paint.[]` method, Paint wraps the given string between the calcu
|
|
115
115
|
|
116
116
|
### Effects
|
117
117
|
|
118
|
-
See [en.wikipedia.org/wiki/ANSI_escape_code](
|
118
|
+
See [en.wikipedia.org/wiki/ANSI_escape_code](https://en.wikipedia.org/wiki/ANSI_escape_code) for a more detailed discussion:
|
119
119
|
|
120
120
|
#### Often supported
|
121
121
|
|
@@ -188,7 +188,7 @@ There is an extension gem available which allows you to define custom color defi
|
|
188
188
|
|
189
189
|
## J-_-L
|
190
190
|
|
191
|
-
Copyright (c) 2011-
|
191
|
+
Copyright (c) 2011-2018 Jan Lelis <https://janlelis.com>, released under the
|
192
192
|
MIT license.
|
193
193
|
|
194
194
|
Thank you to [rainbow](https://github.com/sickill/rainbow) and [term-ansicolor](https://github.com/flori/term-ansicolor) for ideas and inspiration. Also, a lot of thanks to all the [contributors](https://github.com/janlelis/paint/contributors)!
|
data/lib/paint.rb
CHANGED
@@ -182,12 +182,10 @@ module Paint
|
|
182
182
|
end
|
183
183
|
else
|
184
184
|
case ENV['TERM']
|
185
|
-
when /-256color$/, 'xterm'
|
186
|
-
256
|
187
185
|
when /-color$/, 'rxvt'
|
188
186
|
16
|
189
187
|
else # optimistic default
|
190
|
-
|
188
|
+
TRUE_COLOR
|
191
189
|
end
|
192
190
|
end
|
193
191
|
end
|
@@ -226,7 +224,7 @@ module Paint
|
|
226
224
|
end
|
227
225
|
|
228
226
|
# Returns best ANSI color matching an RGB value, without fore-/background information
|
229
|
-
# See
|
227
|
+
# See https://mail.python.org/pipermail/python-list/2008-December/1150496.html
|
230
228
|
def rgb_to_ansi(red, green, blue, use_bright = false)
|
231
229
|
color_pool = RGB_COLORS_ANSI.values
|
232
230
|
color_pool += RGB_COLORS_ANSI_BRIGHT.values if use_bright
|
data/lib/paint/constants.rb
CHANGED
@@ -44,7 +44,7 @@ module Paint
|
|
44
44
|
}.freeze
|
45
45
|
|
46
46
|
# Terminal effects - most of them are not supported ;)
|
47
|
-
# See
|
47
|
+
# See https://en.wikipedia.org/wiki/ANSI_escape_code
|
48
48
|
ANSI_EFFECTS = {
|
49
49
|
:reset => 0, :nothing => 0, # usually supported
|
50
50
|
:bright => 1, :bold => 1, # usually supported
|
@@ -75,7 +75,7 @@ module Paint
|
|
75
75
|
}.freeze
|
76
76
|
|
77
77
|
# A list of color names for standard ansi colors, needed for 16/8 color fallback mode
|
78
|
-
# See
|
78
|
+
# See https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
|
79
79
|
RGB_COLORS_ANSI = {
|
80
80
|
:black => [ 0, 0, 0],
|
81
81
|
:red => [205, 0, 0],
|
@@ -88,7 +88,7 @@ module Paint
|
|
88
88
|
}.each { |k, v| v.freeze }.freeze
|
89
89
|
|
90
90
|
# A list of color names for standard bright ansi colors, needed for 16 color fallback mode
|
91
|
-
# See
|
91
|
+
# See https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
|
92
92
|
RGB_COLORS_ANSI_BRIGHT = {
|
93
93
|
:black => [127, 127, 127],
|
94
94
|
:red => [255, 0, 0],
|
data/lib/paint/version.rb
CHANGED
data/paint.gemspec
CHANGED
@@ -32,11 +32,10 @@ Gem::Specification.new do |s|
|
|
32
32
|
]
|
33
33
|
|
34
34
|
s.required_ruby_version = '>= 1.9.3'
|
35
|
-
s.requirements = ['Windows: ansicon (https://github.com/adoxa/ansicon) or ConEmu (http://code.google.com/p/conemu-maximus5)']
|
36
35
|
s.add_development_dependency 'rspec', '~> 3.2'
|
37
|
-
s.add_development_dependency 'rake', '~>
|
36
|
+
s.add_development_dependency 'rake', '~> 12.3'
|
38
37
|
s.add_development_dependency 'benchmark-ips', '~> 2.7'
|
39
|
-
s.add_development_dependency 'rainbow', '~>
|
38
|
+
s.add_development_dependency 'rainbow', '~> 3.0'
|
40
39
|
s.add_development_dependency 'term-ansicolor', '~> 1.4'
|
41
40
|
s.add_development_dependency 'ansi', '~> 1.5'
|
42
41
|
s.add_development_dependency 'hansi', '~> 0.2'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '12.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '12.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: benchmark-ips
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '3.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '3.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: term-ansicolor
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,8 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
-
requirements:
|
168
|
-
- 'Windows: ansicon (https://github.com/adoxa/ansicon) or ConEmu (http://code.google.com/p/conemu-maximus5)'
|
167
|
+
requirements: []
|
169
168
|
rubyforge_project:
|
170
169
|
rubygems_version: 2.7.7
|
171
170
|
signing_key:
|