This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

removed periods from tags

  • Loading branch information...
ryanfelton committed Mar 31, 2008
1 parent 5dd744c commit 62d571404793749fbadf4bfa859e75f777ded9be
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/tag_list.rb
  2. +5 −0 test/tag_list_test.rb
View
@@ -78,7 +78,7 @@ class << self
# tag_list # ["One", "Two", "Three"]
def from(string)
returning new do |tag_list|
- string = string.to_s.dup
+ string = string.to_s.gsub('.', '').dup
# Parse the quoted tags
string.gsub!(/"(.*?)"\s*#{delimiter}?\s*/) { tag_list << $1; "" }
View
@@ -46,6 +46,11 @@ def test_from_removes_white_space
assert_equivalent %w(Alpha Beta), TagList.from('" Alpha ", "Beta "')
assert_equivalent %w(Alpha Beta), TagList.from(' Alpha, Beta ')
end
+
+ def test_from_removes_periods
+ assert_equivalent %w(Alpha Beta), TagList.from('Alpha., Beta')
+ assert_equivalent %w(Alpha Beta), TagList.from('Alpha, Be.ta')
+ end
def test_alternative_delimiter
TagList.delimiter = " "

0 comments on commit 62d5714

Please sign in to comment.