oxidized-ssh 0.1.2.5 → 0.1.3

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
  SHA1:
3
- metadata.gz: 660b4cbcfd374cdff3bb48e66bd54798c2ff9436
4
- data.tar.gz: b1b896c73c46b27ebb577035c0c96e1be29b3873
3
+ metadata.gz: fb9c05418ae189e693908346e09d671734bedfdc
4
+ data.tar.gz: ba86e2d4552c041a1bc303428ff8e48ca74a74e0
5
5
  SHA512:
6
- metadata.gz: ddcc8e5c54088738f09e5cd7c61d96dcab01f56b2911a6c23754a8e9a1d5b390de66ecb94d0249bc4f06671c95c9b8605dc27f13f9b3f1d3cb394b6099c9d390
7
- data.tar.gz: d201c8cb157ef5a1a8c69ee806c1953cec22428affbde6e7f7a8a8bb877c0d3bf0e672b0ce08c7822349f714b7ad6b1d669f7d0be47443bc71ab606ec965bd0e
6
+ metadata.gz: 74f01e3bf948213dd0d672c643c2372fac701d14cf1ceec805390a50cf1419234b3da8103582246fbe0d6b7ba48cb56c0b5c8f5d622898065be5e5eb2de6873c
7
+ data.tar.gz: ea59dbda3fee12fcda1f1b74985cf47ecffe7fb7a57c597ae984da03a6ed52d10e74978a08523eccbfa5a2533bb31d767e57b302141fea0a233182da11fc0e53
data/lib/oxidized/ssh.rb CHANGED
@@ -32,9 +32,9 @@ module Oxidized
32
32
  return (@connection and not @connection.closed?)
33
33
  end
34
34
 
35
- def exec!(params)
35
+ def exec!(params, expect = @prompt)
36
36
  check_for_connection
37
- exec(params)
37
+ exec(params, expect)
38
38
  sanitize_output_buffer("\n", /\r\n/)
39
39
  sanitize_output_buffer('', params)
40
40
  @output
@@ -44,27 +44,27 @@ module Oxidized
44
44
  prep_connection unless @session
45
45
  end
46
46
 
47
- def exec(params)
47
+ def exec(params, expectation)
48
48
  if @exec
49
- @logger.debug "sending exec command #{params}"
49
+ @logger.debug "sending exec command #{params}" if @debug
50
50
  @output = @connection.exec!(params)
51
51
  else
52
- @logger.debug "sending command #{params} with expectation of #{@prompt}" if @debug
53
- collect_output(params)
52
+ @logger.debug "sending command #{params} with expectation of #{expectation}" if @debug
53
+ collect_output(params, expectation)
54
54
  end
55
55
  end
56
56
 
57
- def collect_output(params)
58
- send_data((params + "\n"))
57
+ def collect_output(params, expectation)
58
+ send_data((params + "\n"), expectation)
59
59
  return @output
60
60
  end
61
61
 
62
- def send_data(params)
63
- expect @prompt
62
+ def send_data(params, expectation)
63
+ expect expectation
64
64
  reset_output_buffer
65
65
  send(params)
66
66
  @session.process
67
- expect @prompt
67
+ expect expectation
68
68
  @output
69
69
  end
70
70
 
@@ -1,5 +1,5 @@
1
1
  module Oxidized
2
2
  module Ssh
3
- VERSION = "0.1.2.5"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oxidized-ssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2.5
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Schylar