dns_mock 0.2.0 → 0.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24eced6efdb48a74315875839beb3af4e693962a3eb1c5ea3b82f9de67ab5bf4
4
- data.tar.gz: e11a83bb5ba9a8cf5f5ba0d6d98689a6886b9954b4ba0f33cfe3de026671a905
3
+ metadata.gz: 959009b04aab3780b0f571bc7b31ad5c651cf454828c7f65535fdcebe5f6a6ca
4
+ data.tar.gz: 6dccffd38d203b4216c940099b1c65ba770c27d811350af2fd5c0841405ff5a0
5
5
  SHA512:
6
- metadata.gz: 5f3863ee0037d22f13e2a0b1e3126193cf485447b3f60edf998ff631204f46fe7ac443f1fc9431431e10a2577392000b388c9b110d26e13535524e6d53e18f66
7
- data.tar.gz: 5c795bd05c4eb4502a248f483c01778aaefac1fe32a1d937364518c6e3299414145dd973ca2ffeb6688c940217be4fc11e6e321d9f1da0ef5bce6e1c03f4e025
6
+ metadata.gz: 150da67d3baefc081928aa4551fe7b6830162a65c174052483ed4529fc259c87213ff45114f6507847513646c96127dca19fd8732c8c06ea3b4416a07e28a631
7
+ data.tar.gz: 881c264d38be38328285725a8b13b48c7e82628e5ef786853c4ca9067c67ebfd15e7d83befd8a84b6f4dd89307995ea59cc77dbbf07c2f93cff8565b53a52fbe
@@ -2,6 +2,12 @@
2
2
 
3
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
4
 
5
+ ## [0.2.1] - 2021-01-27
6
+
7
+ ### Fixed RDNS lookup representation
8
+
9
+ Fixed RDNS lookup representatin for IP address in PTR record feature.
10
+
5
11
  ## [0.2.0] - 2021-01-26
6
12
 
7
13
  ### PTR record support
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dns_mock (0.2.0)
4
+ dns_mock (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Maintainability](https://api.codeclimate.com/v1/badges/5ea9da61ef468b8ad4c4/maintainability)](https://codeclimate.com/github/mocktools/ruby-dns-mock/maintainability)
4
4
  [![Test Coverage](https://api.codeclimate.com/v1/badges/5ea9da61ef468b8ad4c4/test_coverage)](https://codeclimate.com/github/mocktools/ruby-dns-mock/test_coverage)
5
- [![CircleCI](https://circleci.com/gh/mocktools/ruby-dns-mock/tree/develop.svg?style=svg)](https://circleci.com/gh/mocktools/ruby-dns-mock/tree/develop)
5
+ [![CircleCI](https://circleci.com/gh/mocktools/ruby-dns-mock/tree/master.svg?style=svg)](https://circleci.com/gh/mocktools/ruby-dns-mock/tree/master)
6
6
  [![Gem Version](https://badge.fury.io/rb/dns_mock.svg)](https://badge.fury.io/rb/dns_mock)
7
7
  [![Downloads](https://img.shields.io/gem/dt/dns_mock.svg?colorA=004d99&colorB=0073e6)](https://rubygems.org/gems/dns_mock)
8
8
  [![GitHub](https://img.shields.io/github/license/mocktools/ruby-dns-mock)](LICENSE.txt)
@@ -23,10 +23,6 @@
23
23
  - [Versioning](#versioning)
24
24
  - [Changelog](CHANGELOG.md)
25
25
 
26
- ## Requirements
27
-
28
- Ruby MRI 2.5.0+
29
-
30
26
  ## Features
31
27
 
32
28
  - Ability to mimic any DNS records (`A`, `AAAA`, `CNAME`, `MX`, `NS`, `PTR`, `SOA` and `TXT`)
@@ -35,6 +31,10 @@ Ruby MRI 2.5.0+
35
31
  - Test framework agnostic (it's PORO, so you can use it outside of `RSpec`, `Test::Unit` or `MiniTest`)
36
32
  - Simple and intuitive DSL
37
33
 
34
+ ## Requirements
35
+
36
+ Ruby MRI 2.5.0+
37
+
38
38
  ## Installation
39
39
 
40
40
  Add this line to your application's `Gemfile`:
@@ -77,7 +77,7 @@ records = {
77
77
  }
78
78
  ]
79
79
  },
80
- '1.1.1.1' => {
80
+ '1.2.3.4' => {
81
81
  ptr: %w[domain_1.com domain_2.com]
82
82
  }
83
83
  }
@@ -6,7 +6,8 @@ module DnsMock
6
6
  include DnsMock::Error::Helper
7
7
 
8
8
  IP_ADDRESS_PATTERN = /\A((1\d|[1-9]|2[0-4])?\d|25[0-5])(\.\g<1>){3}\z/.freeze
9
- RDNS_LOOKUP_PREFIX = '.in-addr.arpa'
9
+ IP_OCTET_GROUPS = /(\d+).(\d+).(\d+).(\d+)/.freeze
10
+ RDNS_LOOKUP_REPRESENTATION = '\4.\3.\2.\1.in-addr.arpa'
10
11
  TYPE_MAPPER = DnsMock::AVAILABLE_DNS_RECORD_TYPES.zip(
11
12
  [
12
13
  [DnsMock::Record::Builder::A, DnsMock::Record::Factory::A, ::Array],
@@ -47,7 +48,10 @@ module DnsMock
47
48
  def rdns_lookup_prefix(hostname)
48
49
  return hostname unless hostname[DnsMock::Server::RecordsDictionaryBuilder::IP_ADDRESS_PATTERN]
49
50
 
50
- "#{hostname}#{DnsMock::Server::RecordsDictionaryBuilder::RDNS_LOOKUP_PREFIX}"
51
+ hostname.gsub(
52
+ DnsMock::Server::RecordsDictionaryBuilder::IP_OCTET_GROUPS,
53
+ DnsMock::Server::RecordsDictionaryBuilder::RDNS_LOOKUP_REPRESENTATION
54
+ )
51
55
  end
52
56
 
53
57
  def build_records_instances_by_type(record_type, records_to_build)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DnsMock
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
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: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladislav Trotsenko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-25 00:00:00.000000000 Z
11
+ date: 2021-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler