shells 0.1.11 → 0.1.12

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: 82862e0912920fa623b0766397114fbddd0f883c
4
- data.tar.gz: 2d4e7708eb054fc3d43a839e0ec255a0c527719f
3
+ metadata.gz: b8ce1479a5f2cf6fb8e8c529c92e74eb01bfb060
4
+ data.tar.gz: 81d5db302e9090470be0f6372ab3e5b6d37a5cfc
5
5
  SHA512:
6
- metadata.gz: 8984c76d9eda00e16cbb802168c503dd90613cdb99878de4b8be5645d5dc1a57d41628233b07f6b5bd20ac865accdbd3ea8363a0b8f8c508e3ceae3125f5b095
7
- data.tar.gz: cc06b29917d6edb6316263cfacd2cc01e53c7c0c65e12c0852cba7d3b79ec1f2f0775f7ace663284e3a1dab784712e6764228e93808bf3373d21f632c4b6df9e
6
+ metadata.gz: 27e194bfd7653f47a0bf98fb4e3a9186947df74a5b85947fd3f8677480f81eb857f930a1e96cbd848a5ab2799fa87b6a78c53ac05cdfa92beecae19939a09914
7
+ data.tar.gz: 46fd5021248dfe908cdb4c411393c0a972d57bdb2800cdf0ba5663306c42606de7c608bc606e1ca89fd11124fe4315d9a75ee697bf55e454255088d4adae1709
@@ -80,7 +80,7 @@ module Shells
80
80
  debug 'Retrieving exit code from last command...'
81
81
  push_buffer
82
82
  send_data cmd + line_ending
83
- wait_for_prompt nil, 1
83
+ wait_for_prompt 1, 2
84
84
  ret = command_output(cmd).strip.to_i
85
85
  pop_discard_buffer
86
86
  debug 'Exit code: ' + ret.to_s
@@ -131,7 +131,7 @@ module Shells
131
131
 
132
132
  # open the channel
133
133
  debug 'Opening channel...'
134
- ssh.open_channel do |ch|
134
+ @channel = ssh.open_channel do |ch|
135
135
  # request a PTY
136
136
  debug 'Requesting PTY...'
137
137
  ch.request_pty do |ch_pty, success_pty|
@@ -140,7 +140,6 @@ module Shells
140
140
  # pick a method to start the shell with.
141
141
  meth = (options[:shell] == :shell) ? :send_channel_request : :exec
142
142
 
143
- @channel = ch_pty
144
143
  buffer_input
145
144
 
146
145
  # start the shell
@@ -161,17 +160,14 @@ module Shells
161
160
  debug 'Closing connection...'
162
161
  send_data options[:quit] + line_ending
163
162
  end
164
-
165
- @channel.wait
166
163
  end
167
-
168
164
  end
169
-
170
- debug 'Waiting for channel to close...'
171
- ch.wait
172
- debug 'Channel has been closed.'
173
165
  end
174
166
 
167
+ debug 'Waiting for channel to close...'
168
+ @channel.wait
169
+ debug 'Channel has been closed.'
170
+
175
171
  end
176
172
  rescue IOError
177
173
  unless ignore_io_error
@@ -1,3 +1,3 @@
1
1
  module Shells
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.12"
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.11
4
+ version: 0.1.12
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-08-10 00:00:00.000000000 Z
11
+ date: 2017-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh