wifi-wand 2.17.0 → 2.18.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71b05a8e0debe969871ce1c44e2a5497458b970f7cf6d666d2035448636f194b
4
- data.tar.gz: 3decf9e34a5aaca2b0d1de7ccb91a93138b002d755c648d0975ca0164a48624d
3
+ metadata.gz: d3618e39101d073349d544a930672b436ed2da7d3c622689e9e8203424ddd44d
4
+ data.tar.gz: c99cb63e34ff7823a7c56c95d0483e1483dcae26df62718fcf01f4cc00dd0ca8
5
5
  SHA512:
6
- metadata.gz: 57fa874a6588a7a03862a2397f172374a3203e27fb0694623a6385a1743d195e1899393705cb6ef2133448e402fdf09a8fd4cebb19dfd67fa16d367addaa9a99
7
- data.tar.gz: 37b6a84124163b57e1a6922f7703dac69bb8ebcddf6c3ac5d4e056404b4a224b27f1a98505f09c798586df6e0a8cd6a6564664775f48742dd28d90d8dbf6f00a
6
+ metadata.gz: f07b8f1498aa244c54a1f8d5be2b78f14e3e4c83191426afd38dec01c735e023182bd5192dd7e64e08b1364620889d5d2a7b9b0d228be51dd51778f5f457c2e9
7
+ data.tar.gz: 795b4bfba2b4a5b5d425caeef7875a68a76886f6672b694265c70caf835b624d38cbc10fd82a89835cf1b8efa19eed9cae523c35b4d5696f74b9743789711b51
data/RELEASE_NOTES.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## v2.18.0
2
+
3
+ * Remove 'hotspot_login_required' informational item and logic (was not working correctly).
4
+
5
+
6
+ ## v2.17.1
7
+
8
+ * Fix verbose output for running a Swift command.
9
+ * Exit Swift programs with code 1 on error.
10
+ * Remove rexml dependency, no longer needed.
11
+
12
+
1
13
  ## v2.17.0
2
14
 
3
15
  * Remove all remaining uses of the 'airport' command.
@@ -130,13 +130,6 @@ class BaseModel
130
130
  end
131
131
 
132
132
 
133
- def hotspot_login_required
134
- response_text = run_os_command('curl --max-time 3 http://captive.apple.com', false)
135
- required = ['Error', '302', 'Hotspot login required'].all? { |s| response_text.include?(s) }
136
- required
137
- end
138
-
139
-
140
133
  # Turns wifi off and then on, reconnecting to the originally connecting network.
141
134
  def cycle_network
142
135
  # TODO: Make this network name saving and restoring conditional on it not having a password.
@@ -171,12 +164,7 @@ class BaseModel
171
164
  # Verify that the network is now connected:
172
165
  actual_network_name = connected_network_name
173
166
 
174
- if actual_network_name == network_name
175
- if hotspot_login_required
176
- puts "Hotspot login required. Opening browser to captive.apple.com."
177
- `open https://captive.apple.com`
178
- end
179
- else
167
+ unless actual_network_name == network_name
180
168
  message = %Q{Expected to connect to "#{network_name}" but }
181
169
  if actual_network_name.nil? || actual_network_name.empty?
182
170
  message << "unable to connect to any network."
@@ -1,6 +1,5 @@
1
1
  require 'ipaddr'
2
2
  require 'ostruct'
3
- require 'rexml/document'
4
3
  require 'shellwords'
5
4
 
6
5
  require_relative 'base_model'
@@ -188,12 +187,9 @@ class MacOsModel < BaseModel
188
187
  false
189
188
  end
190
189
 
191
- need_hotspot_login = hotspot_login_required
192
-
193
190
  info = {
194
191
  'wifi_on' => wifi_on?,
195
192
  'internet_on' => connected,
196
- 'hotspot_login_required' => need_hotspot_login,
197
193
  'interface' => wifi_interface,
198
194
  'network' => connected_network_name,
199
195
  'ip_address' => ip_address,
@@ -202,12 +198,15 @@ class MacOsModel < BaseModel
202
198
  'timestamp' => Time.now,
203
199
  }
204
200
 
205
- if info['internet_on'] && (! need_hotspot_login)
201
+ if info['internet_on']
206
202
  begin
207
203
  info['public_ip'] = public_ip_address_info
208
204
  rescue => e
209
- puts "Error obtaining public IP address info, proceeding with everything else:"
210
- puts e.to_s
205
+ puts <<~MESSAGE
206
+ #{e.class} obtaining public IP address info, proceeding with everything else. Error message:
207
+ #{e}
208
+
209
+ MESSAGE
211
210
  end
212
211
  end
213
212
  info
@@ -313,7 +312,7 @@ class MacOsModel < BaseModel
313
312
  File.dirname(__FILE__), "../../../swift/#{basename}.swift"
314
313
  )
315
314
  command = "swift #{swift_filespec}"
316
- `#{command}`
315
+ run_os_command(command)
317
316
  end
318
317
  end
319
318
  end
@@ -1,3 +1,3 @@
1
1
  module WifiWand
2
- VERSION = '2.17.0' unless defined?(VERSION)
2
+ VERSION = '2.18.0' unless defined?(VERSION)
3
3
  end
@@ -2,10 +2,11 @@
2
2
 
3
3
  import Foundation
4
4
  import CoreWLAN
5
+ import Darwin
5
6
 
6
7
  class NetworkScanner {
7
8
  var currentInterface: CWInterface
8
-
9
+
9
10
  init?() {
10
11
  // Initialize with the default Wi-Fi interface
11
12
  guard let defaultInterface = CWWiFiClient.shared().interface(),
@@ -14,7 +15,7 @@ class NetworkScanner {
14
15
  }
15
16
  self.currentInterface = defaultInterface
16
17
  }
17
-
18
+
18
19
  func available_networks() {
19
20
  do {
20
21
  let networks = try currentInterface.scanForNetworks(withName: nil)
@@ -23,8 +24,9 @@ class NetworkScanner {
23
24
  }
24
25
  } catch let error as NSError {
25
26
  print("Error: \(error.localizedDescription)")
27
+ exit(1)
26
28
  }
27
29
  }
28
30
  }
29
31
 
30
- NetworkScanner()?.available_networks()
32
+ let _ = NetworkScanner()?.available_networks()
data/wifi-wand.gemspec CHANGED
@@ -25,8 +25,6 @@ Gem::Specification.new do |spec|
25
25
  # on last line of method:
26
26
  spec.add_dependency('pry', '>= 0.14.2')
27
27
 
28
- spec.add_dependency('rexml', '>= 3.2.6', '< 4')
29
-
30
28
  spec.add_development_dependency "bundler", ">= 2.5.9"
31
29
  spec.add_development_dependency "rake", ">= 13.2.1"
32
30
  spec.add_development_dependency "rspec", ">= 3.13.0", "< 4"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wifi-wand
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.17.0
4
+ version: 2.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Bennett
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-21 00:00:00.000000000 Z
11
+ date: 2024-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -44,26 +44,6 @@ dependencies:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: 0.14.2
47
- - !ruby/object:Gem::Dependency
48
- name: rexml
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: 3.2.6
54
- - - "<"
55
- - !ruby/object:Gem::Version
56
- version: '4'
57
- type: :runtime
58
- prerelease: false
59
- version_requirements: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: 3.2.6
64
- - - "<"
65
- - !ruby/object:Gem::Version
66
- version: '4'
67
47
  - !ruby/object:Gem::Dependency
68
48
  name: bundler
69
49
  requirement: !ruby/object:Gem::Requirement
@@ -177,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
157
  - !ruby/object:Gem::Version
178
158
  version: '0'
179
159
  requirements: []
180
- rubygems_version: 3.5.7
160
+ rubygems_version: 3.5.9
181
161
  signing_key:
182
162
  specification_version: 4
183
163
  summary: Mac WiFi utility