colors 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/changelog.txt +3 -1
- data/colors.gemspec +2 -2
- data/lib/colors/string.rb +1 -1
- metadata +2 -2
data/changelog.txt
CHANGED
data/colors.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "colors"
|
3
|
-
s.version = "0.0.
|
4
|
-
s.date = "2009-
|
3
|
+
s.version = "0.0.7"
|
4
|
+
s.date = "2009-12-07"
|
5
5
|
s.summary = "Ruby String extesion for colored strings"
|
6
6
|
s.email = "apohllo@o2.pl"
|
7
7
|
s.homepage = "http://github.com/apohllo/colors"
|
data/lib/colors/string.rb
CHANGED
@@ -34,7 +34,7 @@ class String
|
|
34
34
|
# => *abc* abcd
|
35
35
|
def hl(type=:bold,word=nil)
|
36
36
|
if word
|
37
|
-
self.gsub(/(\s|\A|[[:
|
37
|
+
self.gsub(/(\s|\A|[^[:alnum:]])#{word}(\s|\Z|[^[:alnum:]])/,
|
38
38
|
"\\1" + HIGHLIGHT[type] + word.to_s + HIGHLIGHT[:end] + "\\2")
|
39
39
|
else
|
40
40
|
HIGHLIGHT[type] + self.to_s + HIGHLIGHT[:end]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: colors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksander Pohl
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-12-07 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|