{"id":15517842,"url":"https://github.com/hfm/mruby-publicsuffix","last_synced_at":"2025-10-15T04:28:12.418Z","repository":{"id":151129285,"uuid":"128382794","full_name":"hfm/mruby-publicsuffix","owner":"hfm","description":"Public Suffix List for mruby. The purpose of this project is mruby port of publicsuffix-ruby.","archived":false,"fork":false,"pushed_at":"2018-05-03T12:13:52.000Z","size":142,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T07:54:26.558Z","etag":null,"topics":["domain","mrbgem","mruby","psl","publicsuffix"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hfm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-06T10:49:15.000Z","updated_at":"2018-05-03T12:13:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"319bc33a-82ac-4cdd-9478-0e307ad0f73f","html_url":"https://github.com/hfm/mruby-publicsuffix","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfm%2Fmruby-publicsuffix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfm%2Fmruby-publicsuffix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfm%2Fmruby-publicsuffix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hfm%2Fmruby-publicsuffix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hfm","download_url":"https://codeload.github.com/hfm/mruby-publicsuffix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423494,"owners_count":20936622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["domain","mrbgem","mruby","psl","publicsuffix"],"created_at":"2024-10-02T10:14:22.162Z","updated_at":"2025-10-15T04:28:07.369Z","avatar_url":"https://github.com/hfm.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mruby-publicsuffix [![Build Status](https://travis-ci.org/hfm/mruby-publicsuffix.svg?branch=master)](https://travis-ci.org/hfm/mruby-publicsuffix)\n\n[Public Suffix List](https://publicsuffix.org/) for mruby. The purpose of this project is mruby port of [publicsuffix-ruby](https://github.com/weppos/publicsuffix-ruby).\n\n#### NOTE\n\nmruby-publicsuffix aims at porting from publicsuffix-ruby, but there's some differences, so it cannot provide totally the same functionality.\n\n## Requirements\n\n- mruby \u003e= 1.3.0\n\n## Installation\n\nYou can add conf.gem line to `build_config.rb`:\n\n```ruby\nMRuby::Build.new do |conf|\n\n    # ... (snip) ...\n\n    conf.gem mgem: 'mruby-publicsuffix'\nend\n```\n\n## PublicSuffix class methods\n\n### PublicSuffix.domain\n\n`PublicSuffix.domain` extracts the domain out from a given name and returns it as String class.\n\n```rb\nPublicSuffix.domain('google.com')\n# =\u003e \"google.com\"\n```\n\nIf given a domain with subdomains, returning the domain.\n\n```rb\nPublicSuffix.domain('www.google.com')\n# =\u003e \"google.com\"\nPublicSuffix.domain('www.google.co.uk')\n# =\u003e \"google.co.uk\"\n```\n\nThis library automatically recognizes FQDN (Fully Qualified Domain Names). A FQDN is a domain name that end with a trailing dot.\n\n```rb\nPublicSuffix.domain(\"www.google.com.\")\n# =\u003e \"google.com\"\n```\n\n### PublicSuffix.parse\n\n`PublicSuffix.parse` parses a domain and returns an object of `PublicSuffix::Domain` class. This method support a domain with subdomains.\n\n```rb\ndomain = PublicSuffix.parse('www.google.com')\n# =\u003e #\u003cPublicSuffix::Domain:0x7fa3bf84c9b0\u003e\n```\n\n### PublicSuffix.valid?\n\nChecks whether a given domain is assigned and allowed, without actually parsing it. This method doesn't care whether domain is a domain or subdomain. The validation is performed using the default [`PublicSuffix::List`](#publicsuffix-list).\n\nSimple validation example:\n\n```rb\nPublicSuffix.valid?(\"google.com\")\n# =\u003e true\n\n# Explicitly forbidden, it is listed as a private domain\n\u003e PublicSuffix.valid?(\"blogspot.com\")\n# =\u003e false\n\n# Unknown/not-listed TLD domains are valid by default\n\u003e PublicSuffix.valid?(\"example.tldnotlisted\")\n# =\u003e true\n```\n\nStrict validation (without applying the default * rule):\n\n```ruby\n\u003e PublicSuffix.valid?(\"example.tldnotlisted\", PublicSuffix::List.default, nil)\n# =\u003e false\n```\n\n## License\n\nunder the MIT License:\n- see LICENSE file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhfm%2Fmruby-publicsuffix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhfm%2Fmruby-publicsuffix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhfm%2Fmruby-publicsuffix/lists"}