simple_upnp 0.0.5 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +4 -4
- data/lib/simple_upnp/device.rb +3 -3
- data/lib/simple_upnp/discovery.rb +2 -3
- data/lib/simple_upnp/version.rb +1 -1
- data/simple_upnp.gemspec +4 -3
- metadata +17 -22
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2d676283e1acc02794095d294d923eb7df6dadcf
|
4
|
+
data.tar.gz: 675266655df435edf284cb447ecd0f1610b16d1e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 519a09a190442bf0144b5d2af816b798fb97ca7299b8f1d22e446ab3b40c51a568db9b356a56703c0408c57a7cb9fb88cae53de2782254a1580d33109a13f322
|
7
|
+
data.tar.gz: 270f3092b5b718c3d1856341823a0920b9a85c24e1fbcfb88202ce6cb1c79ed9813543d3ae53681a7af0878438ee3baa00ba5d60a50f5e39ca8a225c59ac0cbd
|
data/CHANGELOG.md
ADDED
data/Gemfile.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
simple_upnp (0.0
|
5
|
-
nori (~> 2.
|
4
|
+
simple_upnp (1.0.0)
|
5
|
+
nori (~> 2.6)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
10
|
diff-lcs (1.1.3)
|
11
|
-
nori (2.0
|
11
|
+
nori (2.6.0)
|
12
12
|
rspec (2.12.0)
|
13
13
|
rspec-core (~> 2.12.0)
|
14
14
|
rspec-expectations (~> 2.12.0)
|
@@ -22,5 +22,5 @@ PLATFORMS
|
|
22
22
|
ruby
|
23
23
|
|
24
24
|
DEPENDENCIES
|
25
|
-
rspec (~> 2.12
|
25
|
+
rspec (~> 2.12)
|
26
26
|
simple_upnp!
|
data/lib/simple_upnp/device.rb
CHANGED
@@ -33,15 +33,15 @@ module SimpleUpnp
|
|
33
33
|
h.merge!(retrieve_location_details) if include_location_details and location
|
34
34
|
h
|
35
35
|
end
|
36
|
-
|
36
|
+
|
37
37
|
private
|
38
|
-
|
38
|
+
|
39
39
|
def parse_token(tokens)
|
40
40
|
value = nil
|
41
41
|
value = tokens[1] if tokens.length >= 2
|
42
42
|
value
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
def retrieve_location_details
|
46
46
|
url = URI.parse(location)
|
47
47
|
req = Net::HTTP::Get.new(url.path)
|
@@ -40,7 +40,6 @@ module SimpleUpnp
|
|
40
40
|
socket = UDPSocket.new
|
41
41
|
socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR, [1].pack('i'))
|
42
42
|
socket.setsockopt(Socket::IPPROTO_IP, Socket::IP_TTL, [1].pack('i'))
|
43
|
-
socket.bind('', SSDP_PORT)
|
44
43
|
socket.send(M_SEARCH, 0, SSDP_ADDR, SSDP_PORT)
|
45
44
|
yield socket
|
46
45
|
ensure
|
@@ -52,11 +51,11 @@ module SimpleUpnp
|
|
52
51
|
begin
|
53
52
|
Timeout::timeout(seconds_to_listen) do
|
54
53
|
while true
|
55
|
-
message,
|
54
|
+
message, _ = socket.recvfrom(MAX_RECEIVE_LENGTH)
|
56
55
|
yield message
|
57
56
|
end
|
58
57
|
end
|
59
|
-
rescue Timeout::Error
|
58
|
+
rescue Timeout::Error
|
60
59
|
# Finished Listening
|
61
60
|
end
|
62
61
|
end
|
data/lib/simple_upnp/version.rb
CHANGED
data/simple_upnp.gemspec
CHANGED
@@ -7,7 +7,8 @@ Gem::Specification.new do |gem|
|
|
7
7
|
gem.description = %q{Simple library to perform basic UPnP network discovery.}
|
8
8
|
gem.summary = %q{Simple library to perform basic UPnP network discovery.}
|
9
9
|
gem.homepage = ""
|
10
|
-
gem.license
|
10
|
+
gem.license = 'MIT'
|
11
|
+
gem.date = '2015-05-10'
|
11
12
|
|
12
13
|
gem.files = `git ls-files`.split($\)
|
13
14
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
@@ -16,7 +17,7 @@ Gem::Specification.new do |gem|
|
|
16
17
|
gem.require_paths = ["lib"]
|
17
18
|
gem.version = SimpleUpnp::VERSION
|
18
19
|
|
19
|
-
gem.add_dependency "nori", '~> 2.
|
20
|
-
gem.add_development_dependency "rspec", '~> 2.12
|
20
|
+
gem.add_dependency "nori", '~> 2.6'
|
21
|
+
gem.add_development_dependency "rspec", '~> 2.12'
|
21
22
|
|
22
23
|
end
|
metadata
CHANGED
@@ -1,48 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_upnp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Dennis Kuczynski
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-05-10 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: nori
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: 2.
|
19
|
+
version: '2.6'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: 2.
|
26
|
+
version: '2.6'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rspec
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: 2.12
|
33
|
+
version: '2.12'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: 2.12
|
40
|
+
version: '2.12'
|
46
41
|
description: Simple library to perform basic UPnP network discovery.
|
47
42
|
email:
|
48
43
|
- dennis.kuczynski@gmail.com
|
@@ -50,7 +45,8 @@ executables: []
|
|
50
45
|
extensions: []
|
51
46
|
extra_rdoc_files: []
|
52
47
|
files:
|
53
|
-
- .gitignore
|
48
|
+
- ".gitignore"
|
49
|
+
- CHANGELOG.md
|
54
50
|
- Gemfile
|
55
51
|
- Gemfile.lock
|
56
52
|
- LICENSE
|
@@ -65,27 +61,26 @@ files:
|
|
65
61
|
homepage: ''
|
66
62
|
licenses:
|
67
63
|
- MIT
|
64
|
+
metadata: {}
|
68
65
|
post_install_message:
|
69
66
|
rdoc_options: []
|
70
67
|
require_paths:
|
71
68
|
- lib
|
72
69
|
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
70
|
requirements:
|
75
|
-
- -
|
71
|
+
- - ">="
|
76
72
|
- !ruby/object:Gem::Version
|
77
73
|
version: '0'
|
78
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
|
-
none: false
|
80
75
|
requirements:
|
81
|
-
- -
|
76
|
+
- - ">="
|
82
77
|
- !ruby/object:Gem::Version
|
83
78
|
version: '0'
|
84
79
|
requirements: []
|
85
80
|
rubyforge_project:
|
86
|
-
rubygems_version:
|
81
|
+
rubygems_version: 2.4.6
|
87
82
|
signing_key:
|
88
|
-
specification_version:
|
83
|
+
specification_version: 4
|
89
84
|
summary: Simple library to perform basic UPnP network discovery.
|
90
85
|
test_files:
|
91
86
|
- spec/spec_helper.rb
|