governor_tags 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ./
3
3
  specs:
4
- governor_tags (0.1.0)
4
+ governor_tags (0.1.1)
5
5
  governor (>= 0.5.2)
6
6
  rails (~> 3.0.5)
7
7
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -1,6 +1,8 @@
1
- <div class="tags">
2
- Tags:
3
- <% article.tags.each do |tag| %>
4
- <span class="tag"><%= link_to tag.name, tag %></span>
5
- <% end %>
6
- </div>
1
+ <% if article.tags.present? %>
2
+ <div class="tags">
3
+ Tags:
4
+ <% article.tags.each do |tag| %>
5
+ <span class="tag"><%= link_to tag.name, tag %></span>
6
+ <% end %>
7
+ </div>
8
+ <% end %>
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{governor_tags}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Liam Morley"]
@@ -4,7 +4,7 @@ module GovernorTags
4
4
  self.tags.map{|t| t.name }.join(GovernorTags.delimiter)
5
5
  end
6
6
  def tag_list=(tag_names)
7
- self.tags = tag_names.split(GovernorTags.delimiter).map{|t| Tag.find_or_create_by_name(t.strip) }
7
+ self.tags = tag_names.split(GovernorTags.delimiter).reject{|t| t.blank? }.map{|t| Tag.find_or_create_by_name(t.strip) }
8
8
  end
9
9
  end
10
10
  end
@@ -10,6 +10,14 @@ describe Article do
10
10
  article.tags.map(&:name).should == ['i fell in love again', 'all things go']
11
11
  end
12
12
 
13
+ it "trims blank tags" do
14
+ expect {
15
+ article.tag_list = 'drove to chicago, , all things know, all things know, '
16
+ article.save
17
+ }.to change{Tag.count}.from(0).to(2)
18
+ article.tags.map(&:name).should == ['drove to chicago', 'all things know']
19
+ end
20
+
13
21
  it "displays the list of tags" do
14
22
  article.tags = [Tag.create(:name => 'kicking ass'), Tag.create(:name => 'chewing bubblegum')]
15
23
  article.save
@@ -8,7 +8,7 @@ GIT
8
8
  PATH
9
9
  remote: ../..
10
10
  specs:
11
- governor_tags (0.1.0)
11
+ governor_tags (0.1.1)
12
12
  governor (>= 0.5.2)
13
13
  rails (~> 3.0.5)
14
14
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: governor_tags
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Liam Morley