Sha256: d4044d13e3d03fa9cd7c3f01af8544da543c6ec109d6266fc238fa4a4cc9fe4c

Contents?: true

Size: 351 Bytes

Versions: 1

Compression:

Stored size: 351 Bytes

Contents

module Tagomatic

  class UrlRemover

    def process(tags_hash)
      result = {}
      tags_hash.each do |tag,value|
        next unless value
        result[tag] = value.gsub(URL_REGEXP, '').gsub(/ by [a-zA-Z0-9]+[\w ]/, '')
      end
      result
    end

    URL_REGEXP = Regexp.compile("www\.[^\.]+\.[a-z]{2,4}", Regexp::IGNORECASE)

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tagomatic-0.1.9 lib/tagomatic/url_remover.rb