simple_upnp 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -29,8 +29,8 @@ You may either:
29
29
  * search for a configurable number of seconds and return all unique devices that have responded.
30
30
  * attempt to find a specific device and exit early once found
31
31
 
32
- The following example shows search (which can be triggered with the included rake task: "rake simple_upnp:search"):
33
- ```
32
+ The following example shows *search* (which can be triggered with the included rake task: "rake simple_upnp:search"):
33
+ ```ruby
34
34
  include_location_details = true
35
35
  devices = SimpleUpnp::Discovery.search()
36
36
  devices.each do |device|
@@ -40,8 +40,8 @@ devices.each do |device|
40
40
  end
41
41
  ```
42
42
 
43
- The following example shows find (which can be triggered with the included rake task: "rake simple_upnp:find_hue"):
44
- ```
43
+ The following example shows *find* (which can be triggered with the included rake task: "rake simple_upnp:find_hue"):
44
+ ```ruby
45
45
  include_location_details = true
46
46
  hue_device = nil
47
47
  SimpleUpnp::Discovery.find do |device|
@@ -82,3 +82,13 @@ Device Found:
82
82
  3. Commit your changes (`git commit -am 'Added some feature'`)
83
83
  4. Push to the branch (`git push origin my-new-feature`)
84
84
  5. Create new Pull Request
85
+
86
+ ## License
87
+
88
+ simple_upnp is released under the MIT license:
89
+
90
+ http://www.opensource.org/licenses/MIT
91
+
92
+ It makes use of the following libraries:
93
+
94
+ Nori - https://github.com/savonrb/nori
@@ -38,8 +38,9 @@ module SimpleUpnp
38
38
  def self.open_socket(&block)
39
39
  begin
40
40
  socket = UDPSocket.new
41
- socket.bind('', SSDP_PORT)
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)
43
44
  socket.send(M_SEARCH, 0, SSDP_ADDR, SSDP_PORT)
44
45
  yield socket
45
46
  ensure
@@ -1,3 +1,3 @@
1
1
  module SimpleUpnp
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/simple_upnp.gemspec CHANGED
@@ -7,6 +7,7 @@ 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 = 'MIT'
10
11
 
11
12
  gem.files = `git ls-files`.split($\)
12
13
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_upnp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -63,7 +63,8 @@ files:
63
63
  - simple_upnp.gemspec
64
64
  - spec/spec_helper.rb
65
65
  homepage: ''
66
- licenses: []
66
+ licenses:
67
+ - MIT
67
68
  post_install_message:
68
69
  rdoc_options: []
69
70
  require_paths: