colorit 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,8 +5,12 @@ class String
5
5
  # colorize an arbitrary string
6
6
  #
7
7
  def colorize(pattern, color)
8
- gsub(pattern) do
9
- Colorit::Colors.all[color] + $& + Colorit::Colors.reset()
8
+ begin
9
+ gsub(pattern) do
10
+ Colorit::Colors.all[color] + $& + Colorit::Colors.reset()
11
+ end
12
+ rescue ArgumentError
13
+ # rescue from invalid byte sequence in UTF-8
10
14
  end
11
15
  end
12
- end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Colorit
2
- VERSION = %w(0 3 2)
2
+ VERSION = %w(0 3 3)
3
3
  end
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.2
4
+ version: 0.3.3
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-14 00:00:00.000000000 Z
12
+ date: 2012-12-18 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