Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

domain_name

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

domain_name

  • 0.6.20240107
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

domain_name

Synopsis

Domain Name manipulation library for Ruby

Description

  • Parses a domain name ready for extracting the registered domain and TLD.

      require "domain_name"
    
      host = DomainName("a.b.example.co.uk")
      host.domain         #=> "example.co.uk"
      host.tld            #=> "uk"
      host.cookie_domain?("example.co.uk")    #=> true
      host.cookie_domain?("co.uk")            #=> false
    
      host = DomainName("[::1]")  # IP addresses like "192.168.1.1" and "::1" are also acceptable
      host.ipaddr?        #=> true
      host.cookie_domain?("0:0:0:0:0:0:0:1")  #=> true
    
  • Implements rudimental IDNA support.

To-do's

  • Implement IDNA 2008 (and/or 2003) including the domain label validation and mapping defined in RFC 5891-5895 and UTS #46. (work in progress)

  • Define a compact YAML serialization format.

Installation

gem install domain_name

References

  • RFC 3492 (Obsolete; just for test cases)

  • RFC 5890

  • RFC 5891

  • RFC 5892

  • RFC 5893

  • Public Suffix List

License

Copyright (c) 2011-2017 Akinori MUSHA

Licensed under the 2-clause BSD license.

Some portion of this library is copyrighted by third parties and licensed under MPL 2.0 or 3-clause BSD license, See LICENSE.txt for details.

FAQs

Package last updated on 09 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc