dns_mock 1.5.17 → 1.6.0
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 +6 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcddee0018779f39a139021d2aae0c2454df9e65acb2628400186c549a2ce060
|
4
|
+
data.tar.gz: 4bfec3c5b4f76f34498b4dddb264e8ed458d81190c8cc7de6f1a6b68e6b824d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d82a0ae326f6f15a94c5b74130706982ae75bf37fb3eb6fae6d7168de8b94b0999652a11eca03eca4e6c8213516510db994ed098201d632b84264b6ca10808d8
|
7
|
+
data.tar.gz: b498e282339912481d19ecf4cc5226b66379e9df4741f5293f41e5b3861668fe293653e0e60a5571e558149bf242f9e5e4369340de1013e072fceb3ae3d600ff
|
data/dns_mock.gemspec
CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
|
34
34
|
spec.add_development_dependency 'ffaker', ffaker_version
|
35
35
|
spec.add_development_dependency 'net-ftp', '~> 0.3.3' if current_ruby_version >= ::Gem::Version.new('3.1.0')
|
36
|
-
spec.add_development_dependency 'rake', '~> 13.
|
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'
|
39
39
|
end
|
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.0
|
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-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simpleidn
|
@@ -44,20 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '13.
|
48
|
-
- - ">="
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: 13.0.6
|
47
|
+
version: '13.1'
|
51
48
|
type: :development
|
52
49
|
prerelease: false
|
53
50
|
version_requirements: !ruby/object:Gem::Requirement
|
54
51
|
requirements:
|
55
52
|
- - "~>"
|
56
53
|
- !ruby/object:Gem::Version
|
57
|
-
version: '13.
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 13.0.6
|
54
|
+
version: '13.1'
|
61
55
|
- !ruby/object:Gem::Dependency
|
62
56
|
name: rspec
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -118,6 +112,7 @@ files:
|
|
118
112
|
- lib/dns_mock/record/builder/ns.rb
|
119
113
|
- lib/dns_mock/record/builder/ptr.rb
|
120
114
|
- lib/dns_mock/record/builder/soa.rb
|
115
|
+
- lib/dns_mock/record/builder/srv.rb
|
121
116
|
- lib/dns_mock/record/builder/txt.rb
|
122
117
|
- lib/dns_mock/record/factory/a.rb
|
123
118
|
- lib/dns_mock/record/factory/aaaa.rb
|
@@ -127,6 +122,7 @@ files:
|
|
127
122
|
- lib/dns_mock/record/factory/ns.rb
|
128
123
|
- lib/dns_mock/record/factory/ptr.rb
|
129
124
|
- lib/dns_mock/record/factory/soa.rb
|
125
|
+
- lib/dns_mock/record/factory/srv.rb
|
130
126
|
- lib/dns_mock/record/factory/txt.rb
|
131
127
|
- lib/dns_mock/representer/punycode.rb
|
132
128
|
- lib/dns_mock/representer/rdns_lookup.rb
|