cliutils 1.0.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.
- checksums.yaml +7 -0
- data/.DS_Store +0 -0
- data/.gitignore +1 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +48 -0
- data/LICENSE.txt +22 -0
- data/README.md +288 -0
- data/README.rdoc +19 -0
- data/Rakefile +45 -0
- data/bin/cliutils +38 -0
- data/cliutils.gemspec +28 -0
- data/features/cli_manager.feature +13 -0
- data/features/step_definitions/cli_manager_steps.rb +1 -0
- data/features/support/env.rb +16 -0
- data/html/CLIUtils/Configuration.html +271 -0
- data/html/CLIUtils/Configurator.html +504 -0
- data/html/CLIUtils/LoggerDelegator.html +344 -0
- data/html/CLIUtils/Messenging.html +284 -0
- data/html/CLIUtils/Prefs.html +330 -0
- data/html/CLIUtils/PrettyIO.html +799 -0
- data/html/CLIUtils.html +112 -0
- data/html/Hash.html +453 -0
- data/html/Logger.html +183 -0
- data/html/Object.html +120 -0
- data/html/README_md.html +454 -0
- data/html/String.html +413 -0
- data/html/created.rid +13 -0
- data/html/fonts/Lato-Light.ttf +0 -0
- data/html/fonts/Lato-LightItalic.ttf +0 -0
- data/html/fonts/Lato-Regular.ttf +0 -0
- data/html/fonts/Lato-RegularItalic.ttf +0 -0
- data/html/fonts/SourceCodePro-Bold.ttf +0 -0
- data/html/fonts/SourceCodePro-Regular.ttf +0 -0
- data/html/fonts.css +167 -0
- data/html/images/add.png +0 -0
- data/html/images/arrow_up.png +0 -0
- data/html/images/brick.png +0 -0
- data/html/images/brick_link.png +0 -0
- data/html/images/bug.png +0 -0
- data/html/images/bullet_black.png +0 -0
- data/html/images/bullet_toggle_minus.png +0 -0
- data/html/images/bullet_toggle_plus.png +0 -0
- data/html/images/date.png +0 -0
- data/html/images/delete.png +0 -0
- data/html/images/find.png +0 -0
- data/html/images/loadingAnimation.gif +0 -0
- data/html/images/macFFBgHack.png +0 -0
- data/html/images/package.png +0 -0
- data/html/images/page_green.png +0 -0
- data/html/images/page_white_text.png +0 -0
- data/html/images/page_white_width.png +0 -0
- data/html/images/plugin.png +0 -0
- data/html/images/ruby.png +0 -0
- data/html/images/tag_blue.png +0 -0
- data/html/images/tag_green.png +0 -0
- data/html/images/transparent.png +0 -0
- data/html/images/wrench.png +0 -0
- data/html/images/wrench_orange.png +0 -0
- data/html/images/zoom.png +0 -0
- data/html/index.html +455 -0
- data/html/js/darkfish.js +140 -0
- data/html/js/jquery.js +18 -0
- data/html/js/navigation.js +142 -0
- data/html/js/search.js +109 -0
- data/html/js/search_index.js +1 -0
- data/html/js/searcher.js +228 -0
- data/html/rdoc.css +580 -0
- data/html/table_of_contents.html +399 -0
- data/lib/.DS_Store +0 -0
- data/lib/cliutils/configuration.rb +48 -0
- data/lib/cliutils/configurator.rb +119 -0
- data/lib/cliutils/ext/Hash+Extensions.rb +145 -0
- data/lib/cliutils/ext/Logger+Extensions.rb +27 -0
- data/lib/cliutils/ext/String+Extensions.rb +26 -0
- data/lib/cliutils/logger-delegator.rb +66 -0
- data/lib/cliutils/messenging.rb +51 -0
- data/lib/cliutils/prefs.rb +116 -0
- data/lib/cliutils/pretty-io.rb +255 -0
- data/lib/cliutils/version.rb +3 -0
- data/lib/cliutils.rb +15 -0
- data/res/readme-images/messenger-types-1.png +0 -0
- data/res/readme-images/messenger-warn.png +0 -0
- data/res/readme-images/multi-logger.png +0 -0
- data/res/readme-images/prettyio-color-chart.png +0 -0
- data/res/readme-images/prettyio-gnarly-text.png +0 -0
- data/res/readme-images/prettyio-red-text.png +0 -0
- data/res/readme-images/prompting.png +0 -0
- data/res/readme-images/wrapping.png +0 -0
- data/test/configurator_test.rb +50 -0
- data/test/hash_extensions_test.rb +50 -0
- data/test/logger_extensions_test.rb +16 -0
- data/test/messenging_test.rb +53 -0
- data/test/prefs_test.rb +29 -0
- data/test/string_extesions_test.rb +14 -0
- data/test/test_files/prefstest.yaml +33 -0
- metadata +199 -0
@@ -0,0 +1,271 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module CLIUtils::Configuration - CLIUtils</title>
|
8
|
+
|
9
|
+
<link href="../fonts.css" rel="stylesheet">
|
10
|
+
<link href="../rdoc.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
var rdoc_rel_prefix = "../";
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script src="../js/jquery.js"></script>
|
17
|
+
<script src="../js/navigation.js"></script>
|
18
|
+
<script src="../js/search_index.js"></script>
|
19
|
+
<script src="../js/search.js"></script>
|
20
|
+
<script src="../js/searcher.js"></script>
|
21
|
+
<script src="../js/darkfish.js"></script>
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="module">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
<div class="nav-section">
|
58
|
+
<h3>Table of Contents</h3>
|
59
|
+
|
60
|
+
<ul class="link-list" role="directory">
|
61
|
+
<li><a href="#module-CLIUtils::Configuration-label-"></a>
|
62
|
+
<li><a href="#module-CLIUtils::Configuration-label-"></a>
|
63
|
+
</ul>
|
64
|
+
</div>
|
65
|
+
|
66
|
+
|
67
|
+
<div id="class-metadata">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
<!-- Method Quickref -->
|
73
|
+
<div id="method-list-section" class="nav-section">
|
74
|
+
<h3>Methods</h3>
|
75
|
+
|
76
|
+
<ul class="link-list" role="directory">
|
77
|
+
|
78
|
+
<li ><a href="#method-c-included">::included</a>
|
79
|
+
|
80
|
+
<li ><a href="#method-i-configuration">#configuration</a>
|
81
|
+
|
82
|
+
<li ><a href="#method-i-load_configuration">#load_configuration</a>
|
83
|
+
|
84
|
+
</ul>
|
85
|
+
</div>
|
86
|
+
|
87
|
+
</div>
|
88
|
+
</nav>
|
89
|
+
|
90
|
+
<main role="main" aria-labelledby="module-CLIUtils::Configuration">
|
91
|
+
<h1 id="module-CLIUtils::Configuration" class="module">
|
92
|
+
module CLIUtils::Configuration
|
93
|
+
</h1>
|
94
|
+
|
95
|
+
<section class="description">
|
96
|
+
|
97
|
+
<h6 id="module-CLIUtils::Configuration-label-"><span><a href="#module-CLIUtils::Configuration-label-">¶</a> <a href="#documentation">↑</a></span></h6>
|
98
|
+
|
99
|
+
<p><a href="Configuration.html">Configuration</a> Class</p>
|
100
|
+
|
101
|
+
<p>Manages any configuration values and the flat YAML file into which they get
|
102
|
+
stored.</p>
|
103
|
+
|
104
|
+
<h6 id="module-CLIUtils::Configuration-label-"><span><a href="#module-CLIUtils::Configuration-label-">¶</a> <a href="#documentation">↑</a></span></h6>
|
105
|
+
|
106
|
+
</section>
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
122
|
+
<header>
|
123
|
+
<h3>Public Class Methods</h3>
|
124
|
+
</header>
|
125
|
+
|
126
|
+
|
127
|
+
<div id="method-c-included" class="method-detail ">
|
128
|
+
|
129
|
+
<div class="method-heading">
|
130
|
+
<span class="method-name">included</span><span
|
131
|
+
class="method-args">(k)</span>
|
132
|
+
|
133
|
+
<span class="method-click-advice">click to toggle source</span>
|
134
|
+
|
135
|
+
</div>
|
136
|
+
|
137
|
+
|
138
|
+
<div class="method-description">
|
139
|
+
|
140
|
+
<h6 id="method-c-included-label-"><span><a href="#method-c-included-label-">¶</a> <a href="#documentation">↑</a></span></h6>
|
141
|
+
|
142
|
+
<p>Methods</p>
|
143
|
+
|
144
|
+
<h6 id="method-c-included-label-"><span><a href="#method-c-included-label-">¶</a> <a href="#documentation">↑</a></span></h6>
|
145
|
+
<hr>
|
146
|
+
|
147
|
+
<p>included method</p>
|
148
|
+
|
149
|
+
<p>Hook called when this module gets mixed in; extends the includer with the
|
150
|
+
methods defined here. @param k The includer @return Void</p>
|
151
|
+
<hr>
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
<div class="method-source-code" id="included-source">
|
157
|
+
<pre><span class="ruby-comment"># File lib/cliutils/configuration.rb, line 22</span>
|
158
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">k</span>)
|
159
|
+
<span class="ruby-identifier">k</span>.<span class="ruby-identifier">extend</span>(<span class="ruby-keyword">self</span>)
|
160
|
+
<span class="ruby-keyword">end</span></pre>
|
161
|
+
</div>
|
162
|
+
|
163
|
+
</div>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
</div>
|
169
|
+
|
170
|
+
|
171
|
+
</section>
|
172
|
+
|
173
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
174
|
+
<header>
|
175
|
+
<h3>Public Instance Methods</h3>
|
176
|
+
</header>
|
177
|
+
|
178
|
+
|
179
|
+
<div id="method-i-configuration" class="method-detail ">
|
180
|
+
|
181
|
+
<div class="method-heading">
|
182
|
+
<span class="method-name">configuration</span><span
|
183
|
+
class="method-args">()</span>
|
184
|
+
|
185
|
+
<span class="method-click-advice">click to toggle source</span>
|
186
|
+
|
187
|
+
</div>
|
188
|
+
|
189
|
+
|
190
|
+
<div class="method-description">
|
191
|
+
|
192
|
+
<hr>
|
193
|
+
|
194
|
+
<p>configuration method</p>
|
195
|
+
|
196
|
+
<p>Singleton method to return (or initialize, if needed) a <a
|
197
|
+
href="Configurator.html">Configurator</a>. @return <a
|
198
|
+
href="Configurator.html">Configurator</a></p>
|
199
|
+
<hr>
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
<div class="method-source-code" id="configuration-source">
|
205
|
+
<pre><span class="ruby-comment"># File lib/cliutils/configuration.rb, line 33</span>
|
206
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">configuration</span>
|
207
|
+
<span class="ruby-ivar">@configuration</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Configurator</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">'~/.default-cliutils'</span>)
|
208
|
+
<span class="ruby-keyword">end</span></pre>
|
209
|
+
</div>
|
210
|
+
|
211
|
+
</div>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
</div>
|
217
|
+
|
218
|
+
|
219
|
+
<div id="method-i-load_configuration" class="method-detail ">
|
220
|
+
|
221
|
+
<div class="method-heading">
|
222
|
+
<span class="method-name">load_configuration</span><span
|
223
|
+
class="method-args">(path)</span>
|
224
|
+
|
225
|
+
<span class="method-click-advice">click to toggle source</span>
|
226
|
+
|
227
|
+
</div>
|
228
|
+
|
229
|
+
|
230
|
+
<div class="method-description">
|
231
|
+
|
232
|
+
<hr>
|
233
|
+
|
234
|
+
<p><a
|
235
|
+
href="Configuration.html#method-i-load_configuration">#load_configuration</a>
|
236
|
+
method</p>
|
237
|
+
|
238
|
+
<p>Initializes a <a href="Configurator.html">Configurator</a> with the passed
|
239
|
+
filepath. @param path The path to the config file @return Void</p>
|
240
|
+
<hr>
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
<div class="method-source-code" id="load_configuration-source">
|
246
|
+
<pre><span class="ruby-comment"># File lib/cliutils/configuration.rb, line 44</span>
|
247
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">load_configuration</span>(<span class="ruby-identifier">path</span>)
|
248
|
+
<span class="ruby-ivar">@configuration</span> = <span class="ruby-constant">Configurator</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>)
|
249
|
+
<span class="ruby-keyword">end</span></pre>
|
250
|
+
</div>
|
251
|
+
|
252
|
+
</div>
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
</div>
|
258
|
+
|
259
|
+
|
260
|
+
</section>
|
261
|
+
|
262
|
+
</section>
|
263
|
+
</main>
|
264
|
+
|
265
|
+
|
266
|
+
<footer id="validator-badges" role="contentinfo">
|
267
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
268
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
|
269
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
270
|
+
</footer>
|
271
|
+
|