summaryrefslogtreecommitdiff
path: root/classes/Net/SSH/Multi/Channel.html
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Net/SSH/Multi/Channel.html')
-rw-r--r--classes/Net/SSH/Multi/Channel.html480
1 files changed, 244 insertions, 236 deletions
diff --git a/classes/Net/SSH/Multi/Channel.html b/classes/Net/SSH/Multi/Channel.html
index 779b48c..e535eb3 100644
--- a/classes/Net/SSH/Multi/Channel.html
+++ b/classes/Net/SSH/Multi/Channel.html
@@ -1,9 +1,9 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang='en'>
<head>
- <title>: Net::SSH::Multi::Channel [Control multiple Net::SSH connections via a single interface.]</title>
- <meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
- <link href='../../../../rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
+ <title>Net::SSH::Multi::Channel</title>
+ <meta content='text/html; charset=US-ASCII' http-equiv='Content-Type'>
+ <link href='../../../../css/style.css' media='screen' rel='stylesheet' type='text/css'>
<script type='text/javascript'>
//<![CDATA[
function popupCode(url) {
@@ -26,65 +26,70 @@
<div class='class' id='wrapper'>
<div class='header'>
<h1 class='name'>
- <span class='type'>Class</span>
+ <span class='type'>class</span>
Net::SSH::Multi::Channel
</h1>
<ol class='paths'>
<li>
- <a href="../../../../files/lib/net/ssh/multi/channel_rb.html">lib/net/ssh/multi/channel.rb</a>
+ <a target="docwin" href="../../../../files/lib/net/ssh/multi/channel_rb.html">lib/net/ssh/multi/channel.rb</a>
</li>
</ol>
<div class='parent'>
Parent:
- <strong>Object</strong>
+ <strong><a target="docwin" href="../Multi.html">Multi</a></strong>
</div>
</div>
<div id='content'>
<div id='text'>
<div id='description'>
- <p>
- <a href="Channel.html">Net::SSH::Multi::Channel</a> encapsulates a
+
+ <p><a href="Channel.html">Net::SSH::Multi::Channel</a> encapsulates a
collection of Net::SSH::Connection::Channel instances from multiple
different connections. It allows for operations to be performed on all
contained channels, simultaneously, using an interface mostly identical to
- Net::SSH::Connection::Channel itself.
- </p>
- <p>
- You typically obtain a <a href="Channel.html">Net::SSH::Multi::Channel</a>
- instance via Net::SSH::Multi::Session#open_channel or
- Net::SSH::Multi::Session#exec, though there is nothing stopping you from
- instantiating one yourself with a handful of Net::SSH::Connection::Channel
- objects (though they should be associated with connections managed by a <a
+ Net::SSH::Connection::Channel itself.</p>
+
+ <p>You typically obtain a <a href="Channel.html">Net::SSH::Multi::Channel</a>
+ instance via <a
+ href="SessionActions.html#method-i-open_channel">Net::SSH::Multi::SessionActions#open_channel</a>
+ or <a
+ href="SessionActions.html#method-i-exec">Net::SSH::Multi::SessionActions#exec</a>,
+ though there is nothing stopping you from instantiating one yourself with a
+ handful of Net::SSH::Connection::Channel objects (though they should be
+ associated with connections managed by a <a
href="Session.html">Net::SSH::Multi::Session</a> object for consistent
- behavior).
- </p>
- <pre>channel = session.open_channel do |ch|&#x000A; # ...&#x000A;end&#x000A;&#x000A;channel.wait</pre>
+ behavior).</p>
+
+ <pre class="ruby"><span class="ruby-identifier">channel</span> = <span class="ruby-identifier">session</span>.<span class="ruby-identifier">open_channel</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ch</span><span class="ruby-operator">|</span>&#x000A; <span class="ruby-comment"># ...</span>&#x000A;<span class="ruby-keyword">end</span>&#x000A;&#x000A;<span class="ruby-identifier">channel</span>.<span class="ruby-identifier">wait</span></pre>
</div>
<div id='method-list'>
<h2>Methods</h2>
- <h3>public class</h3>
+ <h3>Public Class</h3>
<ol>
- <li><a href="#M000009">new</a></li>
+ <li><a target="docwin" href="#method-c-new">new</a></li>
</ol>
- <h3>public instance</h3>
+ <h3>Public Instance</h3>
<ol>
- <li><a href="#M000011">[]</a></li>
- <li><a href="#M000012">[]=</a></li>
- <li><a href="#M000016">active?</a></li>
- <li><a href="#M000018">close</a></li>
- <li><a href="#M000010">each</a></li>
- <li><a href="#M000019">eof!</a></li>
- <li><a href="#M000013">exec</a></li>
- <li><a href="#M000023">on_close</a></li>
- <li><a href="#M000020">on_data</a></li>
- <li><a href="#M000024">on_eof</a></li>
- <li><a href="#M000021">on_extended_data</a></li>
- <li><a href="#M000025">on_open_failed</a></li>
- <li><a href="#M000022">on_process</a></li>
- <li><a href="#M000026">on_request</a></li>
- <li><a href="#M000014">request_pty</a></li>
- <li><a href="#M000015">send_data</a></li>
- <li><a href="#M000017">wait</a></li>
+ <li><a target="docwin" href="#method-i-5B-5D">[]</a></li>
+ <li><a target="docwin" href="#method-i-5B-5D-3D">[]=</a></li>
+ <li><a target="docwin" href="#method-i-active-3F">active?</a></li>
+ <li><a target="docwin" href="#attribute-i-channels">channels</a></li>
+ <li><a target="docwin" href="#method-i-close">close</a></li>
+ <li><a target="docwin" href="#attribute-i-connection">connection</a></li>
+ <li><a target="docwin" href="#method-i-each">each</a></li>
+ <li><a target="docwin" href="#method-i-eof-21">eof!</a></li>
+ <li><a target="docwin" href="#method-i-exec">exec</a></li>
+ <li><a target="docwin" href="#method-i-on_close">on_close</a></li>
+ <li><a target="docwin" href="#method-i-on_data">on_data</a></li>
+ <li><a target="docwin" href="#method-i-on_eof">on_eof</a></li>
+ <li><a target="docwin" href="#method-i-on_extended_data">on_extended_data</a></li>
+ <li><a target="docwin" href="#method-i-on_open_failed">on_open_failed</a></li>
+ <li><a target="docwin" href="#method-i-on_process">on_process</a></li>
+ <li><a target="docwin" href="#method-i-on_request">on_request</a></li>
+ <li><a target="docwin" href="#attribute-i-properties">properties</a></li>
+ <li><a target="docwin" href="#method-i-request_pty">request_pty</a></li>
+ <li><a target="docwin" href="#method-i-send_data">send_data</a></li>
+ <li><a target="docwin" href="#method-i-wait">wait</a></li>
</ol>
</div>
<div id='context'>
@@ -101,427 +106,430 @@
<div class='name-list'>
<table>
<tr class='top-aligned-row context-row'>
- <td class='context-item-name'>channels</td>
+ <td class='context-item-name'>
+ <a name='attribute-i-channels'>channels</a>
+ </td>
<td class='context-item-value'>[R]</td>
<td class='context-item-desc'>
- The collection of Net::SSH::Connection::Channel instances that this
- multi-channel aggregates.
+ <p>The collection of Net::SSH::Connection::Channel instances that this
+ multi-channel aggregates.</p>
</td>
</tr>
<tr class='top-aligned-row context-row'>
- <td class='context-item-name'>connection</td>
+ <td class='context-item-name'>
+ <a name='attribute-i-connection'>connection</a>
+ </td>
<td class='context-item-value'>[R]</td>
<td class='context-item-desc'>
- The <a href="Session.html">Net::SSH::Multi::Session</a> instance that
- controls this channel collection.
+ <p>The <a href="Session.html">Net::SSH::Multi::Session</a> instance that
+ controls this channel collection.</p>
</td>
</tr>
<tr class='top-aligned-row context-row'>
- <td class='context-item-name'>properties</td>
+ <td class='context-item-name'>
+ <a name='attribute-i-properties'>properties</a>
+ </td>
<td class='context-item-value'>[R]</td>
<td class='context-item-desc'>
- A Hash of custom properties that may be set and queried on this object.
+ <p>A Hash of custom properties that may be set and queried on this object.</p>
</td>
</tr>
</table>
</div>
</div>
<div id='methods'>
- <h2>Public class methods</h2>
- <div class='method public-class' id='method-M000009'>
- <a name='M000009'> </a>
+ <h2>Public Class methods</h2>
+ <div class='method public-class' id='method-method-c-new'>
+ <a name='method-c-new'></a>
<div class='synopsis'>
<span class='name'>new</span>
<span class='arguments'>(connection, channels)</span>
</div>
<div class='description'>
- <p>
- Instantiate a new <a href="Channel.html">Net::SSH::Multi::Channel</a>
- instance, controlled by the given <tt>connection</tt> (a <a
+
+ <p>Instantiate a new <a href="Channel.html">Net::SSH::Multi::Channel</a>
+ instance, controlled by the given <code>connection</code> (a <a
href="Session.html">Net::SSH::Multi::Session</a> object) and wrapping the
- given <tt>channels</tt> (Net::SSH::Connection::Channel instances).
- </p>
- <p>
- You will typically never call this directly; rather, you&#8217;ll get your
- multi-channel references via Net::SSH::Multi::Session#open_channel and
- friends.
- </p>
+ given <code>channels</code> (Net::SSH::Connection::Channel instances).</p>
+
+ <p>You will typically never call this directly; rather, you'll get your
+ multi-channel references via <a
+ href="SessionActions.html#method-i-open_channel">Net::SSH::Multi::SessionActions#open_channel</a>
+ and friends.</p>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000009-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-c-new-source'); return false">
[show source]
</a>
- <pre id='M000009-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 38</span>&#x000A;38: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">connection</span>, <span class="ruby-identifier">channels</span>)&#x000A;39: <span class="ruby-ivar">@connection</span> = <span class="ruby-identifier">connection</span>&#x000A;40: <span class="ruby-ivar">@channels</span> = <span class="ruby-identifier">channels</span>&#x000A;41: <span class="ruby-ivar">@properties</span> = {}&#x000A;42: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-c-new-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 38</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">connection</span>, <span class="ruby-identifier">channels</span>)&#x000A; <span class="ruby-ivar">@connection</span> = <span class="ruby-identifier">connection</span>&#x000A; <span class="ruby-ivar">@channels</span> = <span class="ruby-identifier">channels</span>&#x000A; <span class="ruby-ivar">@properties</span> = {}&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <h2>Public instance methods</h2>
- <div class='method public-instance' id='method-M000011'>
- <a name='M000011'> </a>
+ <h2>Public Instance methods</h2>
+ <div class='method public-instance' id='method-method-i-5B-5D'>
+ <a name='method-i-5B-5D'></a>
<div class='synopsis'>
<span class='name'>[]</span>
<span class='arguments'>(key)</span>
</div>
<div class='description'>
- <p>
- Retrieve the property (see properties) with the given <tt>key</tt>.
- </p>
+
+ <p>Retrieve the property (see <a
+ href="Channel.html#attribute-i-properties">properties</a>) with the given
+ <code>key</code>.</p>
+
<pre>host = channel[:host]</pre>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000011-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-5B-5D-source'); return false">
[show source]
</a>
- <pre id='M000011-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 53</span>&#x000A;53: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)&#x000A;54: <span class="ruby-ivar">@properties</span>[<span class="ruby-identifier">key</span>]&#x000A;55: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-5B-5D-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 53</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)&#x000A; <span class="ruby-ivar">@properties</span>[<span class="ruby-identifier">key</span>]&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <div class='method public-instance' id='method-M000012'>
- <a name='M000012'> </a>
+ <div class='method public-instance' id='method-method-i-5B-5D-3D'>
+ <a name='method-i-5B-5D-3D'></a>
<div class='synopsis'>
<span class='name'>[]=</span>
<span class='arguments'>(key, value)</span>
</div>
<div class='description'>
- <p>
- Set the property (see properties) with the given <tt>key</tt> to the given
- <tt>value</tt>.
- </p>
+
+ <p>Set the property (see <a
+ href="Channel.html#attribute-i-properties">properties</a>) with the given
+ <code>key</code> to the given <code>value</code>.</p>
+
<pre>channel[:visited] = true</pre>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000012-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-5B-5D-3D-source'); return false">
[show source]
</a>
- <pre id='M000012-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 61</span>&#x000A;61: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)&#x000A;62: <span class="ruby-ivar">@properties</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>&#x000A;63: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-5B-5D-3D-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 61</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)&#x000A; <span class="ruby-ivar">@properties</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <div class='method public-instance' id='method-M000016'>
- <a name='M000016'> </a>
+ <div class='method public-instance' id='method-method-i-active-3F'>
+ <a name='method-i-active-3F'></a>
<div class='synopsis'>
<span class='name'>active?</span>
<span class='arguments'>()</span>
</div>
<div class='description'>
- <p>
- Returns true as long as any of the component channels are active.
- </p>
+
+ <p>Returns true as long as any of the component channels are active.</p>
+
<pre>connection.loop { channel.active? }</pre>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000016-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-active-3F-source'); return false">
[show source]
</a>
- <pre id='M000016-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 112</span>&#x000A;112: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">active?</span>&#x000A;113: <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">any?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">active?</span> }&#x000A;114: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-active-3F-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 112</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">active?</span>&#x000A; <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">any?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">active?</span> }&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <div class='method public-instance' id='method-M000018'>
- <a name='M000018'> </a>
+ <div class='method public-instance' id='method-method-i-close'>
+ <a name='method-i-close'></a>
<div class='synopsis'>
<span class='name'>close</span>
<span class='arguments'>()</span>
</div>
<div class='description'>
- <p>
- Closes all component channels.
- </p>
+
+ <p>Closes all component channels.</p>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000018-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-close-source'); return false">
[show source]
</a>
- <pre id='M000018-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 127</span>&#x000A;127: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close</span>&#x000A;128: <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">close</span> }&#x000A;129: <span class="ruby-keyword kw">self</span>&#x000A;130: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-close-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 127</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">close</span>&#x000A; <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">close</span> }&#x000A; <span class="ruby-keyword">self</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <div class='method public-instance' id='method-M000010'>
- <a name='M000010'> </a>
+ <div class='method public-instance' id='method-method-i-each'>
+ <a name='method-i-each'></a>
<div class='synopsis'>
<span class='name'>each</span>
- <span class='arguments'>() {|channel| ...}</span>
+ <span class='arguments'>()</span>
</div>
<div class='description'>
- <p>
- Iterate over each component channel object, yielding each in order to the
- associated block.
- </p>
+
+ <p>Iterate over each component channel object, yielding each in order to the
+ associated block.</p>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000010-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-each-source'); return false">
[show source]
</a>
- <pre id='M000010-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 46</span>&#x000A;46: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each</span>&#x000A;47: <span class="ruby-ivar">@channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">channel</span> }&#x000A;48: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-each-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 46</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">each</span>&#x000A; <span class="ruby-ivar">@channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-keyword">yield</span> <span class="ruby-identifier">channel</span> }&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <div class='method public-instance' id='method-M000019'>
- <a name='M000019'> </a>
+ <div class='method public-instance' id='method-method-i-eof-21'>
+ <a name='method-i-eof-21'></a>
<div class='synopsis'>
<span class='name'>eof!</span>
<span class='arguments'>()</span>
</div>
<div class='description'>
- <p>
- Tells the remote process for each component channel not to expect any
- further data from this end of the channel.
- </p>
+
+ <p>Tells the remote process for each component channel not to expect any
+ further data from this end of the channel.</p>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000019-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-eof-21-source'); return false">
[show source]
</a>
- <pre id='M000019-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 134</span>&#x000A;134: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">eof!</span>&#x000A;135: <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">eof!</span> }&#x000A;136: <span class="ruby-keyword kw">self</span>&#x000A;137: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-eof-21-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 134</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">eof!</span>&#x000A; <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">eof!</span> }&#x000A; <span class="ruby-keyword">self</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <div class='method public-instance' id='method-M000013'>
- <a name='M000013'> </a>
+ <div class='method public-instance' id='method-method-i-exec'>
+ <a name='method-i-exec'></a>
<div class='synopsis'>
<span class='name'>exec</span>
- <span class='arguments'>(command, &amp;block)</span>
+ <span class='arguments'>(command, &block)</span>
</div>
<div class='description'>
- <p>
- Perform an <tt>exec</tt> command on all component channels. The block, if
- given, is passed to each component channel, so it will (potentially) be
+
+ <p>Perform an <code>exec</code> command on all component channels. The block,
+ if given, is passed to each component channel, so it will (potentially) be
invoked once for every channel in the collection. The block will receive
two parameters: the specific channel object being operated on, and a
- boolean indicating whether the exec succeeded or not.
- </p>
- <pre>channel.exec &quot;ls -l&quot; do |ch, success|&#x000A; # ...&#x000A;end</pre>
- <p>
- See the documentation in <a href="../../SSH.html">Net::SSH</a> for
+ boolean indicating whether the exec succeeded or not.</p>
+
+ <pre class="ruby"><span class="ruby-identifier">channel</span>.<span class="ruby-identifier">exec</span> <span class="ruby-string">&quot;ls -l&quot;</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ch</span>, <span class="ruby-identifier">success</span><span class="ruby-operator">|</span>&#x000A; <span class="ruby-comment"># ...</span>&#x000A;<span class="ruby-keyword">end</span></pre>
+
+ <p>See the documentation in <a href="../../SSH.html">Net::SSH</a> for
Net::SSH::Connection::Channel#exec for more information on how to work with
- the callback.
- </p>
+ the callback.</p>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000013-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-exec-source'); return false">
[show source]
</a>
- <pre id='M000013-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 77</span>&#x000A;77: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exec</span>(<span class="ruby-identifier">command</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;78: <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">exec</span>(<span class="ruby-identifier">command</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) }&#x000A;79: <span class="ruby-keyword kw">self</span>&#x000A;80: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-exec-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 77</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">exec</span>(<span class="ruby-identifier">command</span>, &amp;<span class="ruby-identifier">block</span>)&#x000A; <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">exec</span>(<span class="ruby-identifier">command</span>, &amp;<span class="ruby-identifier">block</span>) }&#x000A; <span class="ruby-keyword">self</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <div class='method public-instance' id='method-M000023'>
- <a name='M000023'> </a>
+ <div class='method public-instance' id='method-method-i-on_close'>
+ <a name='method-i-on_close'></a>
<div class='synopsis'>
<span class='name'>on_close</span>
- <span class='arguments'>(&amp;block)</span>
+ <span class='arguments'>(&block)</span>
</div>
<div class='description'>
- <p>
- Registers a callback on all component channels, to be invoked when the
+
+ <p>Registers a callback on all component channels, to be invoked when the
remote server terminates the channel. The callback will be invoked with one
- argument: the specific channel object being closed.
- </p>
- <pre>channel.on_close do |ch|&#x000A; # ...&#x000A;end</pre>
+ argument: the specific channel object being closed.</p>
+
+ <pre class="ruby"><span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_close</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ch</span><span class="ruby-operator">|</span>&#x000A; <span class="ruby-comment"># ...</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000023-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-on_close-source'); return false">
[show source]
</a>
- <pre id='M000023-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 185</span>&#x000A;185: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">on_close</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;186: <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_close</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) }&#x000A;187: <span class="ruby-keyword kw">self</span>&#x000A;188: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-on_close-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 185</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">on_close</span>(&amp;<span class="ruby-identifier">block</span>)&#x000A; <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_close</span>(&amp;<span class="ruby-identifier">block</span>) }&#x000A; <span class="ruby-keyword">self</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <div class='method public-instance' id='method-M000020'>
- <a name='M000020'> </a>
+ <div class='method public-instance' id='method-method-i-on_data'>
+ <a name='method-i-on_data'></a>
<div class='synopsis'>
<span class='name'>on_data</span>
- <span class='arguments'>(&amp;block)</span>
+ <span class='arguments'>(&block)</span>
</div>
<div class='description'>
- <p>
- Registers a callback on all component channels, to be invoked when the
- remote process emits data (usually on its <tt>stdout</tt> stream). The
+
+ <p>Registers a callback on all component channels, to be invoked when the
+ remote process emits data (usually on its <code>stdout</code> stream). The
block will be invoked with two arguments: the specific channel object, and
- the data that was received.
- </p>
- <pre>channel.on_data do |ch, data|&#x000A; puts &quot;got data: #{data}&quot;&#x000A;end</pre>
+ the data that was received.</p>
+
+ <pre class="ruby"><span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_data</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ch</span>, <span class="ruby-identifier">data</span><span class="ruby-operator">|</span>&#x000A; <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;got data: #{data}&quot;</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000020-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-on_data-source'); return false">
[show source]
</a>
- <pre id='M000020-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 147</span>&#x000A;147: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">on_data</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;148: <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_data</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) }&#x000A;149: <span class="ruby-keyword kw">self</span>&#x000A;150: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-on_data-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 147</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">on_data</span>(&amp;<span class="ruby-identifier">block</span>)&#x000A; <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_data</span>(&amp;<span class="ruby-identifier">block</span>) }&#x000A; <span class="ruby-keyword">self</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <div class='method public-instance' id='method-M000024'>
- <a name='M000024'> </a>
+ <div class='method public-instance' id='method-method-i-on_eof'>
+ <a name='method-i-on_eof'></a>
<div class='synopsis'>
<span class='name'>on_eof</span>
- <span class='arguments'>(&amp;block)</span>
+ <span class='arguments'>(&block)</span>
</div>
<div class='description'>
- <p>
- Registers a callback on all component channels, to be invoked when the
+
+ <p>Registers a callback on all component channels, to be invoked when the
remote server has no further data to send. The callback will be invoked
- with one argument: the specific channel object being marked EOF.
- </p>
- <pre>channel.on_eof do |ch|&#x000A; # ...&#x000A;end</pre>
+ with one argument: the specific channel object being marked EOF.</p>
+
+ <pre class="ruby"><span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_eof</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ch</span><span class="ruby-operator">|</span>&#x000A; <span class="ruby-comment"># ...</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000024-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-on_eof-source'); return false">
[show source]
</a>
- <pre id='M000024-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 197</span>&#x000A;197: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">on_eof</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;198: <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_eof</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) }&#x000A;199: <span class="ruby-keyword kw">self</span>&#x000A;200: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-on_eof-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 197</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">on_eof</span>(&amp;<span class="ruby-identifier">block</span>)&#x000A; <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_eof</span>(&amp;<span class="ruby-identifier">block</span>) }&#x000A; <span class="ruby-keyword">self</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <div class='method public-instance' id='method-M000021'>
- <a name='M000021'> </a>
+ <div class='method public-instance' id='method-method-i-on_extended_data'>
+ <a name='method-i-on_extended_data'></a>
<div class='synopsis'>
<span class='name'>on_extended_data</span>
- <span class='arguments'>(&amp;block)</span>
+ <span class='arguments'>(&block)</span>
</div>
<div class='description'>
- <p>
- Registers a callback on all component channels, to be invoked when the
- remote process emits &#8220;extended&#8221; data (typically on its
- <tt>stderr</tt> stream). The block will be invoked with three arguments:
- the specific channel object, an integer describing the data type (usually a
- 1 for <tt>stderr</tt>) and the data that was received.
- </p>
- <pre>channel.on_extended_data do |ch, type, data|&#x000A; puts &quot;got extended data: #{data}&quot;&#x000A;end</pre>
+
+ <p>Registers a callback on all component channels, to be invoked when the
+ remote process emits "extended" data (typically on its <code>stderr</code>
+ stream). The block will be invoked with three arguments: the specific
+ channel object, an integer describing the data type (usually a 1 for
+ <code>stderr</code>) and the data that was received.</p>
+
+ <pre class="ruby"><span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_extended_data</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ch</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">data</span><span class="ruby-operator">|</span>&#x000A; <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;got extended data: #{data}&quot;</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000021-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-on_extended_data-source'); return false">
[show source]
</a>
- <pre id='M000021-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 161</span>&#x000A;161: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">on_extended_data</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;162: <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_extended_data</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) }&#x000A;163: <span class="ruby-keyword kw">self</span>&#x000A;164: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-on_extended_data-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 161</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">on_extended_data</span>(&amp;<span class="ruby-identifier">block</span>)&#x000A; <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_extended_data</span>(&amp;<span class="ruby-identifier">block</span>) }&#x000A; <span class="ruby-keyword">self</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <div class='method public-instance' id='method-M000025'>
- <a name='M000025'> </a>
+ <div class='method public-instance' id='method-method-i-on_open_failed'>
+ <a name='method-i-on_open_failed'></a>
<div class='synopsis'>
<span class='name'>on_open_failed</span>
- <span class='arguments'>(&amp;block)</span>
+ <span class='arguments'>(&block)</span>
</div>
<div class='description'>
- <p>
- Registers a callback on all component channels, to be invoked when the
+
+ <p>Registers a callback on all component channels, to be invoked when the
remote server is unable to open the channel. The callback will be invoked
- with three arguments: the channel object that couldn&#8217;t be opened, a
+ with three arguments: the channel object that couldn't be opened, a
description of the error (as a string), and an integer code representing
- the error.
- </p>
- <pre>channel.on_open_failed do |ch, description, code|&#x000A; # ...&#x000A;end</pre>
+ the error.</p>
+
+ <pre class="ruby"><span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_open_failed</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ch</span>, <span class="ruby-identifier">description</span>, <span class="ruby-identifier">code</span><span class="ruby-operator">|</span>&#x000A; <span class="ruby-comment"># ...</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000025-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-on_open_failed-source'); return false">
[show source]
</a>
- <pre id='M000025-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 211</span>&#x000A;211: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">on_open_failed</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;212: <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_open_failed</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) }&#x000A;213: <span class="ruby-keyword kw">self</span>&#x000A;214: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-on_open_failed-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 211</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">on_open_failed</span>(&amp;<span class="ruby-identifier">block</span>)&#x000A; <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_open_failed</span>(&amp;<span class="ruby-identifier">block</span>) }&#x000A; <span class="ruby-keyword">self</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <div class='method public-instance' id='method-M000022'>
- <a name='M000022'> </a>
+ <div class='method public-instance' id='method-method-i-on_process'>
+ <a name='method-i-on_process'></a>
<div class='synopsis'>
<span class='name'>on_process</span>
- <span class='arguments'>(&amp;block)</span>
+ <span class='arguments'>(&block)</span>
</div>
<div class='description'>
- <p>
- Registers a callback on all component channels, to be invoked during the
+
+ <p>Registers a callback on all component channels, to be invoked during the
idle portion of the connection event loop. The callback will be invoked
- with one argument: the specific channel object being processed.
- </p>
- <pre>channel.on_process do |ch|&#x000A; # ...&#x000A;end</pre>
+ with one argument: the specific channel object being processed.</p>
+
+ <pre class="ruby"><span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_process</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ch</span><span class="ruby-operator">|</span>&#x000A; <span class="ruby-comment"># ...</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000022-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-on_process-source'); return false">
[show source]
</a>
- <pre id='M000022-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 173</span>&#x000A;173: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">on_process</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;174: <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_process</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) }&#x000A;175: <span class="ruby-keyword kw">self</span>&#x000A;176: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-on_process-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 173</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">on_process</span>(&amp;<span class="ruby-identifier">block</span>)&#x000A; <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_process</span>(&amp;<span class="ruby-identifier">block</span>) }&#x000A; <span class="ruby-keyword">self</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <div class='method public-instance' id='method-M000026'>
- <a name='M000026'> </a>
+ <div class='method public-instance' id='method-method-i-on_request'>
+ <a name='method-i-on_request'></a>
<div class='synopsis'>
<span class='name'>on_request</span>
- <span class='arguments'>(type, &amp;block)</span>
+ <span class='arguments'>(type, &block)</span>
</div>
<div class='description'>
- <p>
- Registers a callback on all component channels, to be invoked when the
- remote server sends a channel request of the given <tt>type</tt>. The
+
+ <p>Registers a callback on all component channels, to be invoked when the
+ remote server sends a channel request of the given <code>type</code>. The
callback will be invoked with two arguments: the specific channel object
receiving the request, and a Net::SSH::Buffer instance containing the
- request-specific data.
- </p>
- <pre>channel.on_request(&quot;exit-status&quot;) do |ch, data|&#x000A; puts &quot;exited with #{data.read_long}&quot;&#x000A;end</pre>
+ request-specific data.</p>
+
+ <pre class="ruby"><span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_request</span>(<span class="ruby-string">&quot;exit-status&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ch</span>, <span class="ruby-identifier">data</span><span class="ruby-operator">|</span>&#x000A; <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;exited with #{data.read_long}&quot;</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000026-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-on_request-source'); return false">
[show source]
</a>
- <pre id='M000026-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 225</span>&#x000A;225: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">on_request</span>(<span class="ruby-identifier">type</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;226: <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_request</span>(<span class="ruby-identifier">type</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) }&#x000A;227: <span class="ruby-keyword kw">self</span>&#x000A;228: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-on_request-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 225</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">on_request</span>(<span class="ruby-identifier">type</span>, &amp;<span class="ruby-identifier">block</span>)&#x000A; <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">on_request</span>(<span class="ruby-identifier">type</span>, &amp;<span class="ruby-identifier">block</span>) }&#x000A; <span class="ruby-keyword">self</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <div class='method public-instance' id='method-M000014'>
- <a name='M000014'> </a>
+ <div class='method public-instance' id='method-method-i-request_pty'>
+ <a name='method-i-request_pty'></a>
<div class='synopsis'>
<span class='name'>request_pty</span>
- <span class='arguments'>(opts={}, &amp;block)</span>
+ <span class='arguments'>(opts={}, &block)</span>
</div>
<div class='description'>
- <p>
- Perform a <tt><a href="Channel.html#M000014">request_pty</a></tt> command
- on all component channels. The block, if given, is passed to each component
- channel, so it will (potentially) be invoked once for every channel in the
- collection. The block will receive two parameters: the specific channel
- object being operated on, and a boolean indicating whether the pty request
- succeeded or not.
- </p>
- <pre>channel.request_pty do |ch, success|&#x000A; # ...&#x000A;end</pre>
- <p>
- See the documentation in <a href="../../SSH.html">Net::SSH</a> for
+
+ <p>Perform a <code>request_pty</code> command on all component channels. The
+ block, if given, is passed to each component channel, so it will
+ (potentially) be invoked once for every channel in the collection. The
+ block will receive two parameters: the specific channel object being
+ operated on, and a boolean indicating whether the pty request succeeded or
+ not.</p>
+
+ <pre class="ruby"><span class="ruby-identifier">channel</span>.<span class="ruby-identifier">request_pty</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ch</span>, <span class="ruby-identifier">success</span><span class="ruby-operator">|</span>&#x000A; <span class="ruby-comment"># ...</span>&#x000A;<span class="ruby-keyword">end</span></pre>
+
+ <p>See the documentation in <a href="../../SSH.html">Net::SSH</a> for
Net::SSH::Connection::Channel#request_pty for more information on how to
- work with the callback.
- </p>
+ work with the callback.</p>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000014-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-request_pty-source'); return false">
[show source]
</a>
- <pre id='M000014-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 95</span>&#x000A;95: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">request_pty</span>(<span class="ruby-identifier">opts</span>={}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;96: <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">request_pty</span>(<span class="ruby-identifier">opts</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) }&#x000A;97: <span class="ruby-keyword kw">self</span>&#x000A;98: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-request_pty-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 95</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">request_pty</span>(<span class="ruby-identifier">opts</span>={}, &amp;<span class="ruby-identifier">block</span>)&#x000A; <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">request_pty</span>(<span class="ruby-identifier">opts</span>, &amp;<span class="ruby-identifier">block</span>) }&#x000A; <span class="ruby-keyword">self</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <div class='method public-instance' id='method-M000015'>
- <a name='M000015'> </a>
+ <div class='method public-instance' id='method-method-i-send_data'>
+ <a name='method-i-send_data'></a>
<div class='synopsis'>
<span class='name'>send_data</span>
<span class='arguments'>(data)</span>
</div>
<div class='description'>
- <p>
- Send the given <tt>data</tt> to each component channel. It will be sent to
- the remote process, typically being received on the process&#8217;
- <tt>stdin</tt> stream.
- </p>
+
+ <p>Send the given <code>data</code> to each component channel. It will be sent
+ to the remote process, typically being received on the process'
+ <code>stdin</code> stream.</p>
+
<pre>channel.send_data &quot;password\n&quot;</pre>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000015-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-send_data-source'); return false">
[show source]
</a>
- <pre id='M000015-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 104</span>&#x000A;104: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_data</span>(<span class="ruby-identifier">data</span>)&#x000A;105: <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">send_data</span>(<span class="ruby-identifier">data</span>) }&#x000A;106: <span class="ruby-keyword kw">self</span>&#x000A;107: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-send_data-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 104</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">send_data</span>(<span class="ruby-identifier">data</span>)&#x000A; <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">channel</span><span class="ruby-operator">|</span> <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">send_data</span>(<span class="ruby-identifier">data</span>) }&#x000A; <span class="ruby-keyword">self</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
- <div class='method public-instance' id='method-M000017'>
- <a name='M000017'> </a>
+ <div class='method public-instance' id='method-method-i-wait'>
+ <a name='method-i-wait'></a>
<div class='synopsis'>
<span class='name'>wait</span>
<span class='arguments'>()</span>
</div>
<div class='description'>
- <p>
- Runs the connection&#8217;s event loop until the channel is no longer
- active (see <a href="Channel.html#M000016">active?</a>).
- </p>
+
+ <p>Runs the connection's event loop until the channel is no longer active (see
+ <a href="Channel.html#method-i-active-3F">active?</a>).</p>
+
<pre>channel.exec &quot;something&quot;&#x000A;channel.wait</pre>
</div>
<div class='source'>
- <a class='source-toggle' href='#' onclick="toggleCode('M000017-source'); return false">
+ <a class='source-toggle' href='#' onclick="toggleCode('method-i-wait-source'); return false">
[show source]
</a>
- <pre id='M000017-source'> <span class="ruby-comment cmt"># File lib/net/ssh/multi/channel.rb, line 121</span>&#x000A;121: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">wait</span>&#x000A;122: <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">loop</span> { <span class="ruby-identifier">active?</span> }&#x000A;123: <span class="ruby-keyword kw">self</span>&#x000A;124: <span class="ruby-keyword kw">end</span></pre>
+ <pre id='method-i-wait-source'><span class="ruby-comment"># File lib/net/ssh/multi/channel.rb, line 121</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">wait</span>&#x000A; <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">loop</span> { <span class="ruby-identifier">active?</span> }&#x000A; <span class="ruby-keyword">self</span>&#x000A;<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
@@ -531,7 +539,7 @@
<div id='footer-push'></div>
</div>
<div id='footer'>
- <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
+ <a target="docwin" href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
</div>
</body>
</html>