fluorescent 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fluorescent.rb +4 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f6908fe9d74e9c6ff92248c064aaa777e2c6e11
4
- data.tar.gz: 97960713c3cde86ae2cf5ca31b76834147b94b73
3
+ metadata.gz: dead7f0860616d65d989719831234efc15a797b6
4
+ data.tar.gz: 0bc4d5ff5dc24b314d279d26b1999b8d3f3ab09d
5
5
  SHA512:
6
- metadata.gz: eef1ea24dfbed1ad5ff5c62e5ee1c240d9cf6adf6e01107a25d393c8275abd54e8124b299355da0512114ff594319685b25c8062e12983990ad0326388b49506
7
- data.tar.gz: a9f0a1e5a7f8f53ea87de472e016200726d74de404dc1223cf4d8c94632d20c67b8c6e647ae338300322d0a82024a2451bbc9d36dae8f048f8d37cfdf66cb1f2
6
+ metadata.gz: 95e3557c2c66dba40a0248f1da7705af8a50bb3c579d17d2f69dd1d570418e60e18ae7085b9bc3041cc512afff50953d675eab2c907be3a26f756b8097bc1caf
7
+ data.tar.gz: 394385c82e25a6d05cfd57864300177dc4cc0aba9b15b2d48afaf1ffb76789296f9dd2e3da9026c29d0984cc77d66865c4628e74b8fd33cb4af942280cf256b5
@@ -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[0]) != nil
44
+ if string.index(@terms) != nil
45
45
  row[c] = highlight string[
46
46
  string.index(@terms[0]),
47
- string.index(@terms[0]) + string.length + @padding
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluorescent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Devin Austin