waps 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +41 -0
  3. data/lib/waps.rb +5 -2
  4. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ea110bc1076161c83c128b4b508ccc5342166035c0ab5e2e81de705a2d16603
4
- data.tar.gz: dc0ac8fb9ae313b0c7db2d119abd37436448ff40d093a5d0f4288cb209cbb47b
3
+ metadata.gz: 44feb99ca1eaedbf4222928c4e09a68476969dcdd18a5e6e0414d8a27ff54c6a
4
+ data.tar.gz: df55be1c6de6a8c22866e5561636920a932970d57877b6ff257a23b98d2cc09e
5
5
  SHA512:
6
- metadata.gz: 05df9168ab991de146b425bb74f50a06a1549761666f14e4a2c285c5cd13c7d03689a9f7d7b13f18d497eab4c785d57bd8deee642d80f009e418fd4c98f89056
7
- data.tar.gz: f9a6c9b475ccf71374f1eafc225d79f6cacb3cd51e152159ec77581576f56b38081a6d1461b9944bc6b0b475d4fa12eeb63f59877ef6a9c73f101f3b338e375d
6
+ metadata.gz: 69ad813e8149ca3674c32ac7bac07e6946ce171674f9952076a19e31d236c5bf974244468d6ccea73c8c87c955bfbfd6e2c582b03df0ce64a729907c45ad1461
7
+ data.tar.gz: 0f289df12e7cb243a329b49dbd3ed8802b19d9545527620579bd3c4b2b912dd7adf1f9bb490c3dc6a9da79013fe1eb837552499d9ea17e957c45888afdfc5245
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Wireless Access Point Scanner - Ruby Gem
2
+
3
+ WAPS uses iwlist to scan for wireless access points and convert the output into ruby hash format. Following is the usage of the gem.
4
+
5
+ ## Installation
6
+
7
+ ```
8
+ gem install wasp
9
+ ```
10
+ Require
11
+
12
+ ```
13
+ require 'wasp'
14
+ ```
15
+
16
+ ## Usage
17
+
18
+ * First Require the gem: ``` require 'wasp' ```
19
+ * Creating new instance require interface name. Leave it empty if not sure. ``` new_scan = Wasp.new('Interface_name')```
20
+ * Start Scan. ```results = new_scan.scan```
21
+ * Get specific field. ``` mac_address = new_scan.get('address') ```
22
+
23
+ ## Response Field
24
+
25
+ * Address
26
+ * SSID
27
+ * Signal Level
28
+ * Encryption
29
+ * Channel
30
+ * Frequency
31
+ * Quality
32
+
33
+ ## Authors
34
+
35
+ * **Gurjant Singh** - *Initial work* - [gurjant31](https://github.com/gurjant31)
36
+
37
+ See also the list of [contributors](https://github.com/gurjant31/waps/contributors) who participated in this project.
38
+
39
+ ## License
40
+
41
+ This project is licensed under the MIT License - see the LICENSE.md file for details
data/lib/waps.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'open3'
2
+
1
3
  class Waps
2
4
 
3
5
  def initialize(interface_name)
@@ -7,7 +9,7 @@ class Waps
7
9
 
8
10
  def scan
9
11
  raw_input = run_command
10
- @output = parse(raw_input)
12
+ @output = (raw_input.keys.include? :error) ? raw_input : parse(raw_input[:output])
11
13
  end
12
14
 
13
15
  def parse(raw_input)
@@ -17,7 +19,8 @@ class Waps
17
19
  end
18
20
 
19
21
  def run_command
20
- `sudo iwlist #{@interface_name} scan`
22
+ output,error,status = Open3.capture3("sudo iwlist #{@interface_name} scan")
23
+ return output == "" ? {error: error} : {output: output}
21
24
  end
22
25
 
23
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: waps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gurjant Singh
@@ -29,8 +29,10 @@ email:
29
29
  - waps@defensestation.ca
30
30
  executables: []
31
31
  extensions: []
32
- extra_rdoc_files: []
32
+ extra_rdoc_files:
33
+ - README.md
33
34
  files:
35
+ - README.md
34
36
  - lib/waps.rb
35
37
  homepage: https://github.com/gurjant31/waps
36
38
  licenses: