dacpclient 0.2.5 → 0.2.6

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: ff09ad7307bbe342d0806c38c576a60b281845fe
4
- data.tar.gz: 2672d25061e9704982a95969c3b91a4f22af53f2
3
+ metadata.gz: 26af62b1cfad48c22cd9703ca63ccef94c68869c
4
+ data.tar.gz: f11ddd282d4ec95b1811c153357227f83ecea644
5
5
  SHA512:
6
- metadata.gz: 6e82b67093b1adc96ad84c80b8187e0f21a2906835553ee926c7eb49e3badb8f49c1b6432aeb88f91fba1a68af035b8a4d357a3bd4280ea42c336543381ab804
7
- data.tar.gz: 190209f628221d59e98d534b1937bd4cb8381034ef941d00e6098fbac91943c69e953061fd7c7c7a745fd37e563ef264e5c0de395d713f10fd8b8da36663bcf7
6
+ metadata.gz: 81e9606de9d867a38ad40ed0e0e85cdae6c6bea41e4abe2946f316984739cf118612ee24f295bb2820620da5c4f393711c3211cdb1e7b8b1551dd3935ef63c95
7
+ data.tar.gz: e9f211355e6efbac62c8a8d96ad4f7489742e0caad33a46750ecd1c5137a8207d9a924e331e3b6aada91d8514837e61f8da60a8780f6b1c87c298a018d378297
@@ -7,7 +7,7 @@ require 'plist'
7
7
  require 'dacpclient/pairingserver'
8
8
  require 'dacpclient/dmapparser'
9
9
  require 'dacpclient/dmapbuilder'
10
- require 'dacpclient/bonjour'
10
+ require 'dacpclient/version'
11
11
 
12
12
  module DACPClient
13
13
  # The Client class handles communication with the server
@@ -1,4 +1,4 @@
1
1
  # The DACPClient module
2
2
  module DACPClient
3
- VERSION = '0.2.5'
3
+ VERSION = '0.2.6'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dacpclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jurriaan Pruis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-27 00:00:00.000000000 Z
11
+ date: 2014-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -155,7 +155,6 @@ files:
155
155
  - bin/dacpclient
156
156
  - dacpclient.gemspec
157
157
  - lib/dacpclient.rb
158
- - lib/dacpclient/bonjour.rb
159
158
  - lib/dacpclient/client.rb
160
159
  - lib/dacpclient/dmapbuilder.rb
161
160
  - lib/dacpclient/dmapconverter.rb
@@ -1,43 +0,0 @@
1
- module DACPClient
2
- # The Client class handles communication with the server
3
- class Bonjour
4
- SERVICE_NAME = '_daap._tcp'.freeze
5
- DOMAIN = 'local'.freeze
6
-
7
- def browse
8
- servers = []
9
-
10
- begin
11
- timeout(3) do
12
- DNSSD.browse!(SERVICE_NAME, DOMAIN) do |node|
13
- ip, port = nil
14
-
15
- resolver = DNSSD::Service.new
16
- resolver.resolve(node) do |resolved|
17
- ip = get_ip(resolved.target)
18
- port = resolved.port
19
-
20
- break unless resolved.flags.more_coming?
21
- end
22
-
23
- servers << { name: node.name, ip: ip, port: port, node: node }
24
-
25
- break unless node.flags.more_coming?
26
- end
27
- end
28
-
29
- rescue Timeout::Error
30
- return []
31
- end
32
-
33
- servers
34
- end
35
-
36
- private
37
-
38
- def get_ip(target)
39
- info = Socket.getaddrinfo(target, nil, Socket::AF_INET)
40
- info[0][2]
41
- end
42
- end
43
- end