wifi-wand 2.4.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.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +363 -0
- data/RELEASE_NOTES.md +81 -0
- data/exe/wifi-wand +24 -0
- data/lib/wifi-wand.rb +3 -0
- data/lib/wifi-wand/command_line_interface.rb +462 -0
- data/lib/wifi-wand/main.rb +66 -0
- data/lib/wifi-wand/models/base_model.rb +250 -0
- data/lib/wifi-wand/models/mac_os_model.rb +299 -0
- data/lib/wifi-wand/operating_systems.rb +51 -0
- data/lib/wifi-wand/os/base_os.rb +25 -0
- data/lib/wifi-wand/os/imaginary_os.rb +19 -0
- data/lib/wifi-wand/os/mac_os.rb +20 -0
- data/lib/wifi-wand/version.rb +5 -0
- data/sample-avail-network-data.xml +4042 -0
- data/sample-available-networks.json +27 -0
- data/sample-available-networks.yaml +26 -0
- data/spec/wifi-wand_spec.rb +114 -0
- data/wifi-wand.gemspec +28 -0
- metadata +108 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[
|
|
2
|
+
".@ AIS SUPER WiFi",
|
|
3
|
+
".@ TrueMove H",
|
|
4
|
+
"@ 3BB_WiFi",
|
|
5
|
+
"@BurgerKing_AIS",
|
|
6
|
+
"@TRUEWIFI",
|
|
7
|
+
"AIS SMART Login",
|
|
8
|
+
"AndroidHotspot1389",
|
|
9
|
+
"APSXCMI0008E09",
|
|
10
|
+
"BCY_tapae",
|
|
11
|
+
"BCY_tapae_5G",
|
|
12
|
+
"DIRECT-AF-BRAVIA",
|
|
13
|
+
"Hotel M Chiangmai",
|
|
14
|
+
"JOYFUL 2F",
|
|
15
|
+
"JUM",
|
|
16
|
+
"Morradoke Thai",
|
|
17
|
+
"PaiDoiCoffee",
|
|
18
|
+
"Tapaepost_5G",
|
|
19
|
+
"TCC-HH-MFG",
|
|
20
|
+
"TCCSTAFFWIFI",
|
|
21
|
+
"ThaPhaeNail",
|
|
22
|
+
"Tharatong",
|
|
23
|
+
"Tharatong 5G",
|
|
24
|
+
"The Coffee Club Free WiFi",
|
|
25
|
+
"W06MNTH-1_270",
|
|
26
|
+
"🌜ERINNNN.🌛 26:f0 :"
|
|
27
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
- ".@ AIS SUPER WiFi"
|
|
3
|
+
- ".@ TrueMove H"
|
|
4
|
+
- "@ 3BB_WiFi"
|
|
5
|
+
- "@BurgerKing_AIS"
|
|
6
|
+
- "@TRUEWIFI"
|
|
7
|
+
- AIS SMART Login
|
|
8
|
+
- AndroidHotspot1389
|
|
9
|
+
- APSXCMI0008E09
|
|
10
|
+
- BCY_tapae
|
|
11
|
+
- BCY_tapae_5G
|
|
12
|
+
- DIRECT-AF-BRAVIA
|
|
13
|
+
- Hotel M Chiangmai
|
|
14
|
+
- JOYFUL 2F
|
|
15
|
+
- JUM
|
|
16
|
+
- Morradoke Thai
|
|
17
|
+
- PaiDoiCoffee
|
|
18
|
+
- Tapaepost_5G
|
|
19
|
+
- TCC-HH-MFG
|
|
20
|
+
- TCCSTAFFWIFI
|
|
21
|
+
- ThaPhaeNail
|
|
22
|
+
- Tharatong
|
|
23
|
+
- Tharatong 5G
|
|
24
|
+
- The Coffee Club Free WiFi
|
|
25
|
+
- W06MNTH-1_270
|
|
26
|
+
- "\U0001F31CERINNNN.\U0001F31B 26:f0 :"
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# The functionality of this software is very difficult to test,
|
|
2
|
+
# sinece it relies on external conditions that cannot be faked.
|
|
3
|
+
# These tests merely run the commands and assert that no
|
|
4
|
+
# error has occurred; they don't make any attempt to verify the data.
|
|
5
|
+
# Many of them are run once with the wifi on, and once when it's off.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
load File.join(File.dirname(__FILE__), '..', 'bin', 'wifi-wand')
|
|
9
|
+
|
|
10
|
+
module WifiWand
|
|
11
|
+
|
|
12
|
+
describe MacOsModel do
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
subject { MacOsModel.new }
|
|
16
|
+
|
|
17
|
+
context 'turning wifi on and off' do
|
|
18
|
+
it 'can turn wifi on' do
|
|
19
|
+
subject.wifi_off
|
|
20
|
+
expect(subject.wifi_on?).to eq(false)
|
|
21
|
+
subject.wifi_on
|
|
22
|
+
expect(subject.wifi_on?).to eq(true)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it 'can turn wifi off' do
|
|
26
|
+
subject.wifi_on
|
|
27
|
+
expect(subject.wifi_on?).to eq(true)
|
|
28
|
+
subject.wifi_off
|
|
29
|
+
expect(subject.wifi_on?).to eq(false)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
it 'can cycle network' do
|
|
33
|
+
subject.wifi_on
|
|
34
|
+
subject.cycle_network
|
|
35
|
+
expect(subject.wifi_on?).to eq(true)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
it 'can list available networks' do
|
|
39
|
+
subject.wifi_on
|
|
40
|
+
subject.available_network_info
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
shared_examples_for 'testing to see commands complete without error' do |wifi_starts_on|
|
|
46
|
+
|
|
47
|
+
it 'can determine if connected to Internet' do
|
|
48
|
+
wifi_starts_on ? subject.wifi_on : subject.wifi_off
|
|
49
|
+
# We cannot assert that we're connected to the Internet even
|
|
50
|
+
# if the wifi is on, because we're probably not connected to a network.
|
|
51
|
+
subject.connected_to_internet?
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
it 'can get wifi port' do
|
|
55
|
+
wifi_starts_on ? subject.wifi_on : subject.wifi_off
|
|
56
|
+
subject.wifi_hardware_port
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
it 'can list info' do
|
|
60
|
+
wifi_starts_on ? subject.wifi_on : subject.wifi_off
|
|
61
|
+
subject.wifi_info
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
it 'can list preferred networks' do
|
|
65
|
+
wifi_starts_on ? subject.wifi_on : subject.wifi_off
|
|
66
|
+
subject.preferred_networks
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
it 'can see if wifi is on' do
|
|
70
|
+
wifi_starts_on ? subject.wifi_on : subject.wifi_off
|
|
71
|
+
subject.wifi_on?
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
it 'can query the connected network name' do
|
|
75
|
+
wifi_starts_on ? subject.wifi_on : subject.wifi_off
|
|
76
|
+
name = subject.connected_network_name
|
|
77
|
+
unless subject.wifi_on?
|
|
78
|
+
expect(name).to eq(nil)
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# it 'can attempt to connect to a network' do
|
|
83
|
+
# pending 'cannot reliably expect any given network to be available'
|
|
84
|
+
# end
|
|
85
|
+
|
|
86
|
+
# it 'can determine the IP address on the network' do
|
|
87
|
+
# pending 'How to reliably reproduce connection to a network?'
|
|
88
|
+
# end
|
|
89
|
+
|
|
90
|
+
it 'can determine the current network' do
|
|
91
|
+
wifi_starts_on ? subject.wifi_on : subject.wifi_off
|
|
92
|
+
network = subject.current_network
|
|
93
|
+
unless subject.wifi_on?
|
|
94
|
+
expect(network).to eq(nil)
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
it 'can call disconnect twice consecutively' do
|
|
99
|
+
wifi_starts_on ? subject.wifi_on : subject.wifi_off
|
|
100
|
+
subject.disconnect
|
|
101
|
+
subject.disconnect
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
context 'wifi starts on' do # without a context block the way that rspec expands the examples causes the parameters to overwrite each other
|
|
106
|
+
include_examples 'testing to see commands complete without error', true
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
context 'wifi starts off' do # without a context block the way that rspec expands the examples causes the parameters to overwrite each other
|
|
110
|
+
include_examples 'testing to see commands complete without error', false
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
end
|
data/wifi-wand.gemspec
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
require_relative 'lib/wifi-wand/version'
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "wifi-wand"
|
|
7
|
+
spec.version = WifiWand::VERSION
|
|
8
|
+
spec.authors = ["Keith Bennett"]
|
|
9
|
+
spec.email = ["keithrbennett@gmail.com"]
|
|
10
|
+
spec.description = %q{A command line interface for managing wifi on a Mac.}
|
|
11
|
+
spec.summary = %q{Mac wifi utility}
|
|
12
|
+
spec.homepage = "https://github.com/keithrbennett/wifi-wand"
|
|
13
|
+
spec.license = "MIT"
|
|
14
|
+
|
|
15
|
+
spec.files = `git ls-files`.split($/)
|
|
16
|
+
spec.bindir = 'exe'
|
|
17
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
18
|
+
|
|
19
|
+
spec.require_paths = ["lib"]
|
|
20
|
+
|
|
21
|
+
# spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
22
|
+
|
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
|
24
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
25
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
|
metadata
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: wifi-wand
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 2.4.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Keith Bennett
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2018-02-04 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.16'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.16'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '10.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '10.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rspec
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '3.0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '3.0'
|
|
55
|
+
description: A command line interface for managing wifi on a Mac.
|
|
56
|
+
email:
|
|
57
|
+
- keithrbennett@gmail.com
|
|
58
|
+
executables:
|
|
59
|
+
- wifi-wand
|
|
60
|
+
extensions: []
|
|
61
|
+
extra_rdoc_files: []
|
|
62
|
+
files:
|
|
63
|
+
- ".gitignore"
|
|
64
|
+
- Gemfile
|
|
65
|
+
- LICENSE.txt
|
|
66
|
+
- README.md
|
|
67
|
+
- RELEASE_NOTES.md
|
|
68
|
+
- exe/wifi-wand
|
|
69
|
+
- lib/wifi-wand.rb
|
|
70
|
+
- lib/wifi-wand/command_line_interface.rb
|
|
71
|
+
- lib/wifi-wand/main.rb
|
|
72
|
+
- lib/wifi-wand/models/base_model.rb
|
|
73
|
+
- lib/wifi-wand/models/mac_os_model.rb
|
|
74
|
+
- lib/wifi-wand/operating_systems.rb
|
|
75
|
+
- lib/wifi-wand/os/base_os.rb
|
|
76
|
+
- lib/wifi-wand/os/imaginary_os.rb
|
|
77
|
+
- lib/wifi-wand/os/mac_os.rb
|
|
78
|
+
- lib/wifi-wand/version.rb
|
|
79
|
+
- sample-avail-network-data.xml
|
|
80
|
+
- sample-available-networks.json
|
|
81
|
+
- sample-available-networks.yaml
|
|
82
|
+
- spec/wifi-wand_spec.rb
|
|
83
|
+
- wifi-wand.gemspec
|
|
84
|
+
homepage: https://github.com/keithrbennett/wifi-wand
|
|
85
|
+
licenses:
|
|
86
|
+
- MIT
|
|
87
|
+
metadata: {}
|
|
88
|
+
post_install_message:
|
|
89
|
+
rdoc_options: []
|
|
90
|
+
require_paths:
|
|
91
|
+
- lib
|
|
92
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '0'
|
|
97
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
|
+
requirements:
|
|
99
|
+
- - ">="
|
|
100
|
+
- !ruby/object:Gem::Version
|
|
101
|
+
version: '0'
|
|
102
|
+
requirements: []
|
|
103
|
+
rubyforge_project:
|
|
104
|
+
rubygems_version: 2.7.3
|
|
105
|
+
signing_key:
|
|
106
|
+
specification_version: 4
|
|
107
|
+
summary: Mac wifi utility
|
|
108
|
+
test_files: []
|