net-ssh 0.6.0 → 0.9.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.
- data/doc/manual-html/chapter-1.html +59 -24
- data/doc/manual-html/chapter-2.html +116 -77
- data/doc/manual-html/chapter-3.html +80 -41
- data/doc/manual-html/chapter-4.html +111 -71
- data/doc/manual-html/chapter-5.html +267 -155
- data/doc/manual-html/chapter-6.html +211 -75
- data/doc/manual-html/chapter-7.html +331 -0
- data/doc/manual-html/index.html +39 -13
- data/doc/manual-html/{manual.css → stylesheets/manual.css} +81 -8
- data/doc/manual-html/stylesheets/ruby.css +17 -0
- data/doc/manual/chapter.erb +20 -0
- data/doc/manual/manual.rb +80 -9
- data/doc/manual/manual.yml +12 -2
- data/doc/manual/page.erb +1 -1
- data/doc/manual/parts/channels_callbacks.txt +11 -11
- data/doc/manual/parts/channels_loop.txt +6 -6
- data/doc/manual/parts/channels_open.txt +9 -9
- data/doc/manual/parts/exec_channels.txt +15 -15
- data/doc/manual/parts/exec_open.txt +17 -18
- data/doc/manual/parts/exec_popen3.txt +18 -18
- data/doc/manual/parts/forward_direct.txt +16 -16
- data/doc/manual/parts/forward_intro.txt +7 -7
- data/doc/manual/parts/forward_local.txt +9 -9
- data/doc/manual/parts/forward_remote.txt +9 -9
- data/doc/manual/parts/intro_getting.txt +11 -11
- data/doc/manual/parts/proxy_http.txt +27 -27
- data/doc/manual/parts/proxy_socks.txt +17 -17
- data/doc/manual/parts/session_key.txt +13 -14
- data/doc/manual/parts/session_options.txt +14 -14
- data/doc/manual/parts/session_session.txt +9 -9
- data/doc/manual/parts/session_start.txt +27 -27
- data/doc/manual/parts/shells_channels.txt +72 -0
- data/doc/manual/parts/shells_clients.txt +51 -0
- data/doc/manual/parts/shells_intro.txt +7 -0
- data/doc/manual/parts/shells_shell.txt +50 -0
- data/doc/manual/parts/shells_sync.txt +42 -0
- data/doc/manual/{manual.css → stylesheets/manual.css} +81 -8
- data/doc/manual/stylesheets/ruby.css +17 -0
- data/examples/channel-demo.rb +1 -1
- data/examples/port-forward.rb +1 -1
- data/examples/process-demo.rb +1 -1
- data/examples/remote-net-port-forward.rb +1 -1
- data/examples/remote-port-forward.rb +1 -1
- data/examples/shell-demo.rb +46 -0
- data/examples/ssh-client.rb +67 -0
- data/examples/sync-shell-demo.rb +69 -0
- data/examples/tail-demo.rb +1 -1
- data/lib/net/ssh.rb +1 -1
- data/lib/net/ssh/connection/channel.rb +61 -7
- data/lib/net/ssh/connection/constants.rb +1 -1
- data/lib/net/ssh/connection/driver.rb +61 -8
- data/lib/net/ssh/connection/services.rb +1 -1
- data/lib/net/ssh/connection/term.rb +1 -1
- data/lib/net/ssh/errors.rb +1 -1
- data/lib/net/ssh/proxy/errors.rb +1 -1
- data/lib/net/ssh/proxy/http.rb +1 -1
- data/lib/net/ssh/proxy/socks4.rb +1 -1
- data/lib/net/ssh/proxy/socks5.rb +1 -1
- data/lib/net/ssh/service/forward/driver.rb +1 -1
- data/lib/net/ssh/service/forward/local-network-handler.rb +1 -1
- data/lib/net/ssh/service/forward/remote-network-handler.rb +1 -1
- data/lib/net/ssh/service/forward/services.rb +1 -1
- data/lib/net/ssh/service/process/driver.rb +1 -1
- data/lib/net/ssh/service/process/open.rb +1 -1
- data/lib/net/ssh/service/process/popen3.rb +20 -2
- data/lib/net/ssh/service/process/services.rb +1 -1
- data/lib/net/ssh/service/services.rb +3 -1
- data/lib/net/ssh/service/shell/driver.rb +86 -0
- data/lib/net/ssh/service/shell/services.rb +54 -0
- data/lib/net/ssh/service/shell/shell.rb +213 -0
- data/lib/net/ssh/service/shell/sync.rb +114 -0
- data/lib/net/ssh/session.rb +9 -1
- data/lib/net/ssh/transport/algorithm-negotiator.rb +1 -1
- data/lib/net/ssh/transport/compress/compressor.rb +1 -1
- data/lib/net/ssh/transport/compress/decompressor.rb +1 -1
- data/lib/net/ssh/transport/compress/none-compressor.rb +1 -1
- data/lib/net/ssh/transport/compress/none-decompressor.rb +1 -1
- data/lib/net/ssh/transport/compress/services.rb +1 -1
- data/lib/net/ssh/transport/compress/zlib-compressor.rb +1 -1
- data/lib/net/ssh/transport/compress/zlib-decompressor.rb +1 -1
- data/lib/net/ssh/transport/constants.rb +1 -1
- data/lib/net/ssh/transport/errors.rb +1 -1
- data/lib/net/ssh/transport/identity-cipher.rb +1 -1
- data/lib/net/ssh/transport/kex/dh-gex.rb +1 -1
- data/lib/net/ssh/transport/kex/dh.rb +1 -1
- data/lib/net/ssh/transport/kex/services.rb +1 -1
- data/lib/net/ssh/transport/ossl/buffer-factory.rb +1 -1
- data/lib/net/ssh/transport/ossl/buffer.rb +1 -1
- data/lib/net/ssh/transport/ossl/cipher-factory.rb +1 -1
- data/lib/net/ssh/transport/ossl/digest-factory.rb +1 -1
- data/lib/net/ssh/transport/ossl/hmac-factory.rb +1 -1
- data/lib/net/ssh/transport/ossl/hmac/hmac.rb +1 -1
- data/lib/net/ssh/transport/ossl/hmac/md5-96.rb +1 -1
- data/lib/net/ssh/transport/ossl/hmac/md5.rb +1 -1
- data/lib/net/ssh/transport/ossl/hmac/none.rb +1 -1
- data/lib/net/ssh/transport/ossl/hmac/services.rb +1 -1
- data/lib/net/ssh/transport/ossl/hmac/sha1-96.rb +1 -1
- data/lib/net/ssh/transport/ossl/hmac/sha1.rb +1 -1
- data/lib/net/ssh/transport/ossl/key-factory.rb +5 -2
- data/lib/net/ssh/transport/ossl/services.rb +1 -1
- data/lib/net/ssh/transport/packet-stream.rb +1 -1
- data/lib/net/ssh/transport/services.rb +1 -1
- data/lib/net/ssh/transport/session.rb +10 -1
- data/lib/net/ssh/transport/version-negotiator.rb +1 -1
- data/lib/net/ssh/userauth/agent.rb +1 -1
- data/lib/net/ssh/userauth/constants.rb +1 -1
- data/lib/net/ssh/userauth/driver.rb +1 -1
- data/lib/net/ssh/userauth/methods/hostbased.rb +1 -1
- data/lib/net/ssh/userauth/methods/keyboard-interactive.rb +104 -0
- data/lib/net/ssh/userauth/methods/password.rb +1 -1
- data/lib/net/ssh/userauth/methods/publickey.rb +1 -1
- data/lib/net/ssh/userauth/methods/services.rb +28 -6
- data/lib/net/ssh/userauth/services.rb +8 -5
- data/lib/net/ssh/userauth/userkeys.rb +1 -1
- data/lib/net/ssh/util/buffer.rb +1 -1
- data/lib/net/ssh/util/openssl.rb +1 -1
- data/lib/net/ssh/util/prompter.rb +1 -1
- data/lib/net/ssh/version.rb +2 -2
- data/test/ALL-TESTS.rb +1 -1
- data/test/connection/tc_channel.rb +1 -1
- data/test/connection/tc_driver.rb +1 -1
- data/test/connection/tc_integration.rb +1 -1
- data/test/proxy/tc_http.rb +1 -1
- data/test/proxy/tc_socks4.rb +1 -1
- data/test/proxy/tc_socks5.rb +1 -1
- data/test/service/forward/tc_driver.rb +1 -1
- data/test/service/forward/tc_local_network_handler.rb +1 -1
- data/test/service/forward/tc_remote_network_handler.rb +1 -1
- data/test/service/process/tc_driver.rb +1 -1
- data/test/service/process/tc_integration.rb +1 -1
- data/test/service/process/tc_open.rb +1 -1
- data/test/service/process/tc_popen3.rb +13 -13
- data/test/tc_integration.rb +1 -1
- data/test/transport/compress/tc_none_compress.rb +1 -1
- data/test/transport/compress/tc_none_decompress.rb +1 -1
- data/test/transport/compress/tc_zlib_compress.rb +1 -1
- data/test/transport/compress/tc_zlib_decompress.rb +1 -1
- data/test/transport/kex/tc_dh.rb +2 -1
- data/test/transport/kex/tc_dh_gex.rb +1 -1
- data/test/transport/ossl/hmac/tc_hmac.rb +1 -1
- data/test/transport/ossl/hmac/tc_md5.rb +1 -1
- data/test/transport/ossl/hmac/tc_md5_96.rb +1 -1
- data/test/transport/ossl/hmac/tc_none.rb +1 -1
- data/test/transport/ossl/hmac/tc_sha1.rb +1 -1
- data/test/transport/ossl/hmac/tc_sha1_96.rb +1 -1
- data/test/transport/ossl/tc_buffer.rb +1 -1
- data/test/transport/ossl/tc_buffer_factory.rb +1 -1
- data/test/transport/ossl/tc_cipher_factory.rb +1 -1
- data/test/transport/ossl/tc_digest_factory.rb +1 -1
- data/test/transport/ossl/tc_hmac_factory.rb +1 -1
- data/test/transport/ossl/tc_key_factory.rb +1 -1
- data/test/transport/tc_algorithm_negotiator.rb +1 -1
- data/test/transport/tc_identity_cipher.rb +1 -1
- data/test/transport/tc_integration.rb +1 -1
- data/test/transport/tc_packet_stream.rb +1 -1
- data/test/transport/tc_session.rb +1 -1
- data/test/transport/tc_version_negotiator.rb +1 -1
- data/test/userauth/methods/tc_hostbased.rb +1 -1
- data/test/userauth/methods/tc_password.rb +1 -1
- data/test/userauth/methods/tc_publickey.rb +1 -1
- data/test/userauth/tc_agent.rb +1 -1
- data/test/userauth/tc_driver.rb +1 -1
- data/test/userauth/tc_integration.rb +15 -1
- data/test/userauth/tc_userkeys.rb +1 -1
- data/test/util/tc_buffer.rb +5 -5
- metadata +26 -6
data/doc/manual-html/index.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<html>
|
|
2
2
|
<head>
|
|
3
3
|
<title>Net::SSH Manual</title>
|
|
4
|
-
<link type="text/css" rel="stylesheet" href="manual.css" />
|
|
4
|
+
<link type="text/css" rel="stylesheet" href="stylesheets/manual.css" />
|
|
5
5
|
</head>
|
|
6
6
|
|
|
7
7
|
<body>
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
</div>
|
|
15
15
|
</td><td valign='middle' align='right'>
|
|
16
16
|
<div class="info">
|
|
17
|
-
Net::SSH Version: <strong>0.
|
|
18
|
-
Manual Last Updated: <strong>
|
|
17
|
+
Net::SSH Version: <strong>0.9.0</strong><br />
|
|
18
|
+
Manual Last Updated: <strong>2005-01-11 21:39 GMT</strong>
|
|
19
19
|
</div>
|
|
20
20
|
</td></tr>
|
|
21
21
|
</table>
|
|
@@ -110,36 +110,56 @@
|
|
|
110
110
|
|
|
111
111
|
<li>
|
|
112
112
|
<a href="chapter-5.html">
|
|
113
|
-
|
|
113
|
+
User Shells
|
|
114
114
|
</a>
|
|
115
115
|
|
|
116
116
|
<ol type="1">
|
|
117
117
|
|
|
118
118
|
<li><a href="chapter-5.html#s1">Introduction</a></li>
|
|
119
119
|
|
|
120
|
-
<li><a href="chapter-5.html#s2">
|
|
120
|
+
<li><a href="chapter-5.html#s2">Using Channels</a></li>
|
|
121
121
|
|
|
122
|
-
<li><a href="chapter-5.html#s3">
|
|
122
|
+
<li><a href="chapter-5.html#s3">Shell Service</a></li>
|
|
123
123
|
|
|
124
|
-
<li><a href="chapter-5.html#s4">
|
|
124
|
+
<li><a href="chapter-5.html#s4">SyncShell Service</a></li>
|
|
125
125
|
|
|
126
|
-
<li><a href="chapter-5.html#s5">
|
|
126
|
+
<li><a href="chapter-5.html#s5">Terminal Clients</a></li>
|
|
127
127
|
|
|
128
128
|
</ol>
|
|
129
129
|
</li>
|
|
130
130
|
|
|
131
131
|
<li>
|
|
132
132
|
<a href="chapter-6.html">
|
|
133
|
-
|
|
133
|
+
Port Forwarding
|
|
134
134
|
</a>
|
|
135
135
|
|
|
136
136
|
<ol type="1">
|
|
137
137
|
|
|
138
138
|
<li><a href="chapter-6.html#s1">Introduction</a></li>
|
|
139
139
|
|
|
140
|
-
<li><a href="chapter-6.html#s2"
|
|
140
|
+
<li><a href="chapter-6.html#s2">Local-to-Remote</a></li>
|
|
141
|
+
|
|
142
|
+
<li><a href="chapter-6.html#s3">Remote-to-Local</a></li>
|
|
143
|
+
|
|
144
|
+
<li><a href="chapter-6.html#s4">Direct Channels</a></li>
|
|
145
|
+
|
|
146
|
+
<li><a href="chapter-6.html#s5">Remote-to-Local Handlers</a></li>
|
|
147
|
+
|
|
148
|
+
</ol>
|
|
149
|
+
</li>
|
|
150
|
+
|
|
151
|
+
<li>
|
|
152
|
+
<a href="chapter-7.html">
|
|
153
|
+
Using Proxies
|
|
154
|
+
</a>
|
|
155
|
+
|
|
156
|
+
<ol type="1">
|
|
157
|
+
|
|
158
|
+
<li><a href="chapter-7.html#s1">Introduction</a></li>
|
|
159
|
+
|
|
160
|
+
<li><a href="chapter-7.html#s2"><span class="caps">HTTP</span></a></li>
|
|
141
161
|
|
|
142
|
-
<li><a href="chapter-
|
|
162
|
+
<li><a href="chapter-7.html#s3"><span class="caps">SOCKS</span></a></li>
|
|
143
163
|
|
|
144
164
|
</ol>
|
|
145
165
|
</li>
|
|
@@ -196,14 +216,20 @@
|
|
|
196
216
|
<table border='0' cellpadding='0' cellspacing='0' align='center'><tr><td>
|
|
197
217
|
<ul>
|
|
198
218
|
|
|
199
|
-
<li>
|
|
219
|
+
<li>Next/Previous links on each chapter for easier navigation</li>
|
|
220
|
+
|
|
221
|
+
<li>Shell service</li>
|
|
222
|
+
|
|
223
|
+
<li>Enhancements to the channel and connection interfaces</li>
|
|
224
|
+
|
|
225
|
+
<li>Keyboard-interactive authentication method</li>
|
|
200
226
|
|
|
201
227
|
</ul>
|
|
202
228
|
</table>
|
|
203
229
|
|
|
204
230
|
|
|
205
231
|
<p class="copyright">
|
|
206
|
-
Copyright ©
|
|
232
|
+
Copyright © 20042005
|
|
207
233
|
Jamis Buck
|
|
208
234
|
(<a href="mailto:jgb3@email.byu.edu">jgb3@email.byu.edu</a>)
|
|
209
235
|
</p>
|
|
@@ -107,12 +107,6 @@ a:hover {
|
|
|
107
107
|
text-align: justify;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
#content pre {
|
|
111
|
-
background: #FFE;
|
|
112
|
-
border: 1px dotted #AAA;
|
|
113
|
-
padding: 1em;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
110
|
#content h1 {
|
|
117
111
|
background: #005;
|
|
118
112
|
color: #FFF;
|
|
@@ -186,7 +180,86 @@ a:hover {
|
|
|
186
180
|
text-align: center;
|
|
187
181
|
}
|
|
188
182
|
|
|
189
|
-
table.list
|
|
190
|
-
|
|
183
|
+
table.list {
|
|
184
|
+
margin: 2em;
|
|
185
|
+
border: 1px solid black;
|
|
186
|
+
background: #FFD;
|
|
187
|
+
padding: 0px;
|
|
188
|
+
border-spacing: 0px;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
table.list th {
|
|
192
|
+
border-bottom: 1px solid #005;
|
|
191
193
|
padding-bottom: 5px;
|
|
194
|
+
background: #008;
|
|
195
|
+
color: white;
|
|
196
|
+
padding: 0.5em;
|
|
197
|
+
text-align: left;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
table.list td {
|
|
201
|
+
padding: 0.2em;
|
|
202
|
+
text-align: left;
|
|
203
|
+
vertical-align: top;
|
|
204
|
+
border-bottom: 1px solid;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.prevnext {
|
|
208
|
+
padding: 0.5em 1em 0.5em 1em;
|
|
209
|
+
background: #557;
|
|
210
|
+
color: #FFF;
|
|
211
|
+
font-size: small;
|
|
212
|
+
font-weight: bold;
|
|
213
|
+
border: 1px solid #000;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.prevnext a {
|
|
217
|
+
color: #FF0;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.top .prevnext {
|
|
221
|
+
margin: 0 0 1em 0;
|
|
222
|
+
text-align: left;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.bottom .prevnext {
|
|
226
|
+
margin: 1em 0 0 0;
|
|
227
|
+
text-align: right;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.figure {
|
|
231
|
+
border: 1px solid black;
|
|
232
|
+
line-height: normal;
|
|
233
|
+
background: #FFD;
|
|
234
|
+
margin: 2em;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.figure .caption {
|
|
238
|
+
background: #008;
|
|
239
|
+
color: white;
|
|
240
|
+
font-weight: bold;
|
|
241
|
+
font-size: small;
|
|
242
|
+
padding: 4px 24px 4px 8px;
|
|
243
|
+
margin-left: -4px;
|
|
244
|
+
border: 1px dotted #77F;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.figure .body {
|
|
248
|
+
padding-left: 1em;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.figure pre {
|
|
252
|
+
padding: 0px;
|
|
253
|
+
background: transparent;
|
|
254
|
+
border: none;
|
|
255
|
+
font-size: small;
|
|
256
|
+
font-family: mono;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.figure .lineno {
|
|
260
|
+
text-align: right;
|
|
261
|
+
color: #B00;
|
|
262
|
+
font-family: mono;
|
|
263
|
+
font-size: small;
|
|
264
|
+
padding-right: 1em;
|
|
192
265
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.ruby .normal {}
|
|
2
|
+
.ruby .comment { color: #005; font-style: italic; }
|
|
3
|
+
.ruby .keyword { color: #A00; font-weight: bold; }
|
|
4
|
+
.ruby .method { color: #077; }
|
|
5
|
+
.ruby .class { color: #074; }
|
|
6
|
+
.ruby .module { color: #050; }
|
|
7
|
+
.ruby .punct { color: #447; font-weight: bold; }
|
|
8
|
+
.ruby .symbol { color: #099; }
|
|
9
|
+
.ruby .string { color: #944; }
|
|
10
|
+
.ruby .char { color: #F07; }
|
|
11
|
+
.ruby .ident { color: #004; }
|
|
12
|
+
.ruby .constant { color: #07F; }
|
|
13
|
+
.ruby .regex { color: #B66; }
|
|
14
|
+
.ruby .number { color: #D55; }
|
|
15
|
+
.ruby .attribute { color: #377; }
|
|
16
|
+
.ruby .global { color: #3B7; }
|
|
17
|
+
.ruby .expr { color: #227; }
|
data/doc/manual/chapter.erb
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
<div class="top"><div class="prevnext">
|
|
2
|
+
<% if previous_chapter %>
|
|
3
|
+
<a href="chapter-<%= previous_chapter.index %>.html">Previous (<%= previous_chapter.index %>. <%= previous_chapter.title %>)</a> |
|
|
4
|
+
<% end %>
|
|
5
|
+
<a href="index.html">Up</a>
|
|
6
|
+
<% if next_chapter %>
|
|
7
|
+
| <a href="chapter-<%= next_chapter.index %>.html">Next (<%= next_chapter.index %>. <%= next_chapter.title %>)</a>
|
|
8
|
+
<% end %>
|
|
9
|
+
</div></div>
|
|
10
|
+
|
|
1
11
|
<h1><%= object.index %>. <%= object.title %></h1>
|
|
2
12
|
|
|
3
13
|
<% object.sections.each do |section|
|
|
@@ -16,3 +26,13 @@
|
|
|
16
26
|
</div>
|
|
17
27
|
|
|
18
28
|
<% end %>
|
|
29
|
+
|
|
30
|
+
<div class="bottom"><div class="prevnext">
|
|
31
|
+
<% if previous_chapter %>
|
|
32
|
+
<a href="chapter-<%= previous_chapter.index %>.html">Previous (<%= previous_chapter.index %>. <%= previous_chapter.title %>)</a> |
|
|
33
|
+
<% end %>
|
|
34
|
+
<a href="index.html">Up</a>
|
|
35
|
+
<% if next_chapter %>
|
|
36
|
+
| <a href="chapter-<%= next_chapter.index %>.html">Next (<%= next_chapter.index %>. <%= next_chapter.title %>)</a>
|
|
37
|
+
<% end %>
|
|
38
|
+
</div></div>
|
data/doc/manual/manual.rb
CHANGED
|
@@ -11,6 +11,7 @@ require 'erb'
|
|
|
11
11
|
require 'fileutils'
|
|
12
12
|
require 'yaml'
|
|
13
13
|
require 'redcloth'
|
|
14
|
+
require 'syntax/convertors/html'
|
|
14
15
|
|
|
15
16
|
module Needle
|
|
16
17
|
module Manual
|
|
@@ -100,10 +101,79 @@ module Needle
|
|
|
100
101
|
def initialize( index, title, content )
|
|
101
102
|
@index = index
|
|
102
103
|
@title = RedCloth.new( title ).to_html.gsub( %r{</?p>}, "" ) if title
|
|
103
|
-
@content =
|
|
104
|
+
@content = FigureContainer.new( content || "" )
|
|
104
105
|
end
|
|
105
106
|
end
|
|
106
107
|
|
|
108
|
+
class FigureContainer
|
|
109
|
+
def initialize( content )
|
|
110
|
+
@content = content
|
|
111
|
+
@html = nil
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
def to_html
|
|
115
|
+
return @html if @html
|
|
116
|
+
extract_figures
|
|
117
|
+
convert_to_html
|
|
118
|
+
replace_figures
|
|
119
|
+
@html
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
private
|
|
123
|
+
|
|
124
|
+
Figure = Struct.new( :opts, :body )
|
|
125
|
+
|
|
126
|
+
def extract_figures
|
|
127
|
+
@figures = []
|
|
128
|
+
@content.gsub!( /^\[!figure( .*?)?\n(.*?)\n!\]$/m ) do
|
|
129
|
+
body = $2.strip
|
|
130
|
+
opts = Hash[*$1.strip.split(/,/).map{|p| p.split(/=/)}.flatten]
|
|
131
|
+
@figures << Figure.new( opts, body )
|
|
132
|
+
"====#{@figures.length-1}===="
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def convert_to_html
|
|
137
|
+
@html = ( @content.length < 1 ? "" :
|
|
138
|
+
RedCloth.new( @content ).to_html )
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
def replace_figures
|
|
142
|
+
@html.gsub!( /<p>====(.*?)====<\/p>/ ) do
|
|
143
|
+
figure = @figures[$1.to_i]
|
|
144
|
+
lang = figure.opts["lang"]
|
|
145
|
+
caption = figure.opts["caption"] || "Figure"
|
|
146
|
+
caption << " [#{lang}]" if lang
|
|
147
|
+
|
|
148
|
+
body = figure.body
|
|
149
|
+
|
|
150
|
+
if lang
|
|
151
|
+
convertor = Syntax::Convertors::HTML.for_syntax( lang )
|
|
152
|
+
|
|
153
|
+
body = "<link rel='stylesheet' type='text/css' " +
|
|
154
|
+
"href='stylesheets/#{lang}.css' />" +
|
|
155
|
+
"<div class='#{lang}'>" +
|
|
156
|
+
convertor.convert( body ) +
|
|
157
|
+
"</div>"
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if figure.opts["number"] && eval(figure.opts["number"])
|
|
161
|
+
line = 1
|
|
162
|
+
numbers = ""
|
|
163
|
+
body.each_line { numbers << "#{line}<br />"; line += 1 }
|
|
164
|
+
body = "<table border='0' cellpadding='0' cellspacing='0'>" +
|
|
165
|
+
"<tr><td class='lineno'>#{numbers}</td>" +
|
|
166
|
+
"<td width='100%'>#{body}</td></tr></table>"
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
"<div class='figure'>\n" +
|
|
170
|
+
"<span class='caption'>#{caption}</span>\n" +
|
|
171
|
+
"<div class='body'>#{body}</div>" +
|
|
172
|
+
"</div>"
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
107
177
|
YAML.add_private_type( 'file' ) { |type_id, value| File.read( value ) rescue "" }
|
|
108
178
|
YAML.add_private_type( 'eval' ) { |type_id, value| eval( value ) }
|
|
109
179
|
|
|
@@ -177,7 +247,7 @@ if __FILE__ == $0
|
|
|
177
247
|
exit
|
|
178
248
|
end
|
|
179
249
|
|
|
180
|
-
|
|
250
|
+
FileUtils.mkdir_p File.join( output_path, "stylesheets" )
|
|
181
251
|
|
|
182
252
|
log_action "Loading manual.yml..."
|
|
183
253
|
manual = Needle::Manual::Manual.load( 'manual.yml' )
|
|
@@ -200,11 +270,15 @@ if __FILE__ == $0
|
|
|
200
270
|
template = File.open( "chapter.erb" ) { |file| ERB.new( file.read ) }
|
|
201
271
|
template.filename = "chapter.erb"
|
|
202
272
|
|
|
203
|
-
manual.chapters.
|
|
273
|
+
manual.chapters.each_with_index do |object,index|
|
|
204
274
|
log_action "Processing chapter ##{object.index}..."
|
|
275
|
+
|
|
276
|
+
previous_chapter = ( index < 1 ? nil : manual.chapters[index-1] )
|
|
277
|
+
next_chapter = manual.chapters[index+1]
|
|
278
|
+
|
|
205
279
|
File.open( File.join( output_path, "chapter-#{object.index}.html" ), "w" ) do |file|
|
|
206
|
-
guts = template.result
|
|
207
|
-
file << page.result
|
|
280
|
+
guts = template.result( binding )
|
|
281
|
+
file << page.result( binding )
|
|
208
282
|
end
|
|
209
283
|
end
|
|
210
284
|
|
|
@@ -231,10 +305,7 @@ if __FILE__ == $0
|
|
|
231
305
|
# end
|
|
232
306
|
|
|
233
307
|
log_action "Copying style sheets..."
|
|
234
|
-
FileUtils.cp Dir["
|
|
235
|
-
|
|
236
|
-
log_action "Copying images..."
|
|
237
|
-
FileUtils.cp Dir["img/*.jpg"], output_path
|
|
308
|
+
FileUtils.cp Dir["stylesheets/*.css"], File.join( output_path, "stylesheets" )
|
|
238
309
|
|
|
239
310
|
log_action "Done!"
|
|
240
311
|
end
|
data/doc/manual/manual.yml
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# http://creativecommons.org/licenses/by-sa/2.0/
|
|
7
7
|
|
|
8
8
|
meta: !^meta
|
|
9
|
-
copyright: 2004
|
|
9
|
+
copyright: 2004,2005
|
|
10
10
|
author: Jamis Buck
|
|
11
11
|
email: jgb3@email.byu.edu
|
|
12
12
|
|
|
@@ -23,7 +23,10 @@ product: !^product
|
|
|
23
23
|
- Net::SSH Wiki: http://net-ssh.rubyforge.org/wiki/wiki.pl
|
|
24
24
|
|
|
25
25
|
recent_updates:
|
|
26
|
-
- "
|
|
26
|
+
- "Next/Previous links on each chapter for easier navigation"
|
|
27
|
+
- "Shell service"
|
|
28
|
+
- "Enhancements to the channel and connection interfaces"
|
|
29
|
+
- "Keyboard-interactive authentication method"
|
|
27
30
|
|
|
28
31
|
chapters:
|
|
29
32
|
|
|
@@ -54,6 +57,13 @@ chapters:
|
|
|
54
57
|
- "Using #process.open": !!file parts/exec_open.txt
|
|
55
58
|
- "Using #process.popen3": !!file parts/exec_popen3.txt
|
|
56
59
|
|
|
60
|
+
- User Shells:
|
|
61
|
+
- Introduction: !!file parts/shells_intro.txt
|
|
62
|
+
- Using Channels: !!file parts/shells_channels.txt
|
|
63
|
+
- Shell Service: !!file parts/shells_shell.txt
|
|
64
|
+
- SyncShell Service: !!file parts/shells_sync.txt
|
|
65
|
+
- Terminal Clients: !!file parts/shells_clients.txt
|
|
66
|
+
|
|
57
67
|
- Port Forwarding:
|
|
58
68
|
- Introduction: !!file parts/forward_intro.txt
|
|
59
69
|
- Local-to-Remote: !!file parts/forward_local.txt
|
data/doc/manual/page.erb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<html>
|
|
2
2
|
<head>
|
|
3
3
|
<title><%= manual.product.name %> Manual<% if object %> :: <%= object.page_title %><% end %></title>
|
|
4
|
-
<link type="text/css" rel="stylesheet" href="manual.css" />
|
|
4
|
+
<link type="text/css" rel="stylesheet" href="stylesheets/manual.css" />
|
|
5
5
|
</head>
|
|
6
6
|
|
|
7
7
|
<body>
|
|
@@ -17,16 +17,16 @@ In general, you will never need to register callbacks for @on_failure@, @on_requ
|
|
|
17
17
|
|
|
18
18
|
Following is an example of registering callbacks on a channel:
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
end
|
|
26
|
-
puts "closing channel..."
|
|
27
|
-
channel.close
|
|
20
|
+
[!figure lang=ruby,caption=Registering callbacks on a channel,number=true
|
|
21
|
+
Net::SSH.start( 'host' ) do |session|
|
|
22
|
+
session.open_channel do |channel|
|
|
23
|
+
channel.on_close do |ch|
|
|
24
|
+
puts "channel closed successfully."
|
|
28
25
|
end
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
puts "closing channel..."
|
|
27
|
+
channel.close
|
|
31
28
|
end
|
|
32
|
-
|
|
29
|
+
|
|
30
|
+
session.loop
|
|
31
|
+
end
|
|
32
|
+
!]
|