engines/adva_cms/vendor/plugins/simple_taggable/lib/tag_list.rb
def from(*strings)
      strings = strings.flatten
      returning new do |tag_list|
        strings.each do |string|
          string = string.to_s.dup
      
          # Parse the quoted tags
          string.gsub!(/"(.*?)"\s*#{delimiter}?\s*/) { tag_list << $1; "" }
          string.gsub!(/'(.*?)'\s*#{delimiter}?\s*/) { tag_list << $1; "" }
      
          tag_list.add(string.split(delimiter))
        end
      end
    end
# Returns a new TagList using the given tag string.
# 
#   tag_list = TagList.from("One , Two,  Three")
#   tag_list # ["One", "Two", "Three"]
Returns a new TagList using the given tag string.
Returns a new TagList using the given tag string .
def from(*strings)
      strings = strings.flatten
      returning new do |tag_list|
        strings.each do |string|
          string = string.to_s.dup
          string.gsub!(/"(.*?)"\s*#{delimiter}?\s*/) { tag_list << $1; "" }
          string.gsub!(/'(.*?)'\s*#{delimiter}?\s*/) { tag_list << $1; "" }
          tag_list.add(string.split(delimiter))
        end
      end
    end
def from ( * strings ) strings = strings . flatten returning new do | tag_list | strings . each do | string | string = string . to_s . dup string . gsub! ( / "(.*?)" \s * #{ delimiter } ? \s * / ) { tag_list << $1 ; "" } string . gsub! ( / '(.*?)' \s * #{ delimiter } ? \s * / ) { tag_list << $1 ; "" } tag_list . add ( string . split ( delimiter ) ) end end end
Returns a new TagList using the given tag string.
Returns a new TagList using the given tag string .
# Parse the quoted tags
strings