ts_vector_tags 0.0.3 → 0.0.4

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.
@@ -5,7 +5,7 @@ module TsVectorTags
5
5
  class << self
6
6
  def tagify(tags)
7
7
  tags = tags.split(/\s*,\s*/) if tags.is_a?(String)
8
- tags.map!{ |tag| self.normalize(tag) }
8
+ tags.map{ |tag| self.normalize(tag) }.reject(&:empty?)
9
9
  end
10
10
 
11
11
  def normalize(tag)
@@ -13,6 +13,10 @@ describe TsVectorTags::Standardizer do
13
13
  it "normalizes tags in an arrayarray" do
14
14
  TsVectorTags::Standardizer.tagify(['abc-!@ #$ ', ' %^&*()123']).should eq(['abc', '123'])
15
15
  end
16
+
17
+ it "removes empty tags" do
18
+ TsVectorTags::Standardizer.tagify(['abc', ' %^&*()']).should eq(['abc'])
19
+ end
16
20
  end
17
21
 
18
22
  class Thing
@@ -2,7 +2,7 @@
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  module TsVectorTags
5
- VERSION = "0.0.3"
5
+ VERSION = "0.0.4"
6
6
  end
7
7
 
8
8
  Gem::Specification.new do |s|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ts_vector_tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2012-08-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
17
- requirement: &70341718185420 !ruby/object:Gem::Requirement
17
+ requirement: &70175417969460 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: '0'
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *70341718185420
25
+ version_requirements: *70175417969460
26
26
  description: Extremely simple, if somewhat exotic, mixin that uses the tsvector feature
27
27
  in postgresql to add tags to an ActiveRecord model.
28
28
  email: