dns-sd 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dns-sd/resource_cache.rb +5 -1
- data/lib/dns-sd/service_instance.rb +3 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81b5b6002fe75561ead81d663d48eedbe850efae
|
4
|
+
data.tar.gz: 87ed58d93090f140f116841af9401ed4717c3e23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 972e8c15c66202907f6207b1616d742cbf096dbc71a41ed1315c820531b13b2f2af1874e6e32c3ad2c821262e1e41f663591bf62b44789c569080778c6273432
|
7
|
+
data.tar.gz: 92e840beed3d2c919085f80651d8a188a348bcbac18977418d5e7cff9dd1a96ef967c4402b165db2b29363367de1fc4239c72ae4b0ac3f0c403ac944ed84ae04
|
@@ -29,7 +29,11 @@ class DNSSD
|
|
29
29
|
@rrcache[k][:records].dup
|
30
30
|
else
|
31
31
|
Resolv::DNS.new.getresources(fqdn, type).tap do |rrs|
|
32
|
-
|
32
|
+
if rrs.empty?
|
33
|
+
@rrcache.delete(k)
|
34
|
+
else
|
35
|
+
@rrcache[k] = { records: rrs.dup, expiry: Time.now + rrs.map { |rr| rr.ttl }.min }
|
36
|
+
end
|
33
37
|
end
|
34
38
|
end
|
35
39
|
end
|
@@ -69,8 +69,9 @@ class DNSSD
|
|
69
69
|
{}.tap do |data|
|
70
70
|
cached_resources(@fqdn, Resolv::DNS::Resource::IN::TXT).each do |rr|
|
71
71
|
rr.strings.each do |s|
|
72
|
-
s =~ /\A([^=]+)(=(.*))?$/
|
73
|
-
|
72
|
+
if s =~ /\A([^=]+)(=(.*))?$/
|
73
|
+
data[$1.to_sym] = $3
|
74
|
+
end
|
74
75
|
end
|
75
76
|
end
|
76
77
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dns-sd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Palmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
version: '0'
|
207
207
|
requirements: []
|
208
208
|
rubyforge_project:
|
209
|
-
rubygems_version: 2.
|
209
|
+
rubygems_version: 2.6.13
|
210
210
|
signing_key:
|
211
211
|
specification_version: 4
|
212
212
|
summary: Query RFC6763 DNS-SD records
|