colorize 0.7.2 → 0.7.3
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/CHANGELOG +3 -0
- data/README.md +1 -1
- data/colorize.gemspec +1 -1
- data/lib/colorize.rb +1 -1
- data/test/test_colorize.rb +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a859d7f8f8090ca83efe597653bebfba1b23663
|
4
|
+
data.tar.gz: d088577a685ef33228b8d1f113d5caadbe31c0d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8764f7d7590f39a5f08993fab8e972c780924405c893c6bf9915f19778d7a502bd73f34fb87ced20abe2f98de8db1bb252e3d521f8715b3c7cafbdd7cf932351
|
7
|
+
data.tar.gz: a96ab1eaa3e6d7e2f0a7ed0aaa4d11ec56476e0418784f57f85816c6b6c32d44ed267f3a68abc1743dbe11efbfb556ae90bcb7e94a18ba016ecba6a87f2a1751
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
colorize
|
1
|
+
colorize [](http://badge.fury.io/rb/colorize)
|
2
2
|
========
|
3
3
|
|
4
4
|
Ruby String class extension. Adds methods to set text color, background color and, text effects on ruby console and command line output, using ANSI escape sequences.
|
data/colorize.gemspec
CHANGED
data/lib/colorize.rb
CHANGED
@@ -39,7 +39,7 @@ class String
|
|
39
39
|
:hide => 8 # Hide text (foreground color would be the same as background)
|
40
40
|
}
|
41
41
|
|
42
|
-
REGEXP_PATTERN = /\033\[([0-9]+);([0-9]+);([0-9]+)m(.+?)\033\[0m|([^\033]+)/
|
42
|
+
REGEXP_PATTERN = /\033\[([0-9]+);([0-9]+);([0-9]+)m(.+?)\033\[0m|([^\033]+)/m
|
43
43
|
COLOR_OFFSET = 30
|
44
44
|
BACKGROUND_OFFSET = 40
|
45
45
|
|
data/test/test_colorize.rb
CHANGED
@@ -80,10 +80,17 @@ class TestColorize < Test::Unit::TestCase
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def test_concatenated_strings_uncolorize
|
83
|
-
|
83
|
+
assert_equal ('none' + 'red'.red + 'none' + 'blue'.blue + 'none').uncolorize,
|
84
|
+
"nonerednonebluenone"
|
84
85
|
end
|
85
86
|
|
86
87
|
def test_frozen_strings
|
87
|
-
|
88
|
+
assert_equal 'This is blue text on red'.freeze.blue.on_red.blink,
|
89
|
+
"\e[5;34;41mThis is blue text on red\e[0m"
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_new_line
|
93
|
+
assert_equal "This is blue\ntext on red".freeze.blue.on_red.blink,
|
94
|
+
"\e[5;34;41mThis is blue\ntext on red\e[0m"
|
88
95
|
end
|
89
96
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: colorize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fazibear
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby String class extension. Adds methods to set text color, background
|
14
14
|
color and, text effects on ruby console and command line output, using ANSI escape
|