ratch 0.3.0 → 0.4.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.
Files changed (132) hide show
  1. data/{log/history → CHANGES} +0 -0
  2. data/{log/todo → TODO} +0 -0
  3. data/bin/manifest +451 -0
  4. data/bin/ratch +3 -3
  5. data/demo/task/config.yaml +4 -0
  6. data/lib/ratch/{batch/argvutils.rb → dsl/argv.rb} +9 -4
  7. data/lib/ratch/dsl/batch.rb +226 -0
  8. data/lib/ratch/{batch → dsl}/build.rb +83 -4
  9. data/lib/ratch/{batch/consoleutils.rb → dsl/console.rb} +13 -5
  10. data/lib/ratch/{batch/emailutils.rb → dsl/email.rb} +21 -25
  11. data/lib/ratch/{batch/fileutils.rb → dsl/file.rb} +56 -56
  12. data/lib/ratch/dsl/meta.rb +132 -0
  13. data/lib/ratch/{batch → dsl}/options.rb +7 -5
  14. data/lib/ratch/dsl/setup.rb +124 -0
  15. data/lib/ratch/{support/signiture.rb → dsl/sign.rb} +9 -18
  16. data/lib/ratch/dsl/stage.rb +147 -0
  17. data/lib/ratch/dsl/task.rb +139 -0
  18. data/lib/ratch/{uploadutils.rb → dsl/upload.rb} +7 -5
  19. data/lib/ratch/{batch/task.rb → dsl/zip.rb} +30 -14
  20. data/lib/ratch/dsl.rb +52 -0
  21. data/lib/ratch/extra/email.rb +5 -0
  22. data/lib/ratch/extra/stage.rb +5 -0
  23. data/lib/ratch/extra/zip.rb +5 -0
  24. data/lib/ratch/manifest.rb +540 -0
  25. data/lib/ratch/{project → metadata}/information.rb +1 -0
  26. data/lib/ratch/{project → metadata}/package.rb +28 -2
  27. data/lib/ratch/{project → metadata}/project.rb +8 -16
  28. data/lib/ratch/{project → metadata}/release.rb +6 -6
  29. data/lib/ratch/support/errors.rb +4 -0
  30. data/lib/ratch/support/filename.rb +18 -0
  31. data/lib/ratch/toolset/ruby/compile +49 -0
  32. data/lib/ratch/toolset/ruby/pack/gem +26 -18
  33. data/lib/ratch/toolset/ruby/pack/tgz +25 -64
  34. data/lib/ratch/toolset/ruby/pack/zip +46 -0
  35. data/lib/ratch/toolset/ruby/publish +23 -24
  36. data/lib/ratch/toolset/ruby/release +8 -0
  37. data/lib/ratch/toolset/ruby/stamp +33 -0
  38. data/lib/ratch/toolset/sandbox +11 -0
  39. data/meta/MANIFEST +101 -23
  40. data/meta/ROLLRC +1 -1
  41. data/meta/config.yaml +10 -0
  42. data/meta/icli.yaml +2 -2
  43. data/meta/project.yaml +9 -10
  44. data/meta/xProjectInfo +41 -0
  45. data/task/release +1 -4
  46. metadata +82 -156
  47. data/demo/task/rdoc +0 -88
  48. data/demo/task/rdoc-old +0 -182
  49. data/doc/images/clipboard.jpg +0 -0
  50. data/doc/images/clipboard2.png +0 -0
  51. data/doc/images/milles-tn.jpg +0 -0
  52. data/doc/images/mints.png +0 -0
  53. data/doc/images/ratch2.png +0 -0
  54. data/doc/images/ruby-sm.png +0 -0
  55. data/doc/images/silver.gif +0 -0
  56. data/doc/images/toolbox.jpg +0 -0
  57. data/doc/index.html +0 -181
  58. data/doc/notes/original.rb +0 -308
  59. data/doc/rdoc/classes/Array.html +0 -194
  60. data/doc/rdoc/classes/Dir.html +0 -317
  61. data/doc/rdoc/classes/Hash.html +0 -217
  62. data/doc/rdoc/classes/Ratch/ArgvUtils/Ext.html +0 -285
  63. data/doc/rdoc/classes/Ratch/ArgvUtils.html +0 -173
  64. data/doc/rdoc/classes/Ratch/BatchFile.html +0 -207
  65. data/doc/rdoc/classes/Ratch/BatchManager.html +0 -250
  66. data/doc/rdoc/classes/Ratch/BatchScript.html +0 -127
  67. data/doc/rdoc/classes/Ratch/Batchable.html +0 -373
  68. data/doc/rdoc/classes/Ratch/Build.html +0 -321
  69. data/doc/rdoc/classes/Ratch/BuildManager.html +0 -319
  70. data/doc/rdoc/classes/Ratch/Buildable.html +0 -202
  71. data/doc/rdoc/classes/Ratch/ConfigUtils.html +0 -281
  72. data/doc/rdoc/classes/Ratch/ConsoleUtils.html +0 -189
  73. data/doc/rdoc/classes/Ratch/EmailUtils.html +0 -209
  74. data/doc/rdoc/classes/Ratch/FileUtils.html +0 -674
  75. data/doc/rdoc/classes/Ratch/GeneralOptions.html +0 -430
  76. data/doc/rdoc/classes/Ratch/Task.html +0 -201
  77. data/doc/rdoc/classes/Ratch/TaskManager.html +0 -330
  78. data/doc/rdoc/classes/Ratch/Taskable.html +0 -231
  79. data/doc/rdoc/classes/Ratch/UploadUtils.html +0 -566
  80. data/doc/rdoc/classes/Ratch.html +0 -201
  81. data/doc/rdoc/created.rid +0 -1
  82. data/doc/rdoc/files/COPYING.html +0 -1003
  83. data/doc/rdoc/files/README.html +0 -143
  84. data/doc/rdoc/files/lib/ratch/argvutils_rb.html +0 -131
  85. data/doc/rdoc/files/lib/ratch/batch_rb.html +0 -155
  86. data/doc/rdoc/files/lib/ratch/batchable_rb.html +0 -131
  87. data/doc/rdoc/files/lib/ratch/batchfile_rb.html +0 -148
  88. data/doc/rdoc/files/lib/ratch/buildable_rb.html +0 -131
  89. data/doc/rdoc/files/lib/ratch/consoleutils_rb.html +0 -131
  90. data/doc/rdoc/files/lib/ratch/emailutils_rb.html +0 -139
  91. data/doc/rdoc/files/lib/ratch/facets/multiglob_rb.html +0 -137
  92. data/doc/rdoc/files/lib/ratch/fileutils_rb.html +0 -139
  93. data/doc/rdoc/files/lib/ratch/options_rb.html +0 -131
  94. data/doc/rdoc/files/lib/ratch/taskable_rb.html +0 -131
  95. data/doc/rdoc/files/lib/ratch/uploadutils_rb.html +0 -150
  96. data/doc/rdoc/fr_class_index.html +0 -48
  97. data/doc/rdoc/fr_file_index.html +0 -41
  98. data/doc/rdoc/fr_method_index.html +0 -133
  99. data/doc/rdoc/index.html +0 -24
  100. data/doc/rdoc/rdoc-style.css +0 -208
  101. data/doc/scrap/flexihead-flip.jpg +0 -0
  102. data/doc/scrap/flexihead.jpg +0 -0
  103. data/doc/scrap/head1.jpg +0 -0
  104. data/doc/scrap/ratch.jpg +0 -0
  105. data/doc/scrap/ratch1.png +0 -0
  106. data/doc/scrap/ratch2.jpg +0 -0
  107. data/doc/scrap/ratch3.png +0 -0
  108. data/doc/scrap/red-ratch.jpg +0 -0
  109. data/doc/scrap/redratchet.jpg +0 -0
  110. data/doc/scrap/ruby-kit/ruby.png +0 -0
  111. data/doc/scrap/scrap.red +0 -256
  112. data/doc/sitemap.yaml +0 -10
  113. data/doc/siteparts/index.red +0 -100
  114. data/doc/siteparts/layout.rhtml +0 -56
  115. data/doc/siteparts/tutorial.red +0 -578
  116. data/doc/style.css +0 -112
  117. data/doc/tutorial.html +0 -722
  118. data/lib/ratch/batch.rb +0 -488
  119. data/lib/ratch/support/setuputils.rb +0 -124
  120. data/lib/ratch/support/stage.rb +0 -292
  121. data/lib/ratch/toolset/ruby/rdoc +0 -88
  122. data/task/rdoc +0 -6
  123. data/work/old/batchfile.rb +0 -95
  124. data/work/project-old.rb +0 -67
  125. data/work/scrap/install +0 -89
  126. data/work/scrap/install.0 +0 -49
  127. data/work/scrap/install.1 +0 -63
  128. data/work/scrap/ludo +0 -25
  129. data/work/scrap/oldtaskable.rb +0 -573
  130. data/work/scrap/ratch.man +0 -39
  131. data/work/scrap/taskable-simple.rb +0 -42
  132. data/work/scrap/taskable.rb +0 -120
@@ -1,202 +0,0 @@
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>Module: Ratch::Buildable</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>Module</strong></td>
53
- <td class="class-name-in-header">Ratch::Buildable</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/ratch/buildable_rb.html">
59
- lib/ratch/buildable.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- </table>
66
- </div>
67
- <!-- banner header -->
68
-
69
- <div id="bodyContent">
70
-
71
-
72
-
73
- <div id="contextContent">
74
-
75
- <div id="description">
76
- <h1><a href="Buildable.html">Buildable</a> mixin</h1>
77
-
78
- </div>
79
-
80
-
81
- </div>
82
-
83
- <div id="method-list">
84
- <h3 class="section-bar">Methods</h3>
85
-
86
- <div class="name-list">
87
- <a href="#M000025">build</a>&nbsp;&nbsp;
88
- <a href="#M000023">build_manager</a>&nbsp;&nbsp;
89
- <a href="#M000024">file</a>&nbsp;&nbsp;
90
- </div>
91
- </div>
92
-
93
- </div>
94
-
95
-
96
- <!-- if includes -->
97
-
98
- <div id="section">
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
- <!-- if method_list -->
108
- <div id="methods">
109
- <h3 class="section-bar">Public Instance methods</h3>
110
-
111
- <div id="method-M000025" class="method-detail">
112
- <a name="M000025"></a>
113
-
114
- <div class="method-heading">
115
- <a href="#M000025" class="method-signature">
116
- <span class="method-name">build</span><span class="method-args">(file)</span>
117
- </a>
118
- </div>
119
-
120
- <div class="method-description">
121
- <p>
122
- <a href="Build.html">Build</a> a <a href="Buildable.html#M000024">file</a>.
123
- </p>
124
- <p><a class="source-toggle" href="#"
125
- onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
126
- <div class="method-source-code" id="M000025-source">
127
- <pre>
128
- <span class="ruby-comment cmt"># File lib/ratch/buildable.rb, line 42</span>
129
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build</span>(<span class="ruby-identifier">file</span>)
130
- <span class="ruby-identifier">build_manager</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">file</span>)
131
- <span class="ruby-keyword kw">end</span>
132
- </pre>
133
- </div>
134
- </div>
135
- </div>
136
-
137
- <div id="method-M000023" class="method-detail">
138
- <a name="M000023"></a>
139
-
140
- <div class="method-heading">
141
- <a href="#M000023" class="method-signature">
142
- <span class="method-name">build_manager</span><span class="method-args">()</span>
143
- </a>
144
- </div>
145
-
146
- <div class="method-description">
147
- <p>
148
- Reference task manager.
149
- </p>
150
- <p><a class="source-toggle" href="#"
151
- onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
152
- <div class="method-source-code" id="M000023-source">
153
- <pre>
154
- <span class="ruby-comment cmt"># File lib/ratch/buildable.rb, line 31</span>
155
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_manager</span>
156
- <span class="ruby-ivar">@build_manager</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">BuildManager</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>)
157
- <span class="ruby-keyword kw">end</span>
158
- </pre>
159
- </div>
160
- </div>
161
- </div>
162
-
163
- <div id="method-M000024" class="method-detail">
164
- <a name="M000024"></a>
165
-
166
- <div class="method-heading">
167
- <a href="#M000024" class="method-signature">
168
- <span class="method-name">file</span><span class="method-args">(name, &amp;block)</span>
169
- </a>
170
- </div>
171
-
172
- <div class="method-description">
173
- <p>
174
- Define a <a href="Buildable.html#M000025">build</a> target.
175
- </p>
176
- <p><a class="source-toggle" href="#"
177
- onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
178
- <div class="method-source-code" id="M000024-source">
179
- <pre>
180
- <span class="ruby-comment cmt"># File lib/ratch/buildable.rb, line 36</span>
181
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">file</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
182
- <span class="ruby-identifier">name</span>, <span class="ruby-identifier">deps</span>, <span class="ruby-identifier">block</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">parse_build_dependencies</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
183
- <span class="ruby-identifier">build_manager</span>.<span class="ruby-identifier">define_file</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">deps</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
184
- <span class="ruby-keyword kw">end</span>
185
- </pre>
186
- </div>
187
- </div>
188
- </div>
189
-
190
-
191
- </div>
192
-
193
-
194
- </div>
195
-
196
-
197
- <div id="validator-badges">
198
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
199
- </div>
200
-
201
- </body>
202
- </html>
@@ -1,281 +0,0 @@
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>Module: Ratch::ConfigUtils</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>Module</strong></td>
53
- <td class="class-name-in-header">Ratch::ConfigUtils</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/ratch/configutils_rb.html">
59
- lib/ratch/configutils.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- </table>
66
- </div>
67
- <!-- banner header -->
68
-
69
- <div id="bodyContent">
70
-
71
-
72
-
73
- <div id="contextContent">
74
-
75
-
76
-
77
- </div>
78
-
79
- <div id="method-list">
80
- <h3 class="section-bar">Methods</h3>
81
-
82
- <div class="name-list">
83
- <a href="#M000054">config_file</a>&nbsp;&nbsp;
84
- <a href="#M000055">config_read</a>&nbsp;&nbsp;
85
- <a href="#M000057">config_vector</a>&nbsp;&nbsp;
86
- <a href="#M000053">configuration</a>&nbsp;&nbsp;
87
- <a href="#M000056">utility_directory</a>&nbsp;&nbsp;
88
- </div>
89
- </div>
90
-
91
- </div>
92
-
93
-
94
- <!-- if includes -->
95
-
96
- <div id="section">
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
- <!-- if method_list -->
106
- <div id="methods">
107
- <h3 class="section-bar">Public Instance methods</h3>
108
-
109
- <div id="method-M000054" class="method-detail">
110
- <a name="M000054"></a>
111
-
112
- <div class="method-heading">
113
- <a href="#M000054" class="method-signature">
114
- <span class="method-name">config_file</span><span class="method-args">(path=nil)</span>
115
- </a>
116
- </div>
117
-
118
- <div class="method-description">
119
- <p>
120
- If a <tt>path</tt> is given it will first be looked for in the config
121
- directory of the utility directory. If not there, then it will be looked
122
- for in the project&#8216;s trunk.
123
- </p>
124
- <p>
125
- If <tt>path</tt> is not given then config.yaml or config/general.yaml will
126
- be used.
127
- </p>
128
- <p><a class="source-toggle" href="#"
129
- onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
130
- <div class="method-source-code" id="M000054-source">
131
- <pre>
132
- <span class="ruby-comment cmt"># File lib/ratch/configutils.rb, line 53</span>
133
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">config_file</span>(<span class="ruby-identifier">path</span>=<span class="ruby-keyword kw">nil</span>)
134
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path</span>
135
- <span class="ruby-identifier">find</span> = <span class="ruby-node">&quot;{#{utility_directory}/config/,}#{path}{.yaml,.yml,}&quot;</span>
136
- <span class="ruby-keyword kw">else</span>
137
- <span class="ruby-comment cmt">#path = DEFAULT_CONFIG_FILE</span>
138
- <span class="ruby-identifier">find</span> = <span class="ruby-node">&quot;{#{utility_directory}/config,#{utility_directory}/config/general}{.yaml,.yml,}&quot;</span>
139
- <span class="ruby-keyword kw">end</span>
140
- <span class="ruby-identifier">file</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-identifier">find</span>).<span class="ruby-identifier">find</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">f</span>) }
141
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">file</span>
142
- <span class="ruby-keyword kw">end</span>
143
- </pre>
144
- </div>
145
- </div>
146
- </div>
147
-
148
- <div id="method-M000055" class="method-detail">
149
- <a name="M000055"></a>
150
-
151
- <div class="method-heading">
152
- <a href="#M000055" class="method-signature">
153
- <span class="method-name">config_read</span><span class="method-args">(path)</span>
154
- </a>
155
- </div>
156
-
157
- <div class="method-description">
158
- <p><a class="source-toggle" href="#"
159
- onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
160
- <div class="method-source-code" id="M000055-source">
161
- <pre>
162
- <span class="ruby-comment cmt"># File lib/ratch/configutils.rb, line 66</span>
163
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">config_read</span>(<span class="ruby-identifier">path</span>)
164
- <span class="ruby-comment cmt">#find = &quot;{#{utility_directory}/,}#{path}{.yaml,.yml,}&quot;</span>
165
- <span class="ruby-comment cmt">#if file = Dir.glob(find)[0]</span>
166
- <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">path</span>)
167
- <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">path</span>)) <span class="ruby-operator">||</span> {} <span class="ruby-comment cmt"># The || {} is in case the file is empty.</span>
168
- <span class="ruby-keyword kw">else</span>
169
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">LoadError</span>, <span class="ruby-node">&quot;Missing file -- #{path}&quot;</span>
170
- <span class="ruby-keyword kw">end</span>
171
- <span class="ruby-keyword kw">end</span>
172
- </pre>
173
- </div>
174
- </div>
175
- </div>
176
-
177
- <div id="method-M000057" class="method-detail">
178
- <a name="M000057"></a>
179
-
180
- <div class="method-heading">
181
- <a href="#M000057" class="method-signature">
182
- <span class="method-name">config_vector</span><span class="method-args">(config, args_field=nil)</span>
183
- </a>
184
- </div>
185
-
186
- <div class="method-description">
187
- <p>
188
- Create an argument vector from a set of config options. TODO Deprecate in
189
- favor of <a href="../Hash.html">Hash</a> extension.
190
- </p>
191
- <p><a class="source-toggle" href="#"
192
- onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
193
- <div class="method-source-code" id="M000057-source">
194
- <pre>
195
- <span class="ruby-comment cmt"># File lib/ratch/configutils.rb, line 85</span>
196
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">config_vector</span>(<span class="ruby-identifier">config</span>, <span class="ruby-identifier">args_field</span>=<span class="ruby-keyword kw">nil</span>)
197
- <span class="ruby-identifier">config</span>.<span class="ruby-identifier">command_vector</span>(<span class="ruby-identifier">args_field</span>)
198
- <span class="ruby-keyword kw">end</span>
199
- </pre>
200
- </div>
201
- </div>
202
- </div>
203
-
204
- <div id="method-M000053" class="method-detail">
205
- <a name="M000053"></a>
206
-
207
- <div class="method-heading">
208
- <a href="#M000053" class="method-signature">
209
- <span class="method-name">configuration</span><span class="method-args">(file=nil)</span>
210
- </a>
211
- </div>
212
-
213
- <div class="method-description">
214
- <p>
215
- Load <a href="ConfigUtils.html#M000053">configuration</a> data from a file.
216
- The file will be looked for in the current script directory then from the
217
- project root.
218
- </p>
219
- <p>
220
- Since they are YAML files, they can optionally end with &#8217;.yaml&#8217;
221
- or &#8217;.yml&#8217;.
222
- </p>
223
- <p><a class="source-toggle" href="#"
224
- onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
225
- <div class="method-source-code" id="M000053-source">
226
- <pre>
227
- <span class="ruby-comment cmt"># File lib/ratch/configutils.rb, line 37</span>
228
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configuration</span>(<span class="ruby-identifier">file</span>=<span class="ruby-keyword kw">nil</span>)
229
- <span class="ruby-ivar">@configuration</span> <span class="ruby-operator">||=</span> {}
230
- <span class="ruby-ivar">@configuration</span>[<span class="ruby-identifier">file</span>] <span class="ruby-operator">||=</span> (
231
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">file</span> = <span class="ruby-identifier">config_file</span>(<span class="ruby-identifier">file</span>)
232
- <span class="ruby-identifier">config_read</span>(<span class="ruby-identifier">file</span>)
233
- <span class="ruby-keyword kw">else</span>
234
- <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = {} }
235
- <span class="ruby-keyword kw">end</span>
236
- )
237
- <span class="ruby-keyword kw">end</span>
238
- </pre>
239
- </div>
240
- </div>
241
- </div>
242
-
243
- <div id="method-M000056" class="method-detail">
244
- <a name="M000056"></a>
245
-
246
- <div class="method-heading">
247
- <a href="#M000056" class="method-signature">
248
- <span class="method-name">utility_directory</span><span class="method-args">()</span>
249
- </a>
250
- </div>
251
-
252
- <div class="method-description">
253
- <p>
254
- TODO Better name? Better definition? (Won&#8216;t handle task subdirs!).
255
- </p>
256
- <p><a class="source-toggle" href="#"
257
- onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
258
- <div class="method-source-code" id="M000056-source">
259
- <pre>
260
- <span class="ruby-comment cmt"># File lib/ratch/configutils.rb, line 78</span>
261
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">utility_directory</span>
262
- <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">$0</span>)
263
- <span class="ruby-keyword kw">end</span>
264
- </pre>
265
- </div>
266
- </div>
267
- </div>
268
-
269
-
270
- </div>
271
-
272
-
273
- </div>
274
-
275
-
276
- <div id="validator-badges">
277
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
278
- </div>
279
-
280
- </body>
281
- </html>
@@ -1,189 +0,0 @@
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>Module: Ratch::ConsoleUtils</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>Module</strong></td>
53
- <td class="class-name-in-header">Ratch::ConsoleUtils</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/ratch/consoleutils_rb.html">
59
- lib/ratch/consoleutils.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- </table>
66
- </div>
67
- <!-- banner header -->
68
-
69
- <div id="bodyContent">
70
-
71
-
72
-
73
- <div id="contextContent">
74
-
75
-
76
-
77
- </div>
78
-
79
- <div id="method-list">
80
- <h3 class="section-bar">Methods</h3>
81
-
82
- <div class="name-list">
83
- <a href="#M000074">ask</a>&nbsp;&nbsp;
84
- <a href="#M000075">password</a>&nbsp;&nbsp;
85
- </div>
86
- </div>
87
-
88
- </div>
89
-
90
-
91
- <!-- if includes -->
92
-
93
- <div id="section">
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
- <!-- if method_list -->
103
- <div id="methods">
104
- <h3 class="section-bar">Public Instance methods</h3>
105
-
106
- <div id="method-M000074" class="method-detail">
107
- <a name="M000074"></a>
108
-
109
- <div class="method-heading">
110
- <a href="#M000074" class="method-signature">
111
- <span class="method-name">ask</span><span class="method-args">(question, answers=nil)</span>
112
- </a>
113
- </div>
114
-
115
- <div class="method-description">
116
- <p>
117
- Convenient method to get simple console reply.
118
- </p>
119
- <p><a class="source-toggle" href="#"
120
- onclick="toggleCode('M000074-source');return false;">[Source]</a></p>
121
- <div class="method-source-code" id="M000074-source">
122
- <pre>
123
- <span class="ruby-comment cmt"># File lib/ratch/consoleutils.rb, line 30</span>
124
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ask</span>(<span class="ruby-identifier">question</span>, <span class="ruby-identifier">answers</span>=<span class="ruby-keyword kw">nil</span>)
125
- <span class="ruby-identifier">print</span> <span class="ruby-node">&quot;#{question}&quot;</span>
126
- <span class="ruby-identifier">print</span> <span class="ruby-node">&quot; [#{answers}] &quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">answers</span>
127
- <span class="ruby-keyword kw">until</span> <span class="ruby-identifier">inp</span> = <span class="ruby-identifier">$stdin</span>.<span class="ruby-identifier">gets</span> ; <span class="ruby-identifier">sleep</span> <span class="ruby-value">1</span> ; <span class="ruby-keyword kw">end</span>
128
- <span class="ruby-identifier">inp</span>
129
- <span class="ruby-keyword kw">end</span>
130
- </pre>
131
- </div>
132
- </div>
133
- </div>
134
-
135
- <div id="method-M000075" class="method-detail">
136
- <a name="M000075"></a>
137
-
138
- <div class="method-heading">
139
- <a href="#M000075" class="method-signature">
140
- <span class="method-name">password</span><span class="method-args">(prompt=nil)</span>
141
- </a>
142
- </div>
143
-
144
- <div class="method-description">
145
- <p>
146
- Ask for a <a href="ConsoleUtils.html#M000075">password</a>. (FIXME: only
147
- for unix so far)
148
- </p>
149
- <p><a class="source-toggle" href="#"
150
- onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
151
- <div class="method-source-code" id="M000075-source">
152
- <pre>
153
- <span class="ruby-comment cmt"># File lib/ratch/consoleutils.rb, line 39</span>
154
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">password</span>(<span class="ruby-identifier">prompt</span>=<span class="ruby-keyword kw">nil</span>)
155
- <span class="ruby-identifier">msg</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">&quot;Enter Password: &quot;</span>
156
- <span class="ruby-identifier">inp</span> = <span class="ruby-value str">''</span>
157
-
158
- <span class="ruby-identifier">print</span> <span class="ruby-node">&quot;#{prompt} &quot;</span>
159
-
160
- <span class="ruby-keyword kw">begin</span>
161
- <span class="ruby-identifier">system</span> <span class="ruby-value str">&quot;stty -echo&quot;</span>
162
- <span class="ruby-comment cmt">#inp = gets.chomp</span>
163
- <span class="ruby-keyword kw">until</span> <span class="ruby-identifier">inp</span> = <span class="ruby-identifier">$stdin</span>.<span class="ruby-identifier">gets</span>
164
- <span class="ruby-identifier">sleep</span> <span class="ruby-value">1</span>
165
- <span class="ruby-keyword kw">end</span>
166
- <span class="ruby-keyword kw">ensure</span>
167
- <span class="ruby-identifier">system</span> <span class="ruby-value str">&quot;stty echo&quot;</span>
168
- <span class="ruby-keyword kw">end</span>
169
-
170
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">inp</span>.<span class="ruby-identifier">chomp</span>
171
- <span class="ruby-keyword kw">end</span>
172
- </pre>
173
- </div>
174
- </div>
175
- </div>
176
-
177
-
178
- </div>
179
-
180
-
181
- </div>
182
-
183
-
184
- <div id="validator-badges">
185
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
186
- </div>
187
-
188
- </body>
189
- </html>