svengali 0.2.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/LICENSE +20 -0
  2. data/README +0 -0
  3. data/README.rdoc +17 -0
  4. data/Rakefile +47 -0
  5. data/VERSION +1 -0
  6. data/api_document020_en.pdf +0 -0
  7. data/api_document020_ja.pdf +0 -0
  8. data/api_document_en.pptx +0 -0
  9. data/api_document_ja.pptx +0 -0
  10. data/lib/svengali.rb +2 -0
  11. data/lib/svengali/config.rb +78 -0
  12. data/lib/svengali/ext_string.rb +55 -0
  13. data/lib/svengali/ext_string/command.yml +6 -0
  14. data/lib/svengali/ext_string/path.yml +6 -0
  15. data/lib/svengali/file_io.rb +106 -0
  16. data/lib/svengali/machine.rb +123 -0
  17. data/lib/svengali/platforms/debian.rb +5 -0
  18. data/lib/svengali/platforms/default.rb +4 -0
  19. data/lib/svengali/plugins/eucalyptus.rb +339 -0
  20. data/lib/svengali/plugins/machine_config.rb +126 -0
  21. data/lib/svengali/plugins/package.rb +7 -0
  22. data/lib/svengali/ssh.rb +106 -0
  23. data/lib/svengali/svengali.rb +19 -0
  24. data/lib/svengali/util.rb +117 -0
  25. data/rdoc/classes/CLibIPAddr.html +230 -0
  26. data/rdoc/classes/Cloud.html +506 -0
  27. data/rdoc/classes/Config.html +151 -0
  28. data/rdoc/classes/Config/ConfigFile.html +319 -0
  29. data/rdoc/classes/ExtStr.html +209 -0
  30. data/rdoc/classes/ExtStrAccessor.html +183 -0
  31. data/rdoc/classes/FileIO.html +415 -0
  32. data/rdoc/classes/Machine.html +771 -0
  33. data/rdoc/classes/MachineMaster.html +117 -0
  34. data/rdoc/classes/Platform.html +121 -0
  35. data/rdoc/classes/SSH.html +315 -0
  36. data/rdoc/created.rid +1 -0
  37. data/rdoc/files/README.html +101 -0
  38. data/rdoc/files/README_rdoc.html +133 -0
  39. data/rdoc/files/lib/svengali/config_rb.html +114 -0
  40. data/rdoc/files/lib/svengali/ext_string_rb.html +108 -0
  41. data/rdoc/files/lib/svengali/file_io_rb.html +115 -0
  42. data/rdoc/files/lib/svengali/machine_rb.html +108 -0
  43. data/rdoc/files/lib/svengali/platforms/debian_rb.html +107 -0
  44. data/rdoc/files/lib/svengali/platforms/default_rb.html +107 -0
  45. data/rdoc/files/lib/svengali/plugins/eucalyptus_rb.html +389 -0
  46. data/rdoc/files/lib/svengali/plugins/machine_config_rb.html +101 -0
  47. data/rdoc/files/lib/svengali/plugins/package_rb.html +101 -0
  48. data/rdoc/files/lib/svengali/ssh_rb.html +110 -0
  49. data/rdoc/files/lib/svengali/svengali_rb.html +125 -0
  50. data/rdoc/files/lib/svengali/util_rb.html +439 -0
  51. data/rdoc/files/lib/svengali_rb.html +108 -0
  52. data/rdoc/fr_class_index.html +37 -0
  53. data/rdoc/fr_file_index.html +41 -0
  54. data/rdoc/fr_method_index.html +100 -0
  55. data/rdoc/index.html +26 -0
  56. data/rdoc/rdoc-style.css +208 -0
  57. data/spec/spec.opts +1 -0
  58. data/spec/spec_helper.rb +9 -0
  59. data/spec/svengali_spec.rb +7 -0
  60. data/svengali.gemspec +113 -0
  61. data/svengali_sample.rb +43 -0
  62. data/test/scenario.sh +3 -0
  63. metadata +179 -0
@@ -0,0 +1,101 @@
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>File: machine_config.rb</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="fileHeader">
50
+ <h1>machine_config.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/svengali/plugins/machine_config.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Sat Jun 12 15:28:10 +0900 2010</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+
73
+ </div>
74
+
75
+
76
+ </div>
77
+
78
+
79
+ <!-- if includes -->
80
+
81
+ <div id="section">
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <!-- if method_list -->
91
+
92
+
93
+ </div>
94
+
95
+
96
+ <div id="validator-badges">
97
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
98
+ </div>
99
+
100
+ </body>
101
+ </html>
@@ -0,0 +1,101 @@
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>File: package.rb</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="fileHeader">
50
+ <h1>package.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/svengali/plugins/package.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Sat Jun 12 15:28:10 +0900 2010</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+
73
+ </div>
74
+
75
+
76
+ </div>
77
+
78
+
79
+ <!-- if includes -->
80
+
81
+ <div id="section">
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <!-- if method_list -->
91
+
92
+
93
+ </div>
94
+
95
+
96
+ <div id="validator-badges">
97
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
98
+ </div>
99
+
100
+ </body>
101
+ </html>
@@ -0,0 +1,110 @@
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>File: ssh.rb</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="fileHeader">
50
+ <h1>ssh.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/svengali/ssh.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Sun Jul 11 22:45:59 +0900 2010</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+ <div id="requires-list">
73
+ <h3 class="section-bar">Required files</h3>
74
+
75
+ <div class="name-list">
76
+ rubygems&nbsp;&nbsp;
77
+ net/ssh&nbsp;&nbsp;
78
+ timeout&nbsp;&nbsp;
79
+ </div>
80
+ </div>
81
+
82
+ </div>
83
+
84
+
85
+ </div>
86
+
87
+
88
+ <!-- if includes -->
89
+
90
+ <div id="section">
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+ <!-- if method_list -->
100
+
101
+
102
+ </div>
103
+
104
+
105
+ <div id="validator-badges">
106
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
107
+ </div>
108
+
109
+ </body>
110
+ </html>
@@ -0,0 +1,125 @@
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>File: svengali.rb</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="fileHeader">
50
+ <h1>svengali.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/svengali/svengali.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Sun Jun 13 16:04:36 +0900 2010</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+ <div id="description">
72
+ <p>
73
+ main routine of svengali
74
+ </p>
75
+
76
+ </div>
77
+
78
+
79
+ </div>
80
+
81
+
82
+ </div>
83
+
84
+
85
+ <!-- if includes -->
86
+
87
+ <div id="section">
88
+
89
+
90
+ <div id="constants-list">
91
+ <h3 class="section-bar">Constants</h3>
92
+
93
+ <div class="name-list">
94
+ <table summary="Constants">
95
+ <tr class="top-aligned-row context-row">
96
+ <td class="context-item-name">LIBNAME</td>
97
+ <td>=</td>
98
+ <td class="context-item-value">&quot;svengali/&quot;</td>
99
+ <td width="3em">&nbsp;</td>
100
+ <td class="context-item-desc">
101
+ slash of tails is to avoid a baffling bug
102
+
103
+ </td>
104
+ </tr>
105
+ </table>
106
+ </div>
107
+ </div>
108
+
109
+
110
+
111
+
112
+
113
+
114
+ <!-- if method_list -->
115
+
116
+
117
+ </div>
118
+
119
+
120
+ <div id="validator-badges">
121
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
122
+ </div>
123
+
124
+ </body>
125
+ </html>
@@ -0,0 +1,439 @@
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>File: util.rb</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="fileHeader">
50
+ <h1>util.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/svengali/util.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Sun Jul 11 10:55:34 +0900 2010</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+ <div id="requires-list">
73
+ <h3 class="section-bar">Required files</h3>
74
+
75
+ <div class="name-list">
76
+ socket&nbsp;&nbsp;
77
+ </div>
78
+ </div>
79
+
80
+ </div>
81
+
82
+ <div id="method-list">
83
+ <h3 class="section-bar">Methods</h3>
84
+
85
+ <div class="name-list">
86
+ <a href="#M000007">change_platform</a>&nbsp;&nbsp;
87
+ <a href="#M000009">check_has_keys</a>&nbsp;&nbsp;
88
+ <a href="#M000002">debug_p</a>&nbsp;&nbsp;
89
+ <a href="#M000008">err_message_and_exit</a>&nbsp;&nbsp;
90
+ <a href="#M000011">find_machines_on_range_by_ping</a>&nbsp;&nbsp;
91
+ <a href="#M000010">is_exist_by_ping</a>&nbsp;&nbsp;
92
+ <a href="#M000004">lazy_inp</a>&nbsp;&nbsp;
93
+ <a href="#M000006">load_plugin</a>&nbsp;&nbsp;
94
+ <a href="#M000003">not_inp</a>&nbsp;&nbsp;
95
+ <a href="#M000005">not_tested</a>&nbsp;&nbsp;
96
+ <a href="#M000001">stop_debug_print</a>&nbsp;&nbsp;
97
+ </div>
98
+ </div>
99
+
100
+ </div>
101
+
102
+
103
+ <!-- if includes -->
104
+
105
+ <div id="section">
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+ <!-- if method_list -->
115
+ <div id="methods">
116
+ <h3 class="section-bar">Public Instance methods</h3>
117
+
118
+ <div id="method-M000007" class="method-detail">
119
+ <a name="M000007"></a>
120
+
121
+ <div class="method-heading">
122
+ <a href="#M000007" class="method-signature">
123
+ <span class="method-name">change_platform</span><span class="method-args">(platform_name_str)</span>
124
+ </a>
125
+ </div>
126
+
127
+ <div class="method-description">
128
+ <p>
129
+ change platform &quot;default&quot; to <b>platform_name_str</b>
130
+ &quot;default&quot; was specified on svengali.rb on ahead
131
+ </p>
132
+ <p><a class="source-toggle" href="#"
133
+ onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
134
+ <div class="method-source-code" id="M000007-source">
135
+ <pre>
136
+ <span class="ruby-comment cmt"># File lib/svengali/util.rb, line 64</span>
137
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">change_platform</span>(<span class="ruby-identifier">platform_name_str</span>)
138
+ <span class="ruby-identifier">require</span> <span class="ruby-node">&quot;#{LIBNAME}/platforms/&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">platform_name_str</span>
139
+ <span class="ruby-identifier">$platform_name</span> = <span class="ruby-identifier">platform_name_str</span>
140
+ <span class="ruby-keyword kw">end</span>
141
+ </pre>
142
+ </div>
143
+ </div>
144
+ </div>
145
+
146
+ <div id="method-M000009" class="method-detail">
147
+ <a name="M000009"></a>
148
+
149
+ <div class="method-heading">
150
+ <a href="#M000009" class="method-signature">
151
+ <span class="method-name">check_has_keys</span><span class="method-args">(params_hash,array_of_symbols)</span>
152
+ </a>
153
+ </div>
154
+
155
+ <div class="method-description">
156
+ <p>
157
+ *<b>Attention</b>* this method passes nil values
158
+ </p>
159
+ <p><a class="source-toggle" href="#"
160
+ onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
161
+ <div class="method-source-code" id="M000009-source">
162
+ <pre>
163
+ <span class="ruby-comment cmt"># File lib/svengali/util.rb, line 77</span>
164
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check_has_keys</span>(<span class="ruby-identifier">params_hash</span>,<span class="ruby-identifier">array_of_symbols</span>)
165
+ <span class="ruby-identifier">array_of_symbols</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">symbol</span><span class="ruby-operator">|</span>
166
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">params_hash</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">symbol</span>)
167
+ <span class="ruby-identifier">err_message_and_exit</span>(<span class="ruby-value str">&quot;please specify a value of :&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">symbol</span>.<span class="ruby-identifier">to_s</span>() <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;!&quot;</span>)
168
+ <span class="ruby-keyword kw">end</span>
169
+ }
170
+ <span class="ruby-keyword kw">end</span>
171
+ </pre>
172
+ </div>
173
+ </div>
174
+ </div>
175
+
176
+ <div id="method-M000002" class="method-detail">
177
+ <a name="M000002"></a>
178
+
179
+ <div class="method-heading">
180
+ <a href="#M000002" class="method-signature">
181
+ <span class="method-name">debug_p</span><span class="method-args">(str = &quot;&quot;)</span>
182
+ </a>
183
+ </div>
184
+
185
+ <div class="method-description">
186
+ <p><a class="source-toggle" href="#"
187
+ onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
188
+ <div class="method-source-code" id="M000002-source">
189
+ <pre>
190
+ <span class="ruby-comment cmt"># File lib/svengali/util.rb, line 35</span>
191
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">debug_p</span>(<span class="ruby-identifier">str</span> = <span class="ruby-value str">&quot;&quot;</span>)
192
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$output_debug_print</span>
193
+ <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;[DEBUG #{caller(1)[0]}] #{str}&quot;</span>
194
+ <span class="ruby-keyword kw">end</span>
195
+ <span class="ruby-keyword kw">end</span>
196
+ </pre>
197
+ </div>
198
+ </div>
199
+ </div>
200
+
201
+ <div id="method-M000008" class="method-detail">
202
+ <a name="M000008"></a>
203
+
204
+ <div class="method-heading">
205
+ <a href="#M000008" class="method-signature">
206
+ <span class="method-name">err_message_and_exit</span><span class="method-args">(str)</span>
207
+ </a>
208
+ </div>
209
+
210
+ <div class="method-description">
211
+ <p><a class="source-toggle" href="#"
212
+ onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
213
+ <div class="method-source-code" id="M000008-source">
214
+ <pre>
215
+ <span class="ruby-comment cmt"># File lib/svengali/util.rb, line 69</span>
216
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">err_message_and_exit</span>(<span class="ruby-identifier">str</span>)
217
+ <span class="ruby-identifier">debug_p</span> <span class="ruby-identifier">str</span>
218
+ <span class="ruby-identifier">debug_p</span> <span class="ruby-value str">&quot;I'm exiting!&quot;</span>
219
+
220
+ <span class="ruby-identifier">exit</span>()
221
+ <span class="ruby-keyword kw">end</span>
222
+ </pre>
223
+ </div>
224
+ </div>
225
+ </div>
226
+
227
+ <div id="method-M000011" class="method-detail">
228
+ <a name="M000011"></a>
229
+
230
+ <div class="method-heading">
231
+ <a href="#M000011" class="method-signature">
232
+ <span class="method-name">find_machines_on_range_by_ping</span><span class="method-args">(ipaddr_range_str)</span>
233
+ </a>
234
+ </div>
235
+
236
+ <div class="method-description">
237
+ <p>
238
+ ipaddr_range_str is like below
239
+ </p>
240
+ <pre>
241
+ &quot;192.168.1.100-200&quot;
242
+ </pre>
243
+ <p>
244
+ return -&gt; hash : { string of ipaddr =&gt; true, .&#8230;.&#8230; ,
245
+ string of ipaddr =&gt; true}
246
+ </p>
247
+ <p><a class="source-toggle" href="#"
248
+ onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
249
+ <div class="method-source-code" id="M000011-source">
250
+ <pre>
251
+ <span class="ruby-comment cmt"># File lib/svengali/util.rb, line 100</span>
252
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_machines_on_range_by_ping</span>(<span class="ruby-identifier">ipaddr_range_str</span>)
253
+ <span class="ruby-identifier">octets_arr</span> = <span class="ruby-identifier">ipaddr_range_str</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;.&quot;</span>)
254
+ <span class="ruby-identifier">splited_last_octet</span> = <span class="ruby-identifier">octets_arr</span>[<span class="ruby-value">3</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;-&quot;</span>)
255
+
256
+ <span class="ruby-identifier">alive_hash</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>()
257
+ <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">last_octet</span> <span class="ruby-keyword kw">in</span> <span class="ruby-identifier">splited_last_octet</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator">..</span> <span class="ruby-identifier">splited_last_octet</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_i</span>
258
+ <span class="ruby-identifier">t</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
259
+ <span class="ruby-identifier">dest_ip_str</span> = <span class="ruby-identifier">octets_arr</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;.&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">octets_arr</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;.&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">octets_arr</span>[<span class="ruby-value">2</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;.&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">last_octet</span>.<span class="ruby-identifier">to_s</span>()
260
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">is_exist_by_ping</span>(<span class="ruby-constant">CLibIPAddr</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">dest_ip_str</span>))
261
+ <span class="ruby-identifier">alive_hash</span>[<span class="ruby-identifier">dest_ip_str</span>] = <span class="ruby-keyword kw">true</span>
262
+ <span class="ruby-keyword kw">end</span>
263
+ <span class="ruby-keyword kw">end</span>
264
+ <span class="ruby-keyword kw">end</span>
265
+
266
+ <span class="ruby-identifier">t</span>.<span class="ruby-identifier">join</span>
267
+
268
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">alive_hash</span>
269
+ <span class="ruby-keyword kw">end</span>
270
+ </pre>
271
+ </div>
272
+ </div>
273
+ </div>
274
+
275
+ <div id="method-M000010" class="method-detail">
276
+ <a name="M000010"></a>
277
+
278
+ <div class="method-heading">
279
+ <a href="#M000010" class="method-signature">
280
+ <span class="method-name">is_exist_by_ping</span><span class="method-args">(ipaddr)</span>
281
+ </a>
282
+ </div>
283
+
284
+ <div class="method-description">
285
+ <p>
286
+ ipaddr -&gt; ClibIPAddr : destination IP address return -&gt; boolean
287
+ </p>
288
+ <p>
289
+ This method returns at most 3sec after
290
+ </p>
291
+ <p><a class="source-toggle" href="#"
292
+ onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
293
+ <div class="method-source-code" id="M000010-source">
294
+ <pre>
295
+ <span class="ruby-comment cmt"># File lib/svengali/util.rb, line 89</span>
296
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_exist_by_ping</span>(<span class="ruby-identifier">ipaddr</span>)
297
+ <span class="ruby-comment cmt"># this execution returns at most 3sec after</span>
298
+ <span class="ruby-node">`ping #{ipaddr.to_s} -c 1 -w 3`</span>
299
+ <span class="ruby-identifier">result</span> = ( <span class="ruby-identifier">$?</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> ) <span class="ruby-operator">?</span> <span class="ruby-keyword kw">true</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span>
300
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
301
+ <span class="ruby-keyword kw">end</span>
302
+ </pre>
303
+ </div>
304
+ </div>
305
+ </div>
306
+
307
+ <div id="method-M000004" class="method-detail">
308
+ <a name="M000004"></a>
309
+
310
+ <div class="method-heading">
311
+ <a href="#M000004" class="method-signature">
312
+ <span class="method-name">lazy_inp</span><span class="method-args">()</span>
313
+ </a>
314
+ </div>
315
+
316
+ <div class="method-description">
317
+ <p><a class="source-toggle" href="#"
318
+ onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
319
+ <div class="method-source-code" id="M000004-source">
320
+ <pre>
321
+ <span class="ruby-comment cmt"># File lib/svengali/util.rb, line 45</span>
322
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lazy_inp</span>()
323
+ <span class="ruby-identifier">debug_p</span>(<span class="ruby-identifier">caller</span>(<span class="ruby-value">1</span>)[<span class="ruby-value">0</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">&quot; -&gt; Lazily implemented. Here should be fixed if you have time.&quot;</span>)
324
+ <span class="ruby-keyword kw">end</span>
325
+ </pre>
326
+ </div>
327
+ </div>
328
+ </div>
329
+
330
+ <div id="method-M000006" class="method-detail">
331
+ <a name="M000006"></a>
332
+
333
+ <div class="method-heading">
334
+ <a href="#M000006" class="method-signature">
335
+ <span class="method-name">load_plugin</span><span class="method-args">(plugin_name_str)</span>
336
+ </a>
337
+ </div>
338
+
339
+ <div class="method-description">
340
+ <p><a class="source-toggle" href="#"
341
+ onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
342
+ <div class="method-source-code" id="M000006-source">
343
+ <pre>
344
+ <span class="ruby-comment cmt"># File lib/svengali/util.rb, line 53</span>
345
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_plugin</span>(<span class="ruby-identifier">plugin_name_str</span>)
346
+ <span class="ruby-comment cmt"># open( File::dirname(__FILE__) + &quot;/plugin/&quot; + plugin_name_str + &quot;.rb&quot;){ |file|</span>
347
+ <span class="ruby-comment cmt"># contents = file.read()</span>
348
+ <span class="ruby-comment cmt"># contents = &quot;class Machine\n&quot; + contents + &quot;\nend&quot;</span>
349
+ <span class="ruby-comment cmt"># eval(contents)</span>
350
+ <span class="ruby-comment cmt"># }</span>
351
+ <span class="ruby-identifier">require</span> <span class="ruby-node">&quot;#{LIBNAME}/plugins/&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">plugin_name_str</span>
352
+ <span class="ruby-keyword kw">end</span>
353
+ </pre>
354
+ </div>
355
+ </div>
356
+ </div>
357
+
358
+ <div id="method-M000003" class="method-detail">
359
+ <a name="M000003"></a>
360
+
361
+ <div class="method-heading">
362
+ <a href="#M000003" class="method-signature">
363
+ <span class="method-name">not_inp</span><span class="method-args">()</span>
364
+ </a>
365
+ </div>
366
+
367
+ <div class="method-description">
368
+ <p><a class="source-toggle" href="#"
369
+ onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
370
+ <div class="method-source-code" id="M000003-source">
371
+ <pre>
372
+ <span class="ruby-comment cmt"># File lib/svengali/util.rb, line 41</span>
373
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">not_inp</span>()
374
+ <span class="ruby-identifier">debug_p</span>(<span class="ruby-identifier">caller</span>(<span class="ruby-value">1</span>)[<span class="ruby-value">0</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">&quot; -&gt; Not implemented yet.&quot;</span>)
375
+ <span class="ruby-keyword kw">end</span>
376
+ </pre>
377
+ </div>
378
+ </div>
379
+ </div>
380
+
381
+ <div id="method-M000005" class="method-detail">
382
+ <a name="M000005"></a>
383
+
384
+ <div class="method-heading">
385
+ <a href="#M000005" class="method-signature">
386
+ <span class="method-name">not_tested</span><span class="method-args">()</span>
387
+ </a>
388
+ </div>
389
+
390
+ <div class="method-description">
391
+ <p><a class="source-toggle" href="#"
392
+ onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
393
+ <div class="method-source-code" id="M000005-source">
394
+ <pre>
395
+ <span class="ruby-comment cmt"># File lib/svengali/util.rb, line 49</span>
396
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">not_tested</span>()
397
+ <span class="ruby-identifier">debug_p</span>(<span class="ruby-identifier">caller</span>(<span class="ruby-value">1</span>)[<span class="ruby-value">0</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">&quot; -&gt; Not tested yet.&quot;</span>)
398
+ <span class="ruby-keyword kw">end</span>
399
+ </pre>
400
+ </div>
401
+ </div>
402
+ </div>
403
+
404
+ <div id="method-M000001" class="method-detail">
405
+ <a name="M000001"></a>
406
+
407
+ <div class="method-heading">
408
+ <a href="#M000001" class="method-signature">
409
+ <span class="method-name">stop_debug_print</span><span class="method-args">()</span>
410
+ </a>
411
+ </div>
412
+
413
+ <div class="method-description">
414
+ <p><a class="source-toggle" href="#"
415
+ onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
416
+ <div class="method-source-code" id="M000001-source">
417
+ <pre>
418
+ <span class="ruby-comment cmt"># File lib/svengali/util.rb, line 31</span>
419
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop_debug_print</span>()
420
+ <span class="ruby-identifier">$output_debug_print</span> = <span class="ruby-keyword kw">false</span>
421
+ <span class="ruby-keyword kw">end</span>
422
+ </pre>
423
+ </div>
424
+ </div>
425
+ </div>
426
+
427
+
428
+ </div>
429
+
430
+
431
+ </div>
432
+
433
+
434
+ <div id="validator-badges">
435
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
436
+ </div>
437
+
438
+ </body>
439
+ </html>