colorit 0.3.3 → 0.3.4
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.
- data/CHANGELOG.md +4 -0
- data/lib/colorit/string.rb +6 -1
- data/lib/colorit/version.rb +1 -1
- metadata +2 -2
data/CHANGELOG.md
CHANGED
data/lib/colorit/string.rb
CHANGED
|
@@ -10,7 +10,12 @@ class String
|
|
|
10
10
|
Colorit::Colors.all[color] + $& + Colorit::Colors.reset()
|
|
11
11
|
end
|
|
12
12
|
rescue ArgumentError
|
|
13
|
-
|
|
13
|
+
require 'iconv'
|
|
14
|
+
|
|
15
|
+
# rescue from invalid byte sequence in UTF-8 and convert it to UTF-8
|
|
16
|
+
# and ignore these sequences to get a safe string
|
|
17
|
+
ic = Iconv.new("UTF-8//IGNORE", "UTF-8")
|
|
18
|
+
ic.iconv(self).colorize(pattern, color)
|
|
14
19
|
end
|
|
15
20
|
end
|
|
16
21
|
end
|
data/lib/colorit/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: colorit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.4
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2012-12-
|
|
12
|
+
date: 2012-12-19 00:00:00.000000000 Z
|
|
13
13
|
dependencies: []
|
|
14
14
|
description: colorit colors your console outputs using regular expressions to emphasize
|
|
15
15
|
special words in e.g. logfiles
|