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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9daa172dbb5360e85be5a6eb3143b91e4412b03
4
- data.tar.gz: 41163076a816cca8af676caa516da0d81b26d376
3
+ metadata.gz: 81b5b6002fe75561ead81d663d48eedbe850efae
4
+ data.tar.gz: 87ed58d93090f140f116841af9401ed4717c3e23
5
5
  SHA512:
6
- metadata.gz: 672be76caedfbcfb54b2de9c9b230165b4c5138607bcd750f19c863616af4d786369a944672e3e225bfb64a8884a146e3838d2322456725bc3047adf1a98c958
7
- data.tar.gz: 242c15405dc40b859655fa6d0b603f852f348f14fb980ca1af87d53eb02ba1191f3633bac4bfe0f05210495cc0a3b3a8ffdb96f68144a9872cf9ed099f2e85d7
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
- @rrcache[k] = { records: rrs.dup, expiry: Time.now + rrs.map { |rr| rr.ttl }.min }
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
- data[$1.to_sym] = $3
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.0
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: 2017-09-27 00:00:00.000000000 Z
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.5.2
209
+ rubygems_version: 2.6.13
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: Query RFC6763 DNS-SD records