svengali 0.2.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/README +0 -0
- data/README.rdoc +17 -0
- data/Rakefile +47 -0
- data/VERSION +1 -0
- data/api_document020_en.pdf +0 -0
- data/api_document020_ja.pdf +0 -0
- data/api_document_en.pptx +0 -0
- data/api_document_ja.pptx +0 -0
- data/lib/svengali.rb +2 -0
- data/lib/svengali/config.rb +78 -0
- data/lib/svengali/ext_string.rb +55 -0
- data/lib/svengali/ext_string/command.yml +6 -0
- data/lib/svengali/ext_string/path.yml +6 -0
- data/lib/svengali/file_io.rb +106 -0
- data/lib/svengali/machine.rb +123 -0
- data/lib/svengali/platforms/debian.rb +5 -0
- data/lib/svengali/platforms/default.rb +4 -0
- data/lib/svengali/plugins/eucalyptus.rb +339 -0
- data/lib/svengali/plugins/machine_config.rb +126 -0
- data/lib/svengali/plugins/package.rb +7 -0
- data/lib/svengali/ssh.rb +106 -0
- data/lib/svengali/svengali.rb +19 -0
- data/lib/svengali/util.rb +117 -0
- data/rdoc/classes/CLibIPAddr.html +230 -0
- data/rdoc/classes/Cloud.html +506 -0
- data/rdoc/classes/Config.html +151 -0
- data/rdoc/classes/Config/ConfigFile.html +319 -0
- data/rdoc/classes/ExtStr.html +209 -0
- data/rdoc/classes/ExtStrAccessor.html +183 -0
- data/rdoc/classes/FileIO.html +415 -0
- data/rdoc/classes/Machine.html +771 -0
- data/rdoc/classes/MachineMaster.html +117 -0
- data/rdoc/classes/Platform.html +121 -0
- data/rdoc/classes/SSH.html +315 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/README.html +101 -0
- data/rdoc/files/README_rdoc.html +133 -0
- data/rdoc/files/lib/svengali/config_rb.html +114 -0
- data/rdoc/files/lib/svengali/ext_string_rb.html +108 -0
- data/rdoc/files/lib/svengali/file_io_rb.html +115 -0
- data/rdoc/files/lib/svengali/machine_rb.html +108 -0
- data/rdoc/files/lib/svengali/platforms/debian_rb.html +107 -0
- data/rdoc/files/lib/svengali/platforms/default_rb.html +107 -0
- data/rdoc/files/lib/svengali/plugins/eucalyptus_rb.html +389 -0
- data/rdoc/files/lib/svengali/plugins/machine_config_rb.html +101 -0
- data/rdoc/files/lib/svengali/plugins/package_rb.html +101 -0
- data/rdoc/files/lib/svengali/ssh_rb.html +110 -0
- data/rdoc/files/lib/svengali/svengali_rb.html +125 -0
- data/rdoc/files/lib/svengali/util_rb.html +439 -0
- data/rdoc/files/lib/svengali_rb.html +108 -0
- data/rdoc/fr_class_index.html +37 -0
- data/rdoc/fr_file_index.html +41 -0
- data/rdoc/fr_method_index.html +100 -0
- data/rdoc/index.html +26 -0
- data/rdoc/rdoc-style.css +208 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +9 -0
- data/spec/svengali_spec.rb +7 -0
- data/svengali.gemspec +113 -0
- data/svengali_sample.rb +43 -0
- data/test/scenario.sh +3 -0
- metadata +179 -0
@@ -0,0 +1,117 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: MachineMaster</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">MachineMaster</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/svengali/machine_rb.html">
|
59
|
+
lib/svengali/machine.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
module <a href="Machine.html">Machine</a>
|
84
|
+
</p>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
</div>
|
93
|
+
|
94
|
+
|
95
|
+
<!-- if includes -->
|
96
|
+
|
97
|
+
<div id="section">
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<!-- if method_list -->
|
107
|
+
|
108
|
+
|
109
|
+
</div>
|
110
|
+
|
111
|
+
|
112
|
+
<div id="validator-badges">
|
113
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
114
|
+
</div>
|
115
|
+
|
116
|
+
</body>
|
117
|
+
</html>
|
@@ -0,0 +1,121 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Platform</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Platform</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/svengali/platforms/default_rb.html">
|
59
|
+
lib/svengali/platforms/default.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
<a href="../files/lib/svengali/platforms/debian_rb.html">
|
63
|
+
lib/svengali/platforms/debian.rb
|
64
|
+
</a>
|
65
|
+
<br />
|
66
|
+
</td>
|
67
|
+
</tr>
|
68
|
+
|
69
|
+
<tr class="top-aligned-row">
|
70
|
+
<td><strong>Parent:</strong></td>
|
71
|
+
<td>
|
72
|
+
Object
|
73
|
+
</td>
|
74
|
+
</tr>
|
75
|
+
</table>
|
76
|
+
</div>
|
77
|
+
<!-- banner header -->
|
78
|
+
|
79
|
+
<div id="bodyContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
<div id="contextContent">
|
84
|
+
|
85
|
+
<div id="description">
|
86
|
+
<p>
|
87
|
+
Debian
|
88
|
+
</p>
|
89
|
+
|
90
|
+
</div>
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
|
96
|
+
</div>
|
97
|
+
|
98
|
+
|
99
|
+
<!-- if includes -->
|
100
|
+
|
101
|
+
<div id="section">
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
<!-- if method_list -->
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
|
115
|
+
|
116
|
+
<div id="validator-badges">
|
117
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
</body>
|
121
|
+
</html>
|
@@ -0,0 +1,315 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: SSH</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">SSH</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/svengali/ssh_rb.html">
|
59
|
+
lib/svengali/ssh.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000051">close</a>
|
90
|
+
<a href="#M000053">exec</a>
|
91
|
+
<a href="#M000052">exec!</a>
|
92
|
+
<a href="#M000050">new</a>
|
93
|
+
<a href="#M000054">wait_until_ssh_connectable</a>
|
94
|
+
</div>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
|
100
|
+
<!-- if includes -->
|
101
|
+
|
102
|
+
<div id="section">
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
<div id="attribute-list">
|
109
|
+
<h3 class="section-bar">Attributes</h3>
|
110
|
+
|
111
|
+
<div class="name-list">
|
112
|
+
<table>
|
113
|
+
<tr class="top-aligned-row context-row">
|
114
|
+
<td class="context-item-name">session</td>
|
115
|
+
<td class="context-item-value"> [R] </td>
|
116
|
+
<td class="context-item-desc"></td>
|
117
|
+
</tr>
|
118
|
+
<tr class="top-aligned-row context-row">
|
119
|
+
<td class="context-item-name">sftp_session</td>
|
120
|
+
<td class="context-item-value"> [R] </td>
|
121
|
+
<td class="context-item-desc"></td>
|
122
|
+
</tr>
|
123
|
+
</table>
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<!-- if method_list -->
|
130
|
+
<div id="methods">
|
131
|
+
<h3 class="section-bar">Public Class methods</h3>
|
132
|
+
|
133
|
+
<div id="method-M000050" class="method-detail">
|
134
|
+
<a name="M000050"></a>
|
135
|
+
|
136
|
+
<div class="method-heading">
|
137
|
+
<a href="#M000050" class="method-signature">
|
138
|
+
<span class="method-name">new</span><span class="method-args">(host,user_name=nil,password=nil,private_key_path=nil)</span>
|
139
|
+
</a>
|
140
|
+
</div>
|
141
|
+
|
142
|
+
<div class="method-description">
|
143
|
+
<p><a class="source-toggle" href="#"
|
144
|
+
onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
|
145
|
+
<div class="method-source-code" id="M000050-source">
|
146
|
+
<pre>
|
147
|
+
<span class="ruby-comment cmt"># File lib/svengali/ssh.rb, line 19</span>
|
148
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">host</span>,<span class="ruby-identifier">user_name</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">password</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">private_key_path</span>=<span class="ruby-keyword kw">nil</span>)
|
149
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">user_name</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">password</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">private_key_path</span>
|
150
|
+
<span class="ruby-ivar">@user_name</span> = <span class="ruby-identifier">user_name</span>
|
151
|
+
<span class="ruby-ivar">@passphrase</span> = <span class="ruby-identifier">password</span>
|
152
|
+
<span class="ruby-ivar">@private_key_path</span> = <span class="ruby-identifier">private_key_path</span>
|
153
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">user_name</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">password</span>
|
154
|
+
<span class="ruby-ivar">@user_name</span> = <span class="ruby-identifier">user_name</span>
|
155
|
+
<span class="ruby-ivar">@password</span> = <span class="ruby-identifier">password</span>
|
156
|
+
<span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">host</span>)
|
157
|
+
<span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt">#substitute of constructor which has no argument</span>
|
158
|
+
<span class="ruby-ivar">@host</span> = <span class="ruby-identifier">host</span>
|
159
|
+
<span class="ruby-ivar">@terminator</span> = <span class="ruby-value str">""</span>
|
160
|
+
|
161
|
+
<span class="ruby-identifier">wait_until_ssh_connectable</span>(<span class="ruby-constant">CLibIPAddr</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">host</span>))
|
162
|
+
|
163
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@user_name</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@password</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@private_key_path</span> <span class="ruby-comment cmt">#if initialized with private_key_path, user_name and password</span>
|
164
|
+
<span class="ruby-identifier">debug_p</span> <span class="ruby-value str">"Try Net::SSH.start()!"</span>
|
165
|
+
<span class="ruby-ivar">@session</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">SSH</span>.<span class="ruby-identifier">start</span>(<span class="ruby-ivar">@host</span>, <span class="ruby-ivar">@user_name</span>,<span class="ruby-identifier">:passphrase</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@passphrase</span>, <span class="ruby-identifier">:keys</span> =<span class="ruby-operator">></span> [ <span class="ruby-ivar">@private_key_path</span> ] )
|
166
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@user_name</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@password</span> <span class="ruby-comment cmt">#if initialized with user_name and password</span>
|
167
|
+
<span class="ruby-identifier">debug_p</span> <span class="ruby-value str">"Try Net::SSH.start()!"</span>
|
168
|
+
<span class="ruby-ivar">@session</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">SSH</span>.<span class="ruby-identifier">start</span>(<span class="ruby-ivar">@host</span>, <span class="ruby-ivar">@user_name</span>,<span class="ruby-identifier">:password</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@password</span>)
|
169
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@user_name</span> <span class="ruby-comment cmt">#if initialized with user_name</span>
|
170
|
+
<span class="ruby-identifier">debug_p</span> <span class="ruby-value str">"Try Net::SSH.start()!"</span>
|
171
|
+
<span class="ruby-ivar">@session</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">SSH</span>.<span class="ruby-identifier">start</span>(<span class="ruby-ivar">@host</span>, <span class="ruby-ivar">@user_name</span>)
|
172
|
+
<span class="ruby-keyword kw">end</span>
|
173
|
+
<span class="ruby-identifier">debug_p</span> <span class="ruby-value str">"Net::SSH.start finished."</span>
|
174
|
+
<span class="ruby-ivar">@sftp_session</span> = <span class="ruby-ivar">@session</span>.<span class="ruby-identifier">sftp</span>.<span class="ruby-identifier">connect</span>()
|
175
|
+
<span class="ruby-keyword kw">end</span>
|
176
|
+
<span class="ruby-keyword kw">end</span>
|
177
|
+
</pre>
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
</div>
|
181
|
+
|
182
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
183
|
+
|
184
|
+
<div id="method-M000051" class="method-detail">
|
185
|
+
<a name="M000051"></a>
|
186
|
+
|
187
|
+
<div class="method-heading">
|
188
|
+
<a href="#M000051" class="method-signature">
|
189
|
+
<span class="method-name">close</span><span class="method-args">()</span>
|
190
|
+
</a>
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<div class="method-description">
|
194
|
+
<p><a class="source-toggle" href="#"
|
195
|
+
onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
|
196
|
+
<div class="method-source-code" id="M000051-source">
|
197
|
+
<pre>
|
198
|
+
<span class="ruby-comment cmt"># File lib/svengali/ssh.rb, line 49</span>
|
199
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close</span>
|
200
|
+
<span class="ruby-ivar">@session</span>.<span class="ruby-identifier">close</span>()
|
201
|
+
<span class="ruby-keyword kw">end</span>
|
202
|
+
</pre>
|
203
|
+
</div>
|
204
|
+
</div>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
<div id="method-M000053" class="method-detail">
|
208
|
+
<a name="M000053"></a>
|
209
|
+
|
210
|
+
<div class="method-heading">
|
211
|
+
<a href="#M000053" class="method-signature">
|
212
|
+
<span class="method-name">exec</span><span class="method-args">(command_str)</span>
|
213
|
+
</a>
|
214
|
+
</div>
|
215
|
+
|
216
|
+
<div class="method-description">
|
217
|
+
<p>
|
218
|
+
return value : nothing
|
219
|
+
</p>
|
220
|
+
<p><a class="source-toggle" href="#"
|
221
|
+
onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
|
222
|
+
<div class="method-source-code" id="M000053-source">
|
223
|
+
<pre>
|
224
|
+
<span class="ruby-comment cmt"># File lib/svengali/ssh.rb, line 82</span>
|
225
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exec</span>(<span class="ruby-identifier">command_str</span>)
|
226
|
+
<span class="ruby-identifier">debug_p</span> <span class="ruby-node">"exec -> \"#{command_str}\""</span>
|
227
|
+
|
228
|
+
<span class="ruby-ivar">@session</span>.<span class="ruby-identifier">exec</span>(<span class="ruby-identifier">command_str</span>)
|
229
|
+
<span class="ruby-keyword kw">end</span>
|
230
|
+
</pre>
|
231
|
+
</div>
|
232
|
+
</div>
|
233
|
+
</div>
|
234
|
+
|
235
|
+
<div id="method-M000052" class="method-detail">
|
236
|
+
<a name="M000052"></a>
|
237
|
+
|
238
|
+
<div class="method-heading">
|
239
|
+
<a href="#M000052" class="method-signature">
|
240
|
+
<span class="method-name">exec!</span><span class="method-args">(command_str,time_out = nil)</span>
|
241
|
+
</a>
|
242
|
+
</div>
|
243
|
+
|
244
|
+
<div class="method-description">
|
245
|
+
<p>
|
246
|
+
return value : String of stdout or stderr
|
247
|
+
</p>
|
248
|
+
<p><a class="source-toggle" href="#"
|
249
|
+
onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
|
250
|
+
<div class="method-source-code" id="M000052-source">
|
251
|
+
<pre>
|
252
|
+
<span class="ruby-comment cmt"># File lib/svengali/ssh.rb, line 58</span>
|
253
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exec!</span>(<span class="ruby-identifier">command_str</span>,<span class="ruby-identifier">time_out</span> = <span class="ruby-keyword kw">nil</span>)
|
254
|
+
<span class="ruby-identifier">debug_p</span> <span class="ruby-node">"exec! -> \"#{command_str}\""</span>
|
255
|
+
|
256
|
+
<span class="ruby-keyword kw">begin</span>
|
257
|
+
<span class="ruby-identifier">timeout</span>(<span class="ruby-identifier">time_out</span>) <span class="ruby-keyword kw">do</span>
|
258
|
+
<span class="ruby-identifier">return_val</span> = <span class="ruby-value str">""</span>
|
259
|
+
<span class="ruby-ivar">@session</span>.<span class="ruby-identifier">exec!</span>(<span class="ruby-identifier">command_str</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">ch</span>, <span class="ruby-identifier">stream</span>, <span class="ruby-identifier">data</span><span class="ruby-operator">|</span>
|
260
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">stream</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:stdout</span>
|
261
|
+
<span class="ruby-identifier">return_val</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">data</span>
|
262
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">stream</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:stderr</span>
|
263
|
+
<span class="ruby-identifier">return_val</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">data</span>
|
264
|
+
<span class="ruby-keyword kw">end</span>
|
265
|
+
}
|
266
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">return_val</span>
|
267
|
+
<span class="ruby-keyword kw">end</span>
|
268
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">TimeoutError</span>
|
269
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
270
|
+
<span class="ruby-keyword kw">end</span>
|
271
|
+
<span class="ruby-keyword kw">end</span>
|
272
|
+
</pre>
|
273
|
+
</div>
|
274
|
+
</div>
|
275
|
+
</div>
|
276
|
+
|
277
|
+
<div id="method-M000054" class="method-detail">
|
278
|
+
<a name="M000054"></a>
|
279
|
+
|
280
|
+
<div class="method-heading">
|
281
|
+
<a href="#M000054" class="method-signature">
|
282
|
+
<span class="method-name">wait_until_ssh_connectable</span><span class="method-args">(host)</span>
|
283
|
+
</a>
|
284
|
+
</div>
|
285
|
+
|
286
|
+
<div class="method-description">
|
287
|
+
<p><a class="source-toggle" href="#"
|
288
|
+
onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
|
289
|
+
<div class="method-source-code" id="M000054-source">
|
290
|
+
<pre>
|
291
|
+
<span class="ruby-comment cmt"># File lib/svengali/ssh.rb, line 88</span>
|
292
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">wait_until_ssh_connectable</span>(<span class="ruby-identifier">host</span>)
|
293
|
+
<span class="ruby-comment cmt"># waits until ensure that ssh connection can be accept</span>
|
294
|
+
<span class="ruby-keyword kw">while</span>(<span class="ruby-identifier">is_ssh_connectable</span>(<span class="ruby-identifier">host</span>) <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>)
|
295
|
+
<span class="ruby-identifier">sleep</span>(<span class="ruby-value">1</span>)
|
296
|
+
<span class="ruby-keyword kw">end</span>
|
297
|
+
<span class="ruby-keyword kw">end</span>
|
298
|
+
</pre>
|
299
|
+
</div>
|
300
|
+
</div>
|
301
|
+
</div>
|
302
|
+
|
303
|
+
|
304
|
+
</div>
|
305
|
+
|
306
|
+
|
307
|
+
</div>
|
308
|
+
|
309
|
+
|
310
|
+
<div id="validator-badges">
|
311
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
312
|
+
</div>
|
313
|
+
|
314
|
+
</body>
|
315
|
+
</html>
|