wifi-wand 2.6.0 → 2.7.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: 3dcc159a696bb6c5802164faa4364c372d12478c38027cc0cef1b8efcd28f4a8
4
- data.tar.gz: f6dcd8a61c97e38c6fe1cd35d6e1c46a5112993c9e3d319dbcd6cc6105b6c963
3
+ metadata.gz: a9019eb4d32759d13110c74b96015eced6ee71a3536c1b9690da24d3a54e812d
4
+ data.tar.gz: b5e805734cf53495aaeab2e1c67c7bb8104af0759980e2836d14c115dd15e5be
5
5
  SHA512:
6
- metadata.gz: f2e6bf5a8ad731631e464826ec096a5ba10e61111aab1ca66232a5f1453ea98d26c0e3b5a670d754f6ff16d0829b9b4177a5276def708f3fe0be6d9385cbe6f5
7
- data.tar.gz: aee01f531189ace41937a7722a413873018792e9a2e161b8dd2634e87c1952763c85f7648ed7b7ac0d0d7b0b205955f70143aaa67f9961abd21eed69176647f9
6
+ metadata.gz: 87872063dd2b7d1093a9340263ca742f2006d337dd43c6f2d30a4e12ba9985c3315b6072c9eb2d234f2b75e9b523d8f688a95f890e2feb7e567e4be7904a6bc7
7
+ data.tar.gz: 9e84a5e8a3a69d425e6c7982571daf3f497e43b845cb5fc663b6c59227af2fda116e6196ad555df0b91b2cca9ed15086c8146052ac4c4e0613b3680ab21ca3de
data/README.md CHANGED
@@ -28,7 +28,7 @@ output at the time of this writing:
28
28
  ```
29
29
  $ wifi-wand -h
30
30
 
31
- Command Line Switches: [wifi-wand version 2.6.0]
31
+ Command Line Switches: [wifi-wand version 2.7.0 at https://github.com/keithrbennett/wifiwand]
32
32
 
33
33
  -o {i,j,k,p,y} - outputs data in inspect, JSON, pretty JSON, puts, or YAML format when not in shell mode
34
34
  -p wifi_port_name - override automatic detection of port name with this name
data/RELEASE_NOTES.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## v2.7.0
2
+
3
+ * Fix models not being loadable after requiring the gem.
4
+ * Add message suggesting to gem install awesome_print to help text if not installed.
5
+ * Add Github project page URL to help text.
6
+ * Rename 'wifion' to 'wifi_on'.
7
+ * Change order of verbose output and error raising in run_os_commmand.
8
+
9
+
1
10
  ## v2.6.0
2
11
 
3
12
  * Add support for getting and setting DNS nameservers with 'na'/'nameservers' command.
data/lib/wifi-wand.rb CHANGED
@@ -1,3 +1,8 @@
1
1
  require_relative 'wifi-wand/version'
2
2
 
3
- require_relative 'wifi-wand/main' # recursively requires the other files
3
+ require_relative 'wifi-wand/main' # recursively requires the other files
4
+ #
5
+ # When additional operating systems are added, we will need to modify this
6
+ # to load only the model appropriate for the environment:
7
+
8
+ require_relative 'wifi-wand/models/mac_os_model'
@@ -50,7 +50,7 @@ class CommandLineInterface
50
50
 
51
51
  # Help text to be used when requested by 'h' command, in case of unrecognized or nonexistent command, etc.
52
52
  HELP_TEXT = "
53
- Command Line Switches: [wifi-wand version #{WifiWand::VERSION}]
53
+ Command Line Switches: [wifi-wand version #{WifiWand::VERSION} at https://github.com/keithrbennett/wifiwand]
54
54
 
55
55
  -o {i,j,k,p,y} - outputs data in inspect, JSON, pretty JSON, puts, or YAML format when not in shell mode
56
56
  -p wifi_port_name - override automatic detection of port name with this name
@@ -97,6 +97,11 @@ When in interactive shell mode:
97
97
  verbose: options.verbose,
98
98
  wifi_port: options.wifi_port
99
99
  })
100
+
101
+ unless awesome_print_available?
102
+ HELP_TEXT << "For nicer output, `gem install awesome_print`.\n\n"
103
+ end
104
+
100
105
  @model = current_os.create_model(model_options)
101
106
  @interactive_mode = !!(options.interactive_mode)
102
107
  run_shell if @interactive_mode
@@ -371,6 +376,7 @@ When in interactive shell mode:
371
376
  end
372
377
  end
373
378
 
379
+
374
380
  def cmd_pa(network)
375
381
  password = model.preferred_network_password(network)
376
382
 
@@ -460,7 +466,7 @@ When in interactive shell mode:
460
466
  Command.new('q', 'quit', -> (*_options) { cmd_q }),
461
467
  Command.new('r', 'rm_pref_nets', -> (*options) { cmd_r(*options) }),
462
468
  Command.new('t', 'till', -> (*options) { cmd_t(*options) }),
463
- Command.new('w', 'wifion', -> (*_options) { cmd_w }),
469
+ Command.new('w', 'wifi_on', -> (*_options) { cmd_w }),
464
470
  Command.new('x', 'xit', -> (*_options) { cmd_x })
465
471
  ]
466
472
  end
@@ -483,7 +489,6 @@ When in interactive shell mode:
483
489
  end
484
490
 
485
491
 
486
-
487
492
  def post_processor
488
493
  options.post_processor
489
494
  end
@@ -40,15 +40,15 @@ class BaseModel
40
40
 
41
41
  output = `#{command} 2>&1` # join stderr with stdout
42
42
 
43
- if $?.exitstatus != 0 && raise_on_error
44
- raise OsCommandError.new($?.exitstatus, command, output)
45
- end
46
-
47
43
  if @verbose_mode
48
44
  puts "\n\n#{'-' * 79}\nCommand: #{command}\n\n"
49
45
  puts "#{output}#{'-' * 79}\n\n"
50
46
  end
51
47
 
48
+ if $?.exitstatus != 0 && raise_on_error
49
+ raise OsCommandError.new($?.exitstatus, command, output)
50
+ end
51
+
52
52
  output
53
53
  end
54
54
 
@@ -1,3 +1,6 @@
1
+ # This class is intended as a placeholder class to test multiple OS support
2
+ # until we have a real Os class for an additional OS.
3
+
1
4
  require_relative 'base_os'
2
5
 
3
6
  module WifiWand
@@ -1,5 +1,5 @@
1
1
  module WifiWand
2
2
 
3
- VERSION = '2.6.0'
3
+ VERSION = '2.7.0'
4
4
 
5
5
  end
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.6.0
4
+ version: 2.7.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-03-07 00:00:00.000000000 Z
11
+ date: 2018-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler