shells 0.1.21 → 0.1.22

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
  SHA1:
3
- metadata.gz: b47a6e5df048fa8ed1229c13015262da125d6cd2
4
- data.tar.gz: 88b2df4f88cfe64c16193d217e9e8d53108407ea
3
+ metadata.gz: 740e75fa474c1a977a1ad064cf3cb7da8be71c7a
4
+ data.tar.gz: 6f420afb22bbc58711c7b81da0ee3c709645b2b6
5
5
  SHA512:
6
- metadata.gz: 2582f949e419ef6652ec454ff6e2be3c8c895f6c45f23fcb43d054812d227a11ee1a2b10059ff4a21c5b0f30cf68dd020180777027dee0234bea37850f894f1d
7
- data.tar.gz: 8f132e4aaf642a5c6e2584ce2d0e3a80761458a189ef892f24a981ea2417750aa6b3fc08022bf6c57015824b5de531bd3d4843f389f2029d72d51c47827ac887
6
+ metadata.gz: b4cafdbf8b707bb08cb2d96dd3aefde829509200bdbb0e1770598bd0fa6e88d70f828894dc1794fbbcbfe552d697fd99d1369c6052b30b6eb7e939b6adc03f11
7
+ data.tar.gz: dfaeb51d1e5afe10ab2ed30589c64f7319b09d065532a37d63e65b92db1480b041a400362438db10b4124b1eed577459fb3bf16b3e80ba2d757a5e9c857566a0
@@ -404,7 +404,7 @@ module Shells
404
404
  exec command, options, &block
405
405
  last_exit_code
406
406
  end
407
-
407
+
408
408
  ##
409
409
  # Executes a command ignoring any exit code.
410
410
  #
@@ -428,7 +428,7 @@ module Shells
428
428
 
429
429
 
430
430
  protected
431
-
431
+
432
432
  ##
433
433
  # Validates the options provided to the class.
434
434
  #
@@ -667,9 +667,8 @@ module Shells
667
667
 
668
668
  ##
669
669
  # Processes a debug message.
670
- def self.debug(msg) #:doc:
671
- @debug_proc ||= instance_variable_defined?(:@on_debug) ? (instance_variable_get(:@on_debug) || ->(_) { }) : ->(_){ }
672
- @debug_proc.call(msg)
670
+ def self.debug(msg) #:doc:'
671
+ @on_debug&.call(msg)
673
672
  end
674
673
 
675
674
  ##
@@ -804,10 +803,10 @@ module Shells
804
803
  combined_output
805
804
  end
806
805
 
807
-
806
+
808
807
  if expect_command
809
808
  command_regex = command_match(command)
810
-
809
+
811
810
  # Go until we run out of data or we find one of the possible command starts.
812
811
  # Note that we EXPECT the command to the first line of the output from the command because we expect the
813
812
  # shell to echo it back to us.
@@ -815,11 +814,11 @@ module Shells
815
814
  until result_data.to_s.strip == '' || result_cmd.strip =~ command_regex
816
815
  result_cmd,_,result_data = result_data.partition("\n")
817
816
  end
818
-
817
+
819
818
  if result_cmd.nil? || !(result_cmd =~ command_regex)
820
819
  STDERR.puts "SHELL WARNING: Failed to match #{command_regex.inspect}."
821
820
  end
822
-
821
+
823
822
  result_data
824
823
  else
825
824
  ret
@@ -848,7 +847,7 @@ module Shells
848
847
  def stdcomb_hist
849
848
  @stdcomb_hist ||= []
850
849
  end
851
-
850
+
852
851
  def regex_escape(text)
853
852
  text
854
853
  .gsub('\\', '\\\\')
@@ -865,13 +864,13 @@ module Shells
865
864
  .gsub('$', '\\$')
866
865
  .gsub('^', '\\^')
867
866
  end
868
-
867
+
869
868
  def command_match(command)
870
869
  p = regex_escape @options[:prompt]
871
870
  c = regex_escape command
872
871
  /\A(?:#{p}\s*)?#{c}[ \t]*\z/
873
872
  end
874
-
873
+
875
874
  def prompt_match
876
875
  # allow for trailing spaces or tabs, but no other whitespace.
877
876
  @prompt_match ||= /#{regex_escape @options[:prompt]}[ \t]*$/
@@ -1,3 +1,3 @@
1
1
  module Shells
2
- VERSION = "0.1.21"
2
+ VERSION = "0.1.22"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shells
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.21
4
+ version: 0.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Beau Barker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-14 00:00:00.000000000 Z
11
+ date: 2018-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  version: '0'
154
154
  requirements: []
155
155
  rubyforge_project:
156
- rubygems_version: 2.5.2
156
+ rubygems_version: 2.6.11
157
157
  signing_key:
158
158
  specification_version: 4
159
159
  summary: A set of simple shells for interacting with other devices.