easy_upnp 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/easy_upnp/upnp_device.rb +14 -7
- data/lib/easy_upnp/version.rb +1 -1
- 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: d06b0e0d67f895da180b202c270c0407761dfaad
|
4
|
+
data.tar.gz: 199921fe3b7074fa1a1049e13649fe12a7c3b592
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 183c88f2434861fe2ece10d326e6d7917c17ddc1a6d1c2dfc0547e7f1e5cfd4e986411e51529252ab94c0f780a6a1429fa289e0124ba9e4c54469501521adfe3
|
7
|
+
data.tar.gz: 8abb23495b5cc314f310daac1999a0ce55519176250d5121a134e93939cafc44b9390dbda3ff250513dc391f58ef2cceaa51d0555f02f4db84ef0dff29853145
|
data/README.md
CHANGED
@@ -45,7 +45,7 @@ device.all_services
|
|
45
45
|
You can then create a service client and make calls to the service:
|
46
46
|
|
47
47
|
```ruby
|
48
|
-
service =
|
48
|
+
service = device.service 'urn:schemas-upnp-org:service:ContentDirectory:1'
|
49
49
|
|
50
50
|
service.service_methods
|
51
51
|
# => ["GetSearchCapabilities", "GetSortCapabilities", "GetSystemUpdateID", "Browse", "Search"]
|
@@ -7,11 +7,10 @@ require_relative 'device_control_point'
|
|
7
7
|
|
8
8
|
module EasyUpnp
|
9
9
|
class UpnpDevice
|
10
|
-
attr_reader :uuid
|
10
|
+
attr_reader :uuid, :name, :host
|
11
11
|
|
12
12
|
def initialize uuid, messages
|
13
13
|
@uuid = uuid
|
14
|
-
|
15
14
|
@service_definitions = messages.
|
16
15
|
# Filter out messages that aren't service definitions. These include
|
17
16
|
# the root device and the root UUID
|
@@ -21,11 +20,19 @@ module EasyUpnp
|
|
21
20
|
group_by { |message| message[:st] }.
|
22
21
|
map { |_, matching_messages| matching_messages.first }.
|
23
22
|
map do |message|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
{
|
24
|
+
:location => message[:location],
|
25
|
+
:st => message[:st]
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Download one of the definitions to get the name of this device
|
30
|
+
service_location = @service_definitions.first[:location]
|
31
|
+
|
32
|
+
xml = Nokogiri::XML(open(service_location))
|
33
|
+
xml.remove_namespaces!
|
34
|
+
@name = xml.xpath('//device/friendlyName').text
|
35
|
+
@host = URI.parse(service_location).host
|
29
36
|
end
|
30
37
|
|
31
38
|
def all_services
|
data/lib/easy_upnp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_upnp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Mullins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
version: '0'
|
115
115
|
requirements: []
|
116
116
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.
|
117
|
+
rubygems_version: 2.4.8
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: A super easy to use UPnP control point client
|