doxie-scanner 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0f5ae45f5092a67305235d6acd0c0cf018f16ca8
4
+ data.tar.gz: a5db5df580ccc6dff3390b903ab62729f7dd368f
5
+ SHA512:
6
+ metadata.gz: a056afdb2c3228c838029e38af15b3b7fe17dcf6defa441493fe358e8d43946bb4ea7a1025740316c588d528ca59973acc6fc663496851a7338c912e96c31c25
7
+ data.tar.gz: 9275baf29379ece4950c386aa418a2fc7a158f27d9ff7222f194d77940ed6fe202fd0c591847cf1c9da64296dd143f22bc3a4e41d4279aa106fe3b120e670f16
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2016 Cristiano Betta
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,43 @@
1
+ # Doxie Scanner
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/doxie_Scanner.svg)](https://badge.fury.io/rb/doxie_Scanner)
4
+
5
+ A scanner to find your the [Doxie Go Wifi](http://getdoxie.com). Returns an IP or list of IPs for your Doxie scanner. Very useful in combination with the [Doxie API gem](https://github.com/cbetta/doxie).
6
+
7
+ ## Installation
8
+
9
+ Either install directly or via bundler.
10
+
11
+ ```rb
12
+ gem 'doxie-scanner'
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ The scanner uses UPnP and SSDP to search for your Doxie.
18
+
19
+ ```rb
20
+ require 'doxie/scanner'
21
+ Doxie::Scanner.ips
22
+ => [
23
+ [0] "192.168.1.2"
24
+ ]
25
+ ```
26
+
27
+ ## Contributing
28
+
29
+ 1. **Fork** the repo on GitHub
30
+ 2. **Clone** the project to your own machine
31
+ 3. **Commit** changes to your own branch
32
+ 4. **Push** your work back up to your fork
33
+ 5. Submit a **Pull request** so that we can review your changes
34
+
35
+ ### Development
36
+
37
+ * `bundle install` to get dependencies
38
+ * `rake` to run tests
39
+ * `rake console` to run a local console with the library loaded
40
+
41
+ ## License
42
+
43
+ This library is released under the [MIT License](LICENSE).
@@ -0,0 +1,14 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'doxie-scanner'
3
+ s.version = '1.0.0'
4
+ s.summary = "A simple scanner for your Doxie Go Wifi"
5
+ s.description = "A simple scanner for your Doxie Go Wifi"
6
+ s.authors = ["Cristiano Betta"]
7
+ s.email = 'cbetta@gmail.com'
8
+ s.files = Dir.glob('{lib,spec}/**/*') + %w(LICENSE README.md doxie-scanner.gemspec)
9
+ s.homepage = 'https://github.com/cbetta/doxie-scanner'
10
+ s.license = 'MIT'
11
+ s.require_path = 'lib'
12
+
13
+ s.add_dependency('frisky')
14
+ end
@@ -0,0 +1,4 @@
1
+ require 'doxie/scanner'
2
+
3
+ module Doxie
4
+ end
@@ -0,0 +1,12 @@
1
+ require 'frisky/ssdp'
2
+
3
+ module Doxie
4
+ class Scanner
5
+ def self.ips
6
+ root_devices = Frisky::SSDP.search 'upnp:rootdevices'
7
+ doxies = root_devices.select { |device| device[:location].include?('doxie')}
8
+ hosts = doxies.map {|doxie| URI.parse(doxie[:location]).host }
9
+ hosts.uniq
10
+ end
11
+ end
12
+ end
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: doxie-scanner
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Cristiano Betta
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-05-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: frisky
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: A simple scanner for your Doxie Go Wifi
28
+ email: cbetta@gmail.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - LICENSE
34
+ - README.md
35
+ - doxie-scanner.gemspec
36
+ - lib/doxie.rb
37
+ - lib/doxie/scanner.rb
38
+ homepage: https://github.com/cbetta/doxie-scanner
39
+ licenses:
40
+ - MIT
41
+ metadata: {}
42
+ post_install_message:
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ requirements: []
57
+ rubyforge_project:
58
+ rubygems_version: 2.5.1
59
+ signing_key:
60
+ specification_version: 4
61
+ summary: A simple scanner for your Doxie Go Wifi
62
+ test_files: []