wifi-wand 2.13.0 → 2.14.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: e0669f48a732c950d64056cfdc853ac83b6afb31e35c30c514d026d05f757f80
4
- data.tar.gz: 6117a6a8693b9d9730a159d049a2c442eb53cac6c92f2107c4d257ec7685513c
3
+ metadata.gz: 3c9b7b8e153c2765c68823302d56c2c4a3a3176a430603ab79a31849b7f606bc
4
+ data.tar.gz: 2eb10109cc4edeab46652f92c4e79afdadbff9584da7f98603442d0c550da128
5
5
  SHA512:
6
- metadata.gz: 38d4beb5c03960e90d6e0e0f557f95fe10d319506e7543c83ab2e057e3f06718eb7f0a5ffe2239b8ccdae477b273ba39870ffa94365ef7b3e31c0992c099895a
7
- data.tar.gz: dc747b5765528debc3874cdd7ea07dd5d1f4b2173c000f37854ced5a35b5ba74d5611c31c0114b3080ec3849760fa1eafedb78b6daa5bf9ae388900abc65b071
6
+ metadata.gz: 4e6d207393f4ea32b89b3b731023504afdc8bb60b13a3475e2cb27677656c511b4968a73fecb29c9731e9c545659858ea174bcb474b8736958fdb6499bdaef00
7
+ data.tar.gz: e3189d29f2059a639347acd1338cb3ba45f251aed82fd85de77b4a1a566e5a2038c9b0bb9ad692e2da3d1bcaff08ac3838c0c1665c895380d3778f706c7a5abd
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ ![logo](logo/wifiwand-logo-horizontal-color.png)
2
+
1
3
  # wifi-wand
2
4
 
3
5
  To install this software, run:
@@ -1,3 +1,8 @@
1
+ ## v2.14.0
2
+
3
+ * `ls_avail_nets` command now outputs access points in signal strength order.
4
+ * Add logo to project, show it in README.md.
5
+
1
6
  ## v2.13.0
2
7
 
3
8
  * Fix: network names could not be displayed when one contained a nonstandard character (e.g. D5 for a special apostrophe in Mac Roman encoding).
@@ -9,6 +9,7 @@ class CommandLineInterface
9
9
 
10
10
  attr_reader :interactive_mode, :model, :open_resources, :options
11
11
 
12
+ PROJECT_URL = 'https://github.com/keithrbennett/wifiwand'
12
13
 
13
14
  class Command < Struct.new(:min_string, :max_string, :action); end
14
15
 
@@ -306,15 +307,22 @@ When in interactive shell mode:
306
307
 
307
308
  def cmd_l
308
309
  info = model.available_network_info
310
+
309
311
  if interactive_mode
310
312
  info
311
313
  else
312
- if post_processor
313
- puts post_processor.(info)
314
+ output = ''
315
+ unless model.wifi_on?
316
+ output << "Wifi is off, cannot see available networks."
314
317
  else
315
- message = model.wifi_on? ? fancy_string(info) : "Wifi is off, cannot see available networks."
316
- puts(message)
318
+ if post_processor
319
+ output = post_processor.(info)
320
+ else
321
+ output << "\nAccess points listed in descending order of signal strength (RSSI):\n\n"
322
+ output << fancy_string(info)
323
+ end
317
324
  end
325
+ puts output
318
326
  end
319
327
  end
320
328
 
@@ -378,7 +386,11 @@ When in interactive shell mode:
378
386
  resource_codes.each do |code|
379
387
  resource = OPEN_RESOURCES.find_by_code(code)
380
388
  if resource
381
- model.open_resource(resource.resource)
389
+ if code == 'spe' && Dir.exist?('/Applications/Speedtest.app/')
390
+ model.open_application('Speedtest')
391
+ else
392
+ model.open_resource(resource.resource)
393
+ end
382
394
  end
383
395
  end
384
396
  nil
@@ -469,6 +481,7 @@ When in interactive shell mode:
469
481
  Command.new('pr', 'pref_nets', -> (*_options) { cmd_pr }),
470
482
  Command.new('q', 'quit', -> (*_options) { cmd_q }),
471
483
  Command.new('t', 'till', -> (*options) { cmd_t(*options) }),
484
+ Command.new('u', 'url', -> (*_options) { PROJECT_URL }),
472
485
  Command.new('w', 'wifi_on', -> (*_options) { cmd_w }),
473
486
  Command.new('x', 'xit', -> (*_options) { cmd_x })
474
487
  ]
@@ -76,12 +76,16 @@ class MacOsModel < BaseModel
76
76
  command = "#{airport_command} -s | iconv -f macroman -t utf-8"
77
77
  max_attempts = 50
78
78
 
79
-
80
79
  reformat_line = ->(line) do
81
80
  ssid = line[0..31].strip
82
81
  "%-32.32s%s" % [ssid, line[32..-1]]
83
82
  end
84
83
 
84
+ signal_strength = ->(line) { (line[50..54] || '').to_i }
85
+
86
+ sort_in_place_by_signal_strength = ->(lines) do
87
+ lines.sort! { |x,y| signal_strength.(y) <=> signal_strength.(x) }
88
+ end
85
89
 
86
90
  process_tabular_data = ->(output) do
87
91
  lines = output.split("\n")
@@ -91,12 +95,10 @@ class MacOsModel < BaseModel
91
95
  # Reformat the line so that the name is left instead of right justified
92
96
  reformat_line.(line)
93
97
  end
94
- # TODO: Need to sort case insensitively?:
95
- data_lines.sort!
98
+ sort_in_place_by_signal_strength.(data_lines)
96
99
  [reformat_line.(header_line)] + data_lines
97
100
  end
98
101
 
99
-
100
102
  output = try_os_command_until(command, ->(output) do
101
103
  ! ([nil, ''].include?(output))
102
104
  end)
@@ -349,6 +351,11 @@ class MacOsModel < BaseModel
349
351
  end
350
352
 
351
353
 
354
+ def open_application(application_name)
355
+ run_os_command('open -a ' + application_name)
356
+ end
357
+
358
+
352
359
  def open_resource(resource_url)
353
360
  run_os_command('open ' + resource_url)
354
361
  end
@@ -0,0 +1,3 @@
1
+ # Simple data object to manage data output by
2
+ class AvailableNetworkInfo
3
+ end
@@ -1,5 +1,5 @@
1
1
  module WifiWand
2
2
 
3
- VERSION = '2.13.0'
3
+ VERSION = '2.14.0'
4
4
 
5
5
  end
@@ -0,0 +1,39 @@
1
+ ## Logo Image Files
2
+
3
+ #### wifiwand-logo-horizontal-color.png
4
+ ![h-color](wifiwand-logo-horizontal-color.png)
5
+
6
+ #### wifiwand-logo-horizontal-black.png
7
+ ![h-black](wifiwand-logo-horizontal-black.png)
8
+
9
+ #### wifiwand-logo-horizontal-white.png
10
+
11
+ (White is invisible on this page.)
12
+
13
+ ![h-white](wifiwand-logo-horizontal-white.png)
14
+
15
+
16
+ #### wifiwand-logo-vertical-color.png
17
+ ![v-color](wifiwand-logo-vertical-color.png)
18
+
19
+ #### wifiwand-logo-vertical-black.png
20
+ ![v-black](wifiwand-logo-vertical-black.png)
21
+
22
+ #### wifiwand-logo-vertical-white.png
23
+
24
+ (White is invisible on this page.)
25
+
26
+ ![v-white](wifiwand-logo-vertical-white.png)
27
+
28
+
29
+ #### wifiwand-logomark-color.png
30
+ ![v-color](wifiwand-logomark-color.png)
31
+
32
+ #### wifiwand-logomark-black.png
33
+ ![v-black](wifiwand-logomark-black.png)
34
+
35
+ #### wifiwand-logomark-white.png
36
+
37
+ (White is invisible on this page.)
38
+
39
+ ![v-white](wifiwand-logomark-white.png)
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.13.0
4
+ version: 2.14.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-07-14 00:00:00.000000000 Z
11
+ date: 2018-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -78,7 +78,18 @@ files:
78
78
  - lib/wifi-wand/os/base_os.rb
79
79
  - lib/wifi-wand/os/imaginary_os.rb
80
80
  - lib/wifi-wand/os/mac_os.rb
81
+ - lib/wifi-wand/types/available_network_info.rb
81
82
  - lib/wifi-wand/version.rb
83
+ - logo/logo.md
84
+ - logo/wifiwand-logo-horizontal-black.png
85
+ - logo/wifiwand-logo-horizontal-color.png
86
+ - logo/wifiwand-logo-horizontal-white.png
87
+ - logo/wifiwand-logo-vertical-black.png
88
+ - logo/wifiwand-logo-vertical-color.png
89
+ - logo/wifiwand-logo-vertical-white.png
90
+ - logo/wifiwand-logomark-black.png
91
+ - logo/wifiwand-logomark-color.png
92
+ - logo/wifiwand-logomark-white.png
82
93
  - sample-avail-network-data.xml
83
94
  - sample-available-networks.json
84
95
  - sample-available-networks.yaml
@@ -105,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
116
  version: '0'
106
117
  requirements: []
107
118
  rubyforge_project:
108
- rubygems_version: 2.7.6
119
+ rubygems_version: 2.7.7
109
120
  signing_key:
110
121
  specification_version: 4
111
122
  summary: Mac WiFi utility