domaine 0.0.1 → 0.0.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/domaine.rb +10 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7e37994d5946c8fa55cd697bee0a263bf0da228d47673ae0411f1c72ef1e82d
4
- data.tar.gz: afc03abbdf2792339d7a574c8ff972e1e060a0ebd62ea493576b93e4b2be876d
3
+ metadata.gz: 98fa076889bdb4e01b64ad399d3f050600b84b9c40f176e1140aba883af69b4e
4
+ data.tar.gz: 1add7fa2feeb7c26c434d98e6d9f9f6ffbb1ffa4eb41c18107d6191bf65fb846
5
5
  SHA512:
6
- metadata.gz: 772cceffb99cddda729c8a2d57be8caf019248ae26f7c796373560a3b9a2b71c6329cd5ed08f345cb00571e0f75749c20bd24577cfee673fefe7d99639b10172
7
- data.tar.gz: f6c8721e06dcecc7f0f0118ff41f20a3757c05c9395f24b0bb2bef2606bf5fefc3401c93324e1096b0da6e31f8b6f8ef1d2c43daeb9649356fa5785b032fd75a
6
+ metadata.gz: b730a6044f8547c7e9c2c1e25d2264bca9e5814bc52b4875540bddf70bb68a6fcf160779779c76b0c38aead43b29b5232707a4274aa9f15511bc1604ae1b406d
7
+ data.tar.gz: 9f858fd5c454ba4eedbd03804ad629f33ce1a362ec48aca78f1e061462e64438aa302f1ca50b81259b8951d520ecec3b34205bf5b81f7ea21c2d2a7199bf0d3a
data/lib/domaine.rb CHANGED
@@ -1,11 +1,20 @@
1
1
  module Domain
2
+
3
+ VALID_DKIM_KEY = 'ANSWER: 1'.freeze
4
+
5
+ ##################################################################
6
+ # This method is used to validate the domain and selector and return
7
+ # true if the domain and selector are listed in the DNS records.
8
+ ##################################################################
2
9
  def self.valid_dkim(domain, selector)
3
10
  dig_command = "dig txt #{selector}._domainkey.#{domain}"
4
11
  valid_domain = false
12
+
5
13
  IO.popen(dig_command) do |stdout|
6
14
  output = stdout.read
7
- valid_domain = "output: #{output.include? 'ANSWER: 1'}" if output
15
+ valid_domain = output.include?(VALID_DKIM_KEY) if output
8
16
  end
17
+
9
18
  valid_domain
10
19
  end
11
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domaine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Kadlec
@@ -17,7 +17,7 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/domaine.rb
20
- homepage: https://rubygems.org/gems/hola
20
+ homepage: https://github.com/mkadlec/domaine
21
21
  licenses:
22
22
  - MIT
23
23
  metadata: {}