domain_validator_jp 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1a41437d9423bb9434a7eefc919c1dd9cbdd0cab96262321727b85bb3f318f6
4
- data.tar.gz: aa9f48b138c4289323d5736fe5d118a3cbe3a9ad226776504b480d25a032bd64
3
+ metadata.gz: 6414fcda79ce32da66b829db6714aff5bc106c7eb629224a113d00adf657bff6
4
+ data.tar.gz: '04264973d3a03291412cecdcd6f20b625b4b63df84bb3ae306a4bc0bf688a2a3'
5
5
  SHA512:
6
- metadata.gz: d3c9a328b013c73bbd1d89f53b6313386c492c559bb4480f80e0b8c68d9c6bf7f37787db93dc9fe8e02af9659469b8eefe8d75fb1bd721eb1e37ee7abe4e60e4
7
- data.tar.gz: 5cdb5479bf250f1defcad59bb2e84382e732443b8aae3e60b0dede175e828d33a30fac9914cc321a62202a6f6e3ae185b13f6916b91e15da0f19d9a6bef1223e
6
+ metadata.gz: 911010e0d1243d4b5291185a7438261a1fdb89032aeb1d2aedb202c231475740c96899499d95a000fe7a561d0c3ffecfe0a5b74ab5e330dfc1904839c84007ba
7
+ data.tar.gz: 6591cb721d82b5358c6a20c3ea543d8f7a6ce3e2f521136ddbd91e529b615627d001f7fa57c561a56c370fbad74167199cb3c2afb74d54311b4e18a2092001d7
@@ -5,6 +5,7 @@ module DomainValidatorJp
5
5
  class << self
6
6
  def valid?(domain)
7
7
  return false unless fqdn?(domain)
8
+ return false unless valid_sld_included?(domain)
8
9
  return false if include_subdomain?(domain)
9
10
  return false unless valid_public_suffix?(domain)
10
11
  return false unless valid_sld_not_dotted?(domain)
@@ -36,12 +37,16 @@ module DomainValidatorJp
36
37
 
37
38
  # common
38
39
 
40
+ def valid_sld_included?(domain)
41
+ !!parsed(domain).sld
42
+ end
43
+
39
44
  def include_subdomain?(domain)
40
45
  !parsed(domain).subdomain.nil?
41
46
  end
42
47
 
43
48
  def valid_public_suffix?(domain)
44
- PublicSuffix.valid?(domain, default_rule: nil, ignore_private: true)
49
+ PublicSuffix.valid?(domain, default_rule: nil)
45
50
  end
46
51
 
47
52
  def valid_sld_not_dotted?(domain)
@@ -1,3 +1,3 @@
1
1
  module DomainValidatorJp
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domain_validator_jp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kimromi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-23 00:00:00.000000000 Z
11
+ date: 2018-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: public_suffix