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 +4 -4
- data/lib/dacpclient/client.rb +1 -1
- data/lib/dacpclient/version.rb +1 -1
- metadata +2 -3
- data/lib/dacpclient/bonjour.rb +0 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26af62b1cfad48c22cd9703ca63ccef94c68869c
|
4
|
+
data.tar.gz: f11ddd282d4ec95b1811c153357227f83ecea644
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81e9606de9d867a38ad40ed0e0e85cdae6c6bea41e4abe2946f316984739cf118612ee24f295bb2820620da5c4f393711c3211cdb1e7b8b1551dd3935ef63c95
|
7
|
+
data.tar.gz: e9f211355e6efbac62c8a8d96ad4f7489742e0caad33a46750ecd1c5137a8207d9a924e331e3b6aada91d8514837e61f8da60a8780f6b1c87c298a018d378297
|
data/lib/dacpclient/client.rb
CHANGED
@@ -7,7 +7,7 @@ require 'plist'
|
|
7
7
|
require 'dacpclient/pairingserver'
|
8
8
|
require 'dacpclient/dmapparser'
|
9
9
|
require 'dacpclient/dmapbuilder'
|
10
|
-
require 'dacpclient/
|
10
|
+
require 'dacpclient/version'
|
11
11
|
|
12
12
|
module DACPClient
|
13
13
|
# The Client class handles communication with the server
|
data/lib/dacpclient/version.rb
CHANGED
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.
|
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-
|
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
|
data/lib/dacpclient/bonjour.rb
DELETED
@@ -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
|