fluorescent 0.0.6 → 0.0.7
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/lib/fluorescent.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dead7f0860616d65d989719831234efc15a797b6
|
4
|
+
data.tar.gz: 0bc4d5ff5dc24b314d279d26b1999b8d3f3ab09d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95e3557c2c66dba40a0248f1da7705af8a50bb3c579d17d2f69dd1d570418e60e18ae7085b9bc3041cc512afff50953d675eab2c907be3a26f756b8097bc1caf
|
7
|
+
data.tar.gz: 394385c82e25a6d05cfd57864300177dc4cc0aba9b15b2d48afaf1ffb76789296f9dd2e3da9026c29d0984cc77d66865c4628e74b8fd33cb4af942280cf256b5
|
data/lib/fluorescent.rb
CHANGED
@@ -41,11 +41,13 @@ class Fluorescent
|
|
41
41
|
row[c] = highlight string # need to find a better way to do this
|
42
42
|
if @to_filter.include? c
|
43
43
|
# if nothing matches, we don't want to try to highlight
|
44
|
-
if string.index(@terms
|
44
|
+
if string.index(@terms) != nil
|
45
45
|
row[c] = highlight string[
|
46
46
|
string.index(@terms[0]),
|
47
|
-
string.index(@terms[0]) +
|
47
|
+
string.index(@terms[0]) + @terms.length + @padding
|
48
48
|
] << "..."
|
49
|
+
else
|
50
|
+
row[c] = string[0, @terms.length + @padding] << "..."
|
49
51
|
end
|
50
52
|
end
|
51
53
|
end
|