dns_mock 1.5.18 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dns_mock.gemspec +1 -1
- data/lib/dns_mock/core.rb +3 -1
- data/lib/dns_mock/record/builder/srv.rb +19 -0
- data/lib/dns_mock/record/factory/srv.rb +15 -0
- data/lib/dns_mock/server/records_dictionary_builder.rb +1 -0
- data/lib/dns_mock/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b40bd3d487e18916bc75a021b1144e8ce3ed872a3b40d63773cda65783aebfa4
|
4
|
+
data.tar.gz: 9c3a3e3e1716c6b8bcca780c58c9fc5462a7d58ce5cc80653e1bc2f47ee92c23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07a3fdacd26e32152cb3bef24cdca0f5ae23a509cb29ddd504d92164ee1b2af01c1ec845f55e13968fdc35d11f4b748bafa0fba42523e4181efa408ff93e169c
|
7
|
+
data.tar.gz: c6542e5c989e3bb7f71823f7a63988ea711bff21430aa0f930aa8737cbf6856501b5d1acf7b81634864d0431cd4ee3a03576f454d1a68751d7709b5dee5a286a
|
data/dns_mock.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_runtime_dependency 'simpleidn', '~> 0.2.1'
|
33
33
|
|
34
34
|
spec.add_development_dependency 'ffaker', ffaker_version
|
35
|
-
spec.add_development_dependency 'net-ftp', '~> 0.3.
|
35
|
+
spec.add_development_dependency 'net-ftp', '~> 0.3.4' if current_ruby_version >= ::Gem::Version.new('3.1.0')
|
36
36
|
spec.add_development_dependency 'rake', '~> 13.1'
|
37
37
|
spec.add_development_dependency 'rspec', '~> 3.12'
|
38
38
|
spec.add_development_dependency 'rspec-dns', '~> 0.1.8'
|
data/lib/dns_mock/core.rb
CHANGED
@@ -4,7 +4,7 @@ require 'resolv'
|
|
4
4
|
require 'socket'
|
5
5
|
|
6
6
|
module DnsMock
|
7
|
-
AVAILABLE_DNS_RECORD_TYPES = %i[a aaaa cname mx ns ptr soa txt].freeze
|
7
|
+
AVAILABLE_DNS_RECORD_TYPES = %i[a aaaa cname mx ns ptr soa srv txt].freeze
|
8
8
|
|
9
9
|
module Error
|
10
10
|
require_relative '../dns_mock/error/argument_type'
|
@@ -33,6 +33,7 @@ module DnsMock
|
|
33
33
|
require_relative '../dns_mock/record/factory/ns'
|
34
34
|
require_relative '../dns_mock/record/factory/ptr'
|
35
35
|
require_relative '../dns_mock/record/factory/soa'
|
36
|
+
require_relative '../dns_mock/record/factory/srv'
|
36
37
|
require_relative '../dns_mock/record/factory/txt'
|
37
38
|
end
|
38
39
|
end
|
@@ -47,6 +48,7 @@ module DnsMock
|
|
47
48
|
require_relative '../dns_mock/record/builder/ns'
|
48
49
|
require_relative '../dns_mock/record/builder/ptr'
|
49
50
|
require_relative '../dns_mock/record/builder/soa'
|
51
|
+
require_relative '../dns_mock/record/builder/srv'
|
50
52
|
require_relative '../dns_mock/record/builder/txt'
|
51
53
|
end
|
52
54
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DnsMock
|
4
|
+
module Record
|
5
|
+
module Builder
|
6
|
+
class Srv < DnsMock::Record::Builder::Base
|
7
|
+
FACTORY_ARGS_ORDER = %i[priority weight port target].freeze
|
8
|
+
|
9
|
+
def build
|
10
|
+
records_data.map do |record_data|
|
11
|
+
target_factory.new(
|
12
|
+
record_data: record_data.values_at(*DnsMock::Record::Builder::Srv::FACTORY_ARGS_ORDER)
|
13
|
+
).create
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DnsMock
|
4
|
+
module Record
|
5
|
+
module Factory
|
6
|
+
Srv = ::Class.new(DnsMock::Record::Factory::Base) do
|
7
|
+
record_type :srv
|
8
|
+
|
9
|
+
def instance_params
|
10
|
+
record_data[0..-2] << create_dns_name(record_data.last)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -15,6 +15,7 @@ module DnsMock
|
|
15
15
|
[DnsMock::Record::Builder::Ns, DnsMock::Record::Factory::Ns, ::Array],
|
16
16
|
[DnsMock::Record::Builder::Ptr, DnsMock::Record::Factory::Ptr, ::Array],
|
17
17
|
[DnsMock::Record::Builder::Soa, DnsMock::Record::Factory::Soa, ::Array],
|
18
|
+
[DnsMock::Record::Builder::Srv, DnsMock::Record::Factory::Srv, ::Array],
|
18
19
|
[DnsMock::Record::Builder::Txt, DnsMock::Record::Factory::Txt, ::Array]
|
19
20
|
]
|
20
21
|
).to_h.freeze
|
data/lib/dns_mock/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dns_mock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladislav Trotsenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simpleidn
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- lib/dns_mock/record/builder/ns.rb
|
113
113
|
- lib/dns_mock/record/builder/ptr.rb
|
114
114
|
- lib/dns_mock/record/builder/soa.rb
|
115
|
+
- lib/dns_mock/record/builder/srv.rb
|
115
116
|
- lib/dns_mock/record/builder/txt.rb
|
116
117
|
- lib/dns_mock/record/factory/a.rb
|
117
118
|
- lib/dns_mock/record/factory/aaaa.rb
|
@@ -121,6 +122,7 @@ files:
|
|
121
122
|
- lib/dns_mock/record/factory/ns.rb
|
122
123
|
- lib/dns_mock/record/factory/ptr.rb
|
123
124
|
- lib/dns_mock/record/factory/soa.rb
|
125
|
+
- lib/dns_mock/record/factory/srv.rb
|
124
126
|
- lib/dns_mock/record/factory/txt.rb
|
125
127
|
- lib/dns_mock/representer/punycode.rb
|
126
128
|
- lib/dns_mock/representer/rdns_lookup.rb
|