Sha256: 75717b46fc6832ab74b56d349b298caab0f424bb13dd443cc9b86a48af88900f

Contents?: true

Size: 1.11 KB

Versions: 5

Compression:

Stored size: 1.11 KB

Contents

#--
# Public Suffix
#
# Domain name parser based on the Public Suffix List.
#
# Copyright (c) 2009-2013 Simone Carletti <weppos@weppos.net>
#++


module PublicSuffix

  class Error < StandardError
  end

  # Raised when trying to parse an invalid domain.
  # A domain is considered invalid when no rule is found
  # in the definition list.
  #
  # @example
  #
  #   PublicSuffix.parse("nic.test")
  #   # => PublicSuffix::DomainInvalid
  #
  #   PublicSuffix.parse("http://www.nic.it")
  #   # => PublicSuffix::DomainInvalid
  #
  # @since 0.6.0
  #
  class DomainInvalid < Error
  end

  # Raised when trying to parse a domain
  # which is formally defined by a rule,
  # but the rules set a requirement which is not satisfied
  # by the input you are trying to parse.
  #
  # @example
  #
  #   PublicSuffix.parse("nic.do")
  #   # => PublicSuffix::DomainNotAllowed
  #
  #   PublicSuffix.parse("www.nic.do")
  #   # => PublicSuffix::Domain
  #
  # @since 0.6.0
  #
  class DomainNotAllowed < DomainInvalid
  end


  # Backward Compatibility
  #
  # @deprecated Use {PublicSuffix::DomainInvalid}.
  #
  InvalidDomain = DomainInvalid

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
public_suffix-1.3.3 lib/public_suffix/errors.rb
public_suffix-1.3.2 lib/public_suffix/errors.rb
public_suffix-1.3.1 lib/public_suffix/errors.rb
public_suffix-1.3.0 lib/public_suffix/errors.rb
public_suffix-1.2.1 lib/public_suffix/errors.rb