dns_mock 1.5.5 → 1.5.6
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 +3 -2
- data/lib/dns_mock/version.rb +1 -1
- metadata +4 -28
- data/.circleci/config.yml +0 -139
- data/.circleci/gemspec_compatible +0 -38
- data/.circleci/gemspec_latest +0 -48
- data/.codeclimate.yml +0 -13
- data/.github/BRANCH_NAMING_CONVENTION.md +0 -36
- data/.github/DEVELOPMENT_ENVIRONMENT_GUIDE.md +0 -26
- data/.github/FUNDING.yml +0 -1
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -28
- data/.github/ISSUE_TEMPLATE/feature_request.md +0 -27
- data/.github/ISSUE_TEMPLATE/issue_report.md +0 -28
- data/.github/ISSUE_TEMPLATE/question.md +0 -22
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -49
- data/.gitignore +0 -11
- data/.overcommit.yml +0 -32
- data/.reek.yml +0 -65
- data/.rspec +0 -2
- data/.rubocop.yml +0 -123
- data/.ruby-gemset +0 -1
- data/CHANGELOG.md +0 -381
- data/CODE_OF_CONDUCT.md +0 -74
- data/CONTRIBUTING.md +0 -48
- data/Gemfile +0 -5
- data/README.md +0 -201
- data/Rakefile +0 -8
data/.reek.yml
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
detectors:
|
2
|
-
IrresponsibleModule:
|
3
|
-
enabled: false
|
4
|
-
|
5
|
-
NestedIterators:
|
6
|
-
exclude:
|
7
|
-
- DnsMock::Server::RecordsDictionaryBuilder#build
|
8
|
-
|
9
|
-
UtilityFunction:
|
10
|
-
exclude:
|
11
|
-
- DnsMock::Server::RecordsDictionaryBuilder#build_records_instances_by_type
|
12
|
-
- DnsMock::RecordsDictionaryHelper#hostname_records_by_type
|
13
|
-
- DnsMock::DnsMessageHelper#to_dns_name
|
14
|
-
- DnsMock::ContextGeneratorHelper#random_dns_record_type
|
15
|
-
- DnsMock::ContextGeneratorHelper#random_hostname
|
16
|
-
- DnsMock::ContextGeneratorHelper#create_dns_name
|
17
|
-
- DnsMock::ContextGeneratorHelper#random_ip_v4_address
|
18
|
-
- DnsMock::ContextGeneratorHelper#random_ip_v6_address
|
19
|
-
- DnsMock::ContextGeneratorHelper#random_txt_record_context
|
20
|
-
- DnsMock::ContextGeneratorHelper#to_punycode_hostname
|
21
|
-
- DnsMock::RecordsDictionaryHelper#create_records_dictionary_by_records
|
22
|
-
- DnsMock::ServerHelper#start_random_server
|
23
|
-
- DnsMock::ServerHelper#stop_all_running_servers
|
24
|
-
- DnsMock::ContextGeneratorHelper#random_port_number
|
25
|
-
- DnsMock::TestFramework::RSpec::Helper#dns_mock_server
|
26
|
-
- DnsMock::ContextGeneratorHelper#to_rdns_hostaddress
|
27
|
-
|
28
|
-
DuplicateMethodCall:
|
29
|
-
exclude:
|
30
|
-
- DnsMock::ContextGeneratorHelper#create_records
|
31
|
-
|
32
|
-
ControlParameter:
|
33
|
-
exclude:
|
34
|
-
- DnsMock::Error::Helper#raise_unless
|
35
|
-
- DnsMock::Server#initialize
|
36
|
-
- DnsMock::ContextGeneratorHelper#to_punycode_hostname
|
37
|
-
|
38
|
-
MissingSafeMethod:
|
39
|
-
exclude:
|
40
|
-
- DnsMock::PortInUseHelper::TransportService
|
41
|
-
- DnsMock::Server
|
42
|
-
|
43
|
-
TooManyStatements:
|
44
|
-
exclude:
|
45
|
-
- DnsMock::Server::RecordsDictionaryBuilder#build
|
46
|
-
- DnsMock::Server#initialize
|
47
|
-
- DnsMock::Server#run
|
48
|
-
|
49
|
-
TooManyInstanceVariables:
|
50
|
-
exclude:
|
51
|
-
- DnsMock::Server
|
52
|
-
|
53
|
-
LongParameterList:
|
54
|
-
exclude:
|
55
|
-
- DnsMock::Server#initialize
|
56
|
-
- DnsMock#start_server
|
57
|
-
|
58
|
-
BooleanParameter:
|
59
|
-
exclude:
|
60
|
-
- DnsMock::Server#initialize
|
61
|
-
- DnsMock#start_server
|
62
|
-
|
63
|
-
NilCheck:
|
64
|
-
exclude:
|
65
|
-
- DnsMock::Record::Builder::Mx#build
|
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1,123 +0,0 @@
|
|
1
|
-
require:
|
2
|
-
- rubocop-rspec
|
3
|
-
- rubocop-performance
|
4
|
-
|
5
|
-
AllCops:
|
6
|
-
DisplayCopNames: true
|
7
|
-
DisplayStyleGuide: true
|
8
|
-
TargetRubyVersion: 2.5
|
9
|
-
NewCops: enable
|
10
|
-
|
11
|
-
# Metrics ---------------------------------------------------------------------
|
12
|
-
|
13
|
-
Metrics/ClassLength:
|
14
|
-
Max: 150
|
15
|
-
|
16
|
-
Metrics/MethodLength:
|
17
|
-
Max: 15
|
18
|
-
|
19
|
-
Metrics/BlockLength:
|
20
|
-
Enabled: false
|
21
|
-
|
22
|
-
Metrics/CyclomaticComplexity:
|
23
|
-
Enabled: false
|
24
|
-
|
25
|
-
Metrics/PerceivedComplexity:
|
26
|
-
Enabled: false
|
27
|
-
|
28
|
-
# Naming ----------------------------------------------------------------------
|
29
|
-
|
30
|
-
Naming/VariableNumber:
|
31
|
-
Enabled: false
|
32
|
-
|
33
|
-
Naming/RescuedExceptionsVariableName:
|
34
|
-
Enabled: false
|
35
|
-
|
36
|
-
Naming/InclusiveLanguage:
|
37
|
-
Enabled: false
|
38
|
-
|
39
|
-
# Style -----------------------------------------------------------------------
|
40
|
-
|
41
|
-
Style/Documentation:
|
42
|
-
Enabled: false
|
43
|
-
|
44
|
-
Style/DoubleNegation:
|
45
|
-
Enabled: false
|
46
|
-
|
47
|
-
Style/EmptyCaseCondition:
|
48
|
-
Enabled: false
|
49
|
-
|
50
|
-
Style/ParallelAssignment:
|
51
|
-
Enabled: false
|
52
|
-
|
53
|
-
Style/RescueStandardError:
|
54
|
-
Enabled: false
|
55
|
-
|
56
|
-
# Layout ----------------------------------------------------------------------
|
57
|
-
|
58
|
-
Layout/LineLength:
|
59
|
-
Max: 150
|
60
|
-
|
61
|
-
Layout/ClassStructure:
|
62
|
-
Enabled: true
|
63
|
-
Categories:
|
64
|
-
module_inclusion:
|
65
|
-
- include
|
66
|
-
- prepend
|
67
|
-
- extend
|
68
|
-
ExpectedOrder:
|
69
|
-
- module_inclusion
|
70
|
-
- constants
|
71
|
-
- public_class_methods
|
72
|
-
- initializer
|
73
|
-
- public_methods
|
74
|
-
- protected_methods
|
75
|
-
- private_methods
|
76
|
-
|
77
|
-
Layout/EmptyLineAfterGuardClause:
|
78
|
-
Enabled: false
|
79
|
-
|
80
|
-
# Gemspec ---------------------------------------------------------------------
|
81
|
-
|
82
|
-
Gemspec/RequireMFA:
|
83
|
-
Enabled: false
|
84
|
-
|
85
|
-
# Performance -----------------------------------------------------------------
|
86
|
-
|
87
|
-
Performance/MethodObjectAsBlock:
|
88
|
-
Enabled: false
|
89
|
-
|
90
|
-
# RSpec -----------------------------------------------------------------------
|
91
|
-
|
92
|
-
RSpec/ExampleLength:
|
93
|
-
Enabled: false
|
94
|
-
|
95
|
-
RSpec/NestedGroups:
|
96
|
-
Enabled: false
|
97
|
-
|
98
|
-
RSpec/MultipleExpectations:
|
99
|
-
Enabled: false
|
100
|
-
|
101
|
-
RSpec/MessageChain:
|
102
|
-
Enabled: false
|
103
|
-
|
104
|
-
RSpec/ContextWording:
|
105
|
-
Enabled: false
|
106
|
-
|
107
|
-
RSpec/AnyInstance:
|
108
|
-
Enabled: false
|
109
|
-
|
110
|
-
RSpec/MessageSpies:
|
111
|
-
Enabled: false
|
112
|
-
|
113
|
-
RSpec/MultipleDescribes:
|
114
|
-
Enabled: false
|
115
|
-
|
116
|
-
RSpec/MultipleMemoizedHelpers:
|
117
|
-
Enabled: false
|
118
|
-
|
119
|
-
RSpec/StubbedMock:
|
120
|
-
Enabled: false
|
121
|
-
|
122
|
-
RSpec/VerifiedDoubleReference:
|
123
|
-
Enabled: false
|
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
dns_mock
|
data/CHANGELOG.md
DELETED
@@ -1,381 +0,0 @@
|
|
1
|
-
# Changelog
|
2
|
-
|
3
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
4
|
-
|
5
|
-
## [1.5.5] - 2022-10-04
|
6
|
-
|
7
|
-
### Updated
|
8
|
-
|
9
|
-
- Updated gemspecs
|
10
|
-
- Updated codeclimate/circleci configs
|
11
|
-
- Updated gem development dependencies
|
12
|
-
- Updated gem version
|
13
|
-
|
14
|
-
## [1.5.4] - 2022-07-31
|
15
|
-
|
16
|
-
### Updated
|
17
|
-
|
18
|
-
- Updated gemspecs
|
19
|
-
- Updated rubocop/codeclimate/circleci configs
|
20
|
-
- Updated gem development dependencies
|
21
|
-
- Updated gem version
|
22
|
-
|
23
|
-
## [1.5.3] - 2022-05-18
|
24
|
-
|
25
|
-
### Updated
|
26
|
-
|
27
|
-
- Updated gemspecs
|
28
|
-
- Updated codeclimate/circleci configs
|
29
|
-
- Updated gem development dependencies
|
30
|
-
- Updated gem version
|
31
|
-
|
32
|
-
## [1.5.2] - 2022-03-10
|
33
|
-
|
34
|
-
### Added
|
35
|
-
|
36
|
-
- Development environment guide
|
37
|
-
|
38
|
-
### Updated
|
39
|
-
|
40
|
-
- Updated gemspecs
|
41
|
-
- Updated codeclimate/circleci configs
|
42
|
-
- Updated gem development dependencies
|
43
|
-
- Updated gem version
|
44
|
-
|
45
|
-
## [1.5.1] - 2022-01-23
|
46
|
-
|
47
|
-
### Updated
|
48
|
-
|
49
|
-
- Updated native Ruby test environment from 2.5 to 3.1
|
50
|
-
- Updated codeclimate/circleci configs
|
51
|
-
- Updated gem development dependencies
|
52
|
-
- Updated gem docs, version
|
53
|
-
|
54
|
-
## [1.5.0] - 2021-12-29
|
55
|
-
|
56
|
-
### Added
|
57
|
-
|
58
|
-
- Added Ruby 3.1.x compatibility
|
59
|
-
|
60
|
-
### Updated
|
61
|
-
|
62
|
-
- Updated rubocop/codeclimate/circleci configs
|
63
|
-
- Updated gem development dependencies
|
64
|
-
- Updated gem docs, version
|
65
|
-
|
66
|
-
## [1.4.4] - 2021-11-11
|
67
|
-
|
68
|
-
### Updated
|
69
|
-
|
70
|
-
- Updated gem development dependencies
|
71
|
-
- Updated gem version
|
72
|
-
|
73
|
-
## [1.4.3] - 2021-10-07
|
74
|
-
|
75
|
-
### Updated
|
76
|
-
|
77
|
-
- Updated gem development dependencies
|
78
|
-
- Updated gem version
|
79
|
-
|
80
|
-
## [1.4.2] - 2021-09-04
|
81
|
-
|
82
|
-
### Updated
|
83
|
-
|
84
|
-
- Updated gem development dependencies
|
85
|
-
- Updated gem version
|
86
|
-
|
87
|
-
## [1.4.1] - 2021-08-16
|
88
|
-
|
89
|
-
### Updated
|
90
|
-
|
91
|
-
- Updated gem development dependencies
|
92
|
-
- Updated gem version
|
93
|
-
|
94
|
-
### Changed
|
95
|
-
|
96
|
-
- `faker` to `ffaker` development dependency
|
97
|
-
|
98
|
-
## [1.4.0] - 2021-07-13
|
99
|
-
|
100
|
-
### Added
|
101
|
-
|
102
|
-
- Added ability to use internationalized hostnames. All hostnames in UTF-8 will be represented as [Punycode](https://en.wikipedia.org/wiki/Punycode)
|
103
|
-
- Added `simpleidn` as runtime dependency
|
104
|
-
- Added `DnsMock::Representer::Punycode`, tests
|
105
|
-
|
106
|
-
```ruby
|
107
|
-
records = {
|
108
|
-
'mañana.com' => {
|
109
|
-
mx: %w[másletras.mañana.com]
|
110
|
-
}
|
111
|
-
}
|
112
|
-
|
113
|
-
DnsMock.start_server(port: 5300, records: records)
|
114
|
-
```
|
115
|
-
|
116
|
-
```bash
|
117
|
-
dig @localhost -p 5300 MX xn--maana-pta.com
|
118
|
-
```
|
119
|
-
|
120
|
-
```
|
121
|
-
; <<>> DiG 9.10.6 <<>> @localhost -p 5300 MX xn--maana-pta.com
|
122
|
-
; (2 servers found)
|
123
|
-
;; global options: +cmd
|
124
|
-
;; Got answer:
|
125
|
-
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4612
|
126
|
-
;; flags: rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
|
127
|
-
;; WARNING: recursion requested but not available
|
128
|
-
|
129
|
-
;; OPT PSEUDOSECTION:
|
130
|
-
; EDNS: version: 0, flags:; udp: 4096
|
131
|
-
;; QUESTION SECTION:
|
132
|
-
;xn--maana-pta.com. IN MX
|
133
|
-
|
134
|
-
;; ANSWER SECTION:
|
135
|
-
xn--maana-pta.com. 1 IN MX 10 xn--msletras-8ya.xn--maana-pta.com.
|
136
|
-
|
137
|
-
;; Query time: 0 msec
|
138
|
-
;; SERVER: 127.0.0.1#5300(127.0.0.1)
|
139
|
-
;; WHEN: Tue Jul 13 15:38:47 EEST 2021
|
140
|
-
;; MSG SIZE rcvd: 79
|
141
|
-
```
|
142
|
-
|
143
|
-
### Changed
|
144
|
-
|
145
|
-
- Refactored `DnsMock::Representer::RdnsLookup`, tests
|
146
|
-
- Updated `DnsMock::Record::Factory::Base`
|
147
|
-
- Updated `DnsMock::Server::RecordsDictionaryBuilder`, tests
|
148
|
-
- Updated `DnsMock::Record::Factory::Cname`, tests
|
149
|
-
- Updated `DnsMock::Record::Factory::Mx`, tests
|
150
|
-
- Updated `DnsMock::Record::Factory::Ns`, tests
|
151
|
-
- Updated `DnsMock::Record::Factory::Ptr`, tests
|
152
|
-
- Updated `DnsMock::Record::Factory::Soa`, tests
|
153
|
-
- Updated `DnsMock::ContextGeneratorHelper`, tests
|
154
|
-
- Updated reek config
|
155
|
-
- Updated gem documentation, version
|
156
|
-
|
157
|
-
## [1.3.1] - 2021-07-07
|
158
|
-
|
159
|
-
### Changed
|
160
|
-
|
161
|
-
- Updated gem development dependencies
|
162
|
-
- Updated rubocop/codeclimate config
|
163
|
-
- Updated gem documentation, version
|
164
|
-
|
165
|
-
## [1.3.0] - 2021-06-14
|
166
|
-
|
167
|
-
### Added
|
168
|
-
|
169
|
-
- Detecting random available port via OS features. Thanks [@ioquatix](https://github.com/ioquatix) for [suggestion](https://github.com/mocktools/ruby-dns-mock/issues/42) 🚀
|
170
|
-
|
171
|
-
### Removed
|
172
|
-
|
173
|
-
- Removed `DnsMock::Server::RandomAvailablePort`, tests
|
174
|
-
|
175
|
-
### Changed
|
176
|
-
|
177
|
-
- Updated `DnsMock::Server` class
|
178
|
-
- Updated tests helpers/tests
|
179
|
-
- Updated gem development dependencies
|
180
|
-
|
181
|
-
### Fixed
|
182
|
-
|
183
|
-
- Test coverage issues
|
184
|
-
|
185
|
-
## [1.2.4] - 2021-05-25
|
186
|
-
|
187
|
-
### Changed
|
188
|
-
|
189
|
-
- Updated gem development dependencies
|
190
|
-
- Updated CircleCI config
|
191
|
-
|
192
|
-
## [1.2.3] - 2021-05-11
|
193
|
-
|
194
|
-
### Changed
|
195
|
-
|
196
|
-
- Updated gem development dependencies
|
197
|
-
- Updated CircleCI config
|
198
|
-
|
199
|
-
## [1.2.2] - 2021-05-06
|
200
|
-
|
201
|
-
### Changed
|
202
|
-
|
203
|
-
- Updated gem development dependencies
|
204
|
-
- Updated rubocop/codeclimate config
|
205
|
-
- Updated CircleCI config
|
206
|
-
|
207
|
-
## [1.2.1] - 2021-03-23
|
208
|
-
|
209
|
-
### Changed
|
210
|
-
|
211
|
-
- Updated gem development dependencies
|
212
|
-
- Updated rubocop/codeclimate config
|
213
|
-
- Updated gem documentation
|
214
|
-
- Updated tests
|
215
|
-
|
216
|
-
## [1.2.0] - 2021-02-04
|
217
|
-
|
218
|
-
### Added
|
219
|
-
|
220
|
-
- Ability to specify custom priority of MX record if it needed
|
221
|
-
|
222
|
-
Now is possible to define null or backup MX records. Please note, if you haven't specified a priority of MX record, it will be assigned automatically. MX records builder is assigning priority with step 10 from first item of defined MX records array.
|
223
|
-
|
224
|
-
```ruby
|
225
|
-
records = {
|
226
|
-
'example.com' => {
|
227
|
-
mx: %w[.:0 mx1.domain.com:10 mx2.domain.com:10 mx3.domain.com] # .:0 - null MX record
|
228
|
-
}
|
229
|
-
}
|
230
|
-
|
231
|
-
DnsMock.start_server(records: records)
|
232
|
-
```
|
233
|
-
|
234
|
-
```bash
|
235
|
-
dig @localhost -p 5300 MX example.com
|
236
|
-
```
|
237
|
-
|
238
|
-
```
|
239
|
-
; <<>> DiG 9.10.6 <<>> @localhost -p 5300 MX example.com
|
240
|
-
|
241
|
-
;; ANSWER SECTION:
|
242
|
-
example.com. 1 IN MX 0 .
|
243
|
-
example.com. 1 IN MX 10 mx1.domain.com.
|
244
|
-
example.com. 1 IN MX 10 mx2.domain.com.
|
245
|
-
example.com. 1 IN MX 40 mx3.domain.com.
|
246
|
-
|
247
|
-
;; Query time: 0 msec
|
248
|
-
;; SERVER: 127.0.0.1#5300(127.0.0.1)
|
249
|
-
;; WHEN: Wed Feb 03 20:19:51 EET 2021
|
250
|
-
;; MSG SIZE rcvd: 102
|
251
|
-
```
|
252
|
-
|
253
|
-
## [1.1.0] - 2021-02-01
|
254
|
-
|
255
|
-
### Added
|
256
|
-
|
257
|
-
- RSpec native support. DnsMock helper help you to simplify integration with RSpec
|
258
|
-
|
259
|
-
```ruby
|
260
|
-
# spec/support/config/dns_mock.rb
|
261
|
-
require 'dns_mock/test_framework/rspec'
|
262
|
-
|
263
|
-
RSpec.configure do |config|
|
264
|
-
config.include DnsMock::TestFramework::RSpec::Helper
|
265
|
-
end
|
266
|
-
|
267
|
-
# your awesome first_a_record_spec.rb
|
268
|
-
RSpec.describe FirstARecord do
|
269
|
-
subject(:service) do
|
270
|
-
described_class.call(
|
271
|
-
hostname,
|
272
|
-
dns_gateway_host: 'localhost',
|
273
|
-
dns_gateway_port: dns_mock_server.port
|
274
|
-
)
|
275
|
-
end
|
276
|
-
|
277
|
-
let(:hostname) { 'example.com' }
|
278
|
-
let(:first_a_record) { '1.2.3.4' }
|
279
|
-
let(:records) { { hostname => { a: [first_a_record] } } }
|
280
|
-
|
281
|
-
before { dns_mock_server.assign_mocks(records) }
|
282
|
-
|
283
|
-
it { is_expected.to eq(first_a_record) }
|
284
|
-
end
|
285
|
-
```
|
286
|
-
|
287
|
-
## [1.0.0] - 2021-01-29
|
288
|
-
|
289
|
-
### Added
|
290
|
-
|
291
|
-
- Configurable strategy for record not found case
|
292
|
-
|
293
|
-
By default it won't raise an exception when DNS record not found in mocked records dictionary:
|
294
|
-
|
295
|
-
```ruby
|
296
|
-
DnsMock.start_server(port: 5300)
|
297
|
-
```
|
298
|
-
|
299
|
-
```bash
|
300
|
-
dig @localhost -p 5300 A example.com
|
301
|
-
```
|
302
|
-
|
303
|
-
```
|
304
|
-
; <<>> DiG 9.10.6 <<>> @localhost -p 5300 A example.com
|
305
|
-
;; Got answer:
|
306
|
-
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38632
|
307
|
-
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
|
308
|
-
;; WARNING: recursion requested but not available
|
309
|
-
|
310
|
-
;; OPT PSEUDOSECTION:
|
311
|
-
; EDNS: version: 0, flags:; udp: 4096
|
312
|
-
;; QUESTION SECTION:
|
313
|
-
;example.com. IN A
|
314
|
-
|
315
|
-
;; Query time: 0 msec
|
316
|
-
;; SERVER: 127.0.0.1#5300(127.0.0.1)
|
317
|
-
;; WHEN: Fri Jan 29 08:21:30 EET 2021
|
318
|
-
;; MSG SIZE rcvd: 40
|
319
|
-
```
|
320
|
-
|
321
|
-
If you want raise an exception when record not found, just start `DnsMock` with `exception_if_not_found: true` option:
|
322
|
-
|
323
|
-
```ruby
|
324
|
-
DnsMock.start_server(exception_if_not_found: true)
|
325
|
-
```
|
326
|
-
|
327
|
-
### Changed
|
328
|
-
|
329
|
-
- Updated `DnsMock.start_server`
|
330
|
-
- Updated `DnsMock::Server`
|
331
|
-
- Updated `DnsMock::Response::Message`
|
332
|
-
- Updated `DnsMock::Response::Answer`
|
333
|
-
- Updated gem version, readme
|
334
|
-
|
335
|
-
## [0.2.1] - 2021-01-27
|
336
|
-
|
337
|
-
### Fixed
|
338
|
-
|
339
|
-
- RDNS lookup representatin for IP address in PTR record feature.
|
340
|
-
|
341
|
-
## [0.2.0] - 2021-01-26
|
342
|
-
|
343
|
-
### Added
|
344
|
-
|
345
|
-
- PTR record support. Ability to mock PTR records
|
346
|
-
|
347
|
-
Please note, you can define host address without RDNS lookup prefix (`.in-addr.arpa`). `DnsMock` will do it for you.
|
348
|
-
|
349
|
-
```ruby
|
350
|
-
records = {
|
351
|
-
'1.2.3.4' => {
|
352
|
-
ptr: %w[domain_1.com domain_2.com]
|
353
|
-
}
|
354
|
-
}
|
355
|
-
|
356
|
-
DnsMock.start_server(records: records)
|
357
|
-
```
|
358
|
-
|
359
|
-
```bash
|
360
|
-
dig @localhost -p 5300 -x 1.2.3.4
|
361
|
-
```
|
362
|
-
|
363
|
-
```
|
364
|
-
; <<>> DiG 9.10.6 <<>> @localhost -p 5300 -x 1.1.1.1
|
365
|
-
; (2 servers found)
|
366
|
-
|
367
|
-
;; ANSWER SECTION:
|
368
|
-
4.3.2.1.in-addr.arpa. 1 IN PTR domain_1.com.
|
369
|
-
4.3.2.1.in-addr.arpa. 1 IN PTR domain_2.com.
|
370
|
-
|
371
|
-
;; Query time: 0 msec
|
372
|
-
;; SERVER: 127.0.0.1#5300(127.0.0.1)
|
373
|
-
;; WHEN: Mon Jan 25 19:58:39 EET 2021
|
374
|
-
;; MSG SIZE rcvd: 98
|
375
|
-
```
|
376
|
-
|
377
|
-
## [0.1.0] - 2021-01-19
|
378
|
-
|
379
|
-
### Added
|
380
|
-
|
381
|
-
- First release of `DnsMock`. Thanks [@le0pard](https://github.com/le0pard) for idea & support 🚀
|
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
6
|
-
contributors and maintainers pledge to making participation in our project and
|
7
|
-
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
-
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
-
orientation.
|
11
|
-
|
12
|
-
## Our Standards
|
13
|
-
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
15
|
-
include:
|
16
|
-
|
17
|
-
* Using welcoming and inclusive language
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
19
|
-
* Gracefully accepting constructive criticism
|
20
|
-
* Focusing on what is best for the community
|
21
|
-
* Showing empathy towards other community members
|
22
|
-
|
23
|
-
Examples of unacceptable behavior by participants include:
|
24
|
-
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
-
advances
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
-
* Public or private harassment
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
30
|
-
address, without explicit permission
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
-
professional setting
|
33
|
-
|
34
|
-
## Our Responsibilities
|
35
|
-
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
38
|
-
response to any instances of unacceptable behavior.
|
39
|
-
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
-
threatening, offensive, or harmful.
|
45
|
-
|
46
|
-
## Scope
|
47
|
-
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
-
when an individual is representing the project or its community. Examples of
|
50
|
-
representing a project or community include using an official project e-mail
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
53
|
-
further defined and clarified by project maintainers.
|
54
|
-
|
55
|
-
## Enforcement
|
56
|
-
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at admin@bestweb.com.ua. All
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
63
|
-
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
66
|
-
members of the project's leadership.
|
67
|
-
|
68
|
-
## Attribution
|
69
|
-
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
-
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
-
|
73
|
-
[homepage]: http://contributor-covenant.org
|
74
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
data/CONTRIBUTING.md
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# Contributing to DnsMock
|
2
|
-
|
3
|
-
Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved.
|
4
|
-
|
5
|
-
Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue or assessing patches and features.
|
6
|
-
|
7
|
-
## Using the issue tracker
|
8
|
-
|
9
|
-
The issue tracker is the preferred channel for [issue/bug reports](#issuebug-reports), [feature requests](#feature-requests), [questions](#questions) and submitting [pull requests](#pull-requests).
|
10
|
-
|
11
|
-
## Issue/bug reports
|
12
|
-
|
13
|
-
A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports are extremely helpful - thank you!
|
14
|
-
|
15
|
-
Guidelines for issue/bug reports:
|
16
|
-
|
17
|
-
1. **Use the GitHub issue search** — check if the issue has already been reported
|
18
|
-
2. **Check if the issue has been fixed** — try to reproduce it using the latest `master` or `develop` branch in the repository
|
19
|
-
3. DnsMock [issue template](.github/ISSUE_TEMPLATE/issue_report.md)/[bug template](.github/ISSUE_TEMPLATE/bug_report.md)
|
20
|
-
|
21
|
-
A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What would you expect to be the outcome? All these details will help people to fix any potential bugs.
|
22
|
-
|
23
|
-
## Feature requests
|
24
|
-
|
25
|
-
Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to *you* to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible.
|
26
|
-
|
27
|
-
## Questions
|
28
|
-
|
29
|
-
We're always open to a new conversations. So if you have any questions just ask us.
|
30
|
-
|
31
|
-
## Pull requests
|
32
|
-
|
33
|
-
Good pull requests - patches, improvements, new features - are a fantastic help. They should remain focused in scope and avoid containing unrelated commits.
|
34
|
-
|
35
|
-
**Please ask first** before embarking on any significant pull request (e.g. implementing features, refactoring code, porting to a different language), otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project.
|
36
|
-
|
37
|
-
Please adhere to the coding conventions used throughout a project (indentation, accurate comments, etc.) and any other requirements (such as test coverage). Not all features proposed will be added but we are open to having a conversation about a feature you are championing.
|
38
|
-
|
39
|
-
Guidelines for pull requests:
|
40
|
-
|
41
|
-
1. DnsMock [pull request template](.github/PULL_REQUEST_TEMPLATE.md)
|
42
|
-
2. Fork the repo, checkout to `develop` branch
|
43
|
-
3. Run the tests. This is to make sure your starting point works
|
44
|
-
4. Read our [branch naming convention](.github/BRANCH_NAMING_CONVENTION.md)
|
45
|
-
5. Create a new branch
|
46
|
-
6. Read our [setup development environment guide](.github/DEVELOPMENT_ENVIRONMENT_GUIDE.md)
|
47
|
-
7. Make your changes. Please note that your PR should include tests for the new codebase!
|
48
|
-
9. Push to your fork and submit a pull request to `develop` branch
|