Sha256: 54cb345cb3460aecf96a14a74f99ba33d486285821e06887dc493b498a476e80

Contents?: true

Size: 399 Bytes

Versions: 5

Compression:

Stored size: 399 Bytes

Contents

require 'despamilator/filter'

module DespamilatorFilter

  class IPAddressURL < Despamilator::Filter

    def name
      'IP Address URL'
    end

    def description
      'Detects IP address URLs'
    end

    def parse subject
      subject.register_match!({
          :score => 0.5, :filter => self
      }) if subject.text.downcase.count(/http:\/\/\d+\.\d+\.\d+\.\d+/) > 0
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
despamilator-2.1.4 lib/despamilator/filter/ip_address_url.rb
despamilator-2.1.3 lib/despamilator/filter/ip_address_url.rb
despamilator-2.1.2 lib/despamilator/filter/ip_address_url.rb
despamilator-2.1.1 lib/despamilator/filter/ip_address_url.rb
despamilator-2.1 lib/despamilator/filter/ip_address_url.rb