mac-wifi 2.1.0 → 2.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 033044a27585d2cb3a3e4920879921e77d91b661021c054118ff273c24386df0
4
- data.tar.gz: 23cf93fcfb0dfef2130347c84fd53f78cc84a1a4b5cd54a7e0d864704aa60027
3
+ metadata.gz: 364ab612e99d7957d20949e0cce4800d0b2f433f9bc3d57eddc489ca2646a569
4
+ data.tar.gz: f0b2a0ba504546d73f399a551e2ea0f5164befbc58f7570687bcdf7109529841
5
5
  SHA512:
6
- metadata.gz: ff355af46081bf8377ad2347a6052f9387fe8ae0940c25e74da67bfc654f8c1cfe866a7e19ae8d1628ab108e7250f5b7f51a8bd3222129abcf32db6de0ccdfed
7
- data.tar.gz: f2a4e67ebba29752fa85caf06f81fdc633c54af2bde9ccea34df4e5fa13e913bf9b6dadab7f1b7b2d47d81ba65e4097e881b5b740b1008918ba417d1a6cac8a6
6
+ metadata.gz: 67f5d51bc48331beee215aeffc2896e679ca61edf94a8b614758de5658babd0820de21ef816cadfea06b0001209149e59042bc27c410448240efcdd016f33333
7
+ data.tar.gz: 40e35d2036816e00ea4791287557055028c7e9be1b7b0a9973e211808ceb5ec0b6d0dfa9f24addb52001c41da86c6815ce4759991226e93d2e34331eb1359ee6
data/README.md CHANGED
@@ -28,7 +28,8 @@ output at the time of this writing:
28
28
  ```
29
29
  $ mac-wifi h
30
30
 
31
- Command Line Switches: [mac-wifi version 2.1.0]
31
+
32
+ Command Line Switches: [mac-wifi version 2.2.0]
32
33
 
33
34
  -o[i,j,p,y] - outputs data in inspect, JSON, puts, or YAML format when not in shell mode
34
35
  -s - run in shell mode
@@ -48,11 +49,11 @@ n[etwork_name] - name (SSID) of currently connected network
48
49
  on - turns wifi on
49
50
  of[f] - turns wifi off
50
51
  pa[ssword] network-name - password for preferred network-name
52
+ pu[blic-ip-show] - opens https://www.whatismyip.com/ in a browser window to show public address info
51
53
  pr[ef_nets] - preferred (not necessarily available) networks
52
54
  q[uit] - exits this program (interactive shell mode only) (see also 'x')
53
55
  r[m_pref_nets] network-name - removes network-name from the preferred networks list
54
56
  (can provide multiple names separated by spaces)
55
- s[hell] - opens an interactive pry shell (command line only)
56
57
  t[ill] - returns when the desired Internet connection state is true. Options:
57
58
  1) 'on'/:on, 'off'/:off, 'conn'/:conn, or 'disc'/:disc
58
59
  2) wait interval, in seconds (optional, defaults to 0.5 seconds)
data/RELEASE_NOTES.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v2.2.0
2
+
3
+ * Add pu[blic-wifi-show] command to open https://www.whatismyip.com/ to show public IP address info.
4
+ * Removed 'vpn on' info from info hash; it was often inaccurate.
5
+
6
+
1
7
  ## v2.1.0
2
8
 
3
9
  * Support for the single script file install has been dropped. It was requiring too much complexity,
@@ -38,11 +38,11 @@ n[etwork_name] - name (SSID) of currently connected network
38
38
  on - turns wifi on
39
39
  of[f] - turns wifi off
40
40
  pa[ssword] network-name - password for preferred network-name
41
+ pu[blic-ip-show] - opens https://www.whatismyip.com/ in a browser window to show public address info
41
42
  pr[ef_nets] - preferred (not necessarily available) networks
42
43
  q[uit] - exits this program (interactive shell mode only) (see also 'x')
43
44
  r[m_pref_nets] network-name - removes network-name from the preferred networks list
44
45
  (can provide multiple names separated by spaces)
45
- s[hell] - opens an interactive pry shell (command line only)
46
46
  t[ill] - returns when the desired Internet connection state is true. Options:
47
47
  1) 'on'/:on, 'off'/:off, 'conn'/:conn, or 'disc'/:disc
48
48
  2) wait interval, in seconds (optional, defaults to 0.5 seconds)
@@ -135,7 +135,7 @@ When in interactive shell mode:
135
135
  require 'pry'
136
136
  rescue LoadError
137
137
  puts "The 'pry' gem and/or one of its prerequisites, required for running the shell, was not found." +
138
- " Please `gem install pry`."
138
+ " Please `gem install pry` or, if necessary, `sudo gem install pry`."
139
139
  exit(-1)
140
140
  end
141
141
 
@@ -201,12 +201,9 @@ When in interactive shell mode:
201
201
  if post_processor
202
202
  puts post_processor.(info)
203
203
  else
204
- message = if model.wifi_on?
205
- "Available networks are:\n\n#{fancy_string(info)}"
206
- else
207
- "Wifi is off, cannot see available networks."
208
- end
209
- puts(message)
204
+ puts model.wifi_on? \
205
+ ? "Available networks are:\n\n#{fancy_string(info)}" \
206
+ : "Wifi is off, cannot see available networks."
210
207
  end
211
208
  end
212
209
  end
@@ -319,6 +316,11 @@ When in interactive shell mode:
319
316
  end
320
317
 
321
318
 
319
+ def cmd_pu
320
+ `open https://www.whatismyip.com/`
321
+ end
322
+
323
+
322
324
  def cmd_q
323
325
  quit
324
326
  end
@@ -371,6 +373,7 @@ When in interactive shell mode:
371
373
  Command.new('on', 'on', -> (*_options) { cmd_on }),
372
374
  Command.new('pa', 'password', -> (*options) { cmd_pa(*options) }),
373
375
  Command.new('pr', 'pref_nets', -> (*_options) { cmd_pr }),
376
+ Command.new('pu', 'public_ip_show',-> (*_options) { cmd_pu }),
374
377
  Command.new('q', 'quit', -> (*_options) { cmd_q }),
375
378
  Command.new('r', 'rm_pref_nets', -> (*options) { cmd_r(*options) }),
376
379
  Command.new('t', 'till', -> (*options) { cmd_t(*options) }),
@@ -13,13 +13,6 @@ class MacOsModel < BaseModel
13
13
  end
14
14
 
15
15
 
16
- # This is determined by whether or not a line like the following appears in the output of `netstat -nr`:
17
- # 0/1 10.137.0.41 UGSc 15 0 utun1
18
- def vpn_running?
19
- run_os_command('netstat -nr').split("\n").grep(/^0\/1.*utun1/).any?
20
- end
21
-
22
-
23
16
  # Identifies the (first) wireless network hardware port in the system, e.g. en0 or en1
24
17
  def wifi_hardware_port
25
18
  @wifi_hardware_port ||= begin
@@ -265,7 +258,6 @@ class MacOsModel < BaseModel
265
258
  info = {
266
259
  wifi_on: wifi_on?,
267
260
  internet_on: connected_to_internet?,
268
- vpn_on: vpn_running?,
269
261
  port: wifi_hardware_port,
270
262
  network: current_network,
271
263
  ip_address: ip_address,
@@ -1,5 +1,5 @@
1
1
  module MacWifi
2
2
 
3
- VERSION = '2.1.0'
3
+ VERSION = '2.2.0'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mac-wifi
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.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: 2018-01-17 00:00:00.000000000 Z
11
+ date: 2018-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler