has_meta 0.0.5 → 0.0.6

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.
@@ -1,3 +1,3 @@
1
1
  module HasMeta
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/lib/has_meta.rb CHANGED
@@ -28,7 +28,7 @@ module HasMeta
28
28
  str.gsub!(/<.*?>/, '')
29
29
 
30
30
  if meth.to_s == 'keywords'
31
- str = str.gsub(/[\s,]+/, ',').
31
+ str = str.gsub(/[\s,]{2,}/, ',').
32
32
  gsub(/\s+/, ' ').
33
33
  gsub(/^,|,$/, '').
34
34
  strip
@@ -55,6 +55,11 @@ class HasMetaTest < Test::Unit::TestCase
55
55
  assert_equal "one,two,three", @widget.meta_keywords
56
56
  end
57
57
 
58
+ def test_treat_keywords_special_but_not_too_special
59
+ @widget.keywords = " , , one two, , three , , "
60
+ assert_equal "one two,three", @widget.meta_keywords
61
+ end
62
+
58
63
  def test_do_not_treat_description_special
59
64
  @widget.short_description = " , , one , , two , three , , "
60
65
  assert_equal ", , one , , two , three , ,", @widget.meta_description
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_meta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: