dns_mock 1.5.18 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f174fa637e6643e8794740c4c0981f85970e70dd50f28ce006ebce986d775af7
4
- data.tar.gz: 7ad04e38cf561bae95d939392aa55f142902061a6206e661789a57da5b65b7df
3
+ metadata.gz: dcddee0018779f39a139021d2aae0c2454df9e65acb2628400186c549a2ce060
4
+ data.tar.gz: 4bfec3c5b4f76f34498b4dddb264e8ed458d81190c8cc7de6f1a6b68e6b824d5
5
5
  SHA512:
6
- metadata.gz: 4b15bf30d5d84d6fe6ef614b7c1c06a4264a52798c504ee01739774695f7079c75d737eca4bf49a8ace9e5f9876313eeefe9f42f5c0faadf96f1000c58d872b7
7
- data.tar.gz: dd0d72e575d4f566ea133dfcaadef4b8a6d22f5ae952904e7898db769a07d940a5c10c770a8a4abfc7b51530bd0fc4cf7fdf65d5fb700761c9b388b002b06385
6
+ metadata.gz: d82a0ae326f6f15a94c5b74130706982ae75bf37fb3eb6fae6d7168de8b94b0999652a11eca03eca4e6c8213516510db994ed098201d632b84264b6ca10808d8
7
+ data.tar.gz: b498e282339912481d19ecf4cc5226b66379e9df4741f5293f41e5b3861668fe293653e0e60a5571e558149bf242f9e5e4369340de1013e072fceb3ae3d600ff
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DnsMock
4
- VERSION = '1.5.18'
4
+ VERSION = '1.6.0'
5
5
  end
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.5.18
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-03 00:00:00.000000000 Z
11
+ date: 2024-01-05 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