na 1.0.1 → 1.0.2
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 +4 -4
- data/CHANGELOG.md +21 -0
- data/Gemfile.lock +2 -1
- data/README.md +82 -27
- data/bin/na +24 -5
- data/lib/na/version.rb +1 -1
- data/lib/na.rb +1 -0
- data/na.gemspec +9 -3
- data/na.rdoc +6 -2
- data/scripts/fixreadme.rb +18 -0
- data/src/README.md +276 -0
- metadata +32 -56
- data/html/App.html +0 -105
- data/html/NA/Action.html +0 -299
- data/html/NA/Color.html +0 -373
- data/html/NA.html +0 -100
- data/html/README_rdoc.html +0 -328
- data/html/String.html +0 -368
- data/html/created.rid +0 -9
- data/html/css/fonts.css +0 -167
- data/html/css/rdoc.css +0 -639
- 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/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 +0 -297
- data/html/js/darkfish.js +0 -84
- data/html/js/navigation.js +0 -105
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +0 -110
- data/html/js/search_index.js +0 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +0 -229
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +0 -252
data/html/NA/Color.html
DELETED
@@ -1,373 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>module NA::Color - Your application title</title>
|
8
|
-
|
9
|
-
<script type="text/javascript">
|
10
|
-
var rdoc_rel_prefix = "../";
|
11
|
-
var index_rel_prefix = "../";
|
12
|
-
</script>
|
13
|
-
|
14
|
-
<script src="../js/navigation.js" defer></script>
|
15
|
-
<script src="../js/search.js" defer></script>
|
16
|
-
<script src="../js/search_index.js" defer></script>
|
17
|
-
<script src="../js/searcher.js" defer></script>
|
18
|
-
<script src="../js/darkfish.js" defer></script>
|
19
|
-
|
20
|
-
<link href="../css/fonts.css" rel="stylesheet">
|
21
|
-
<link href="../css/rdoc.css" rel="stylesheet">
|
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
|
-
|
58
|
-
<div id="class-metadata">
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
<!-- Method Quickref -->
|
65
|
-
<div id="method-list-section" class="nav-section">
|
66
|
-
<h3>Methods</h3>
|
67
|
-
|
68
|
-
<ul class="link-list" role="directory">
|
69
|
-
<li ><a href="#method-c-coloring">::coloring</a>
|
70
|
-
<li ><a href="#method-c-coloring-3F">::coloring?</a>
|
71
|
-
<li ><a href="#method-c-template">::template</a>
|
72
|
-
<li ><a href="#method-i-attributes">#attributes</a>
|
73
|
-
<li ><a href="#method-i-rgb">#rgb</a>
|
74
|
-
<li ><a href="#method-i-support-3F">#support?</a>
|
75
|
-
<li ><a href="#method-i-uncolor">#uncolor</a>
|
76
|
-
</ul>
|
77
|
-
</div>
|
78
|
-
|
79
|
-
</div>
|
80
|
-
</nav>
|
81
|
-
|
82
|
-
<main role="main" aria-labelledby="module-NA::Color">
|
83
|
-
<h1 id="module-NA::Color" class="module">
|
84
|
-
module NA::Color
|
85
|
-
</h1>
|
86
|
-
|
87
|
-
<section class="description">
|
88
|
-
|
89
|
-
<p>Terminal output color functions.</p>
|
90
|
-
|
91
|
-
</section>
|
92
|
-
|
93
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
94
|
-
|
95
|
-
|
96
|
-
<section class="constants-list">
|
97
|
-
<header>
|
98
|
-
<h3>Constants</h3>
|
99
|
-
</header>
|
100
|
-
<dl>
|
101
|
-
<dt id="ATTRIBUTES">ATTRIBUTES
|
102
|
-
<dd><p>All available color names. Available as methods and string extensions.</p>
|
103
|
-
|
104
|
-
<p>@example Use a color as a method. <a href="Color.html"><code>Color</code></a> reset will be added to end of string.</p>
|
105
|
-
|
106
|
-
<pre class="ruby"><span class="ruby-constant">Color</span>.<span class="ruby-identifier">yellow</span>(<span class="ruby-string">'This text is yellow'</span>) <span class="ruby-operator">=></span> <span class="ruby-string">"\e[33mThis text is yellow\e[0m"</span>
|
107
|
-
</pre>
|
108
|
-
|
109
|
-
<p>@example Use a color as a string extension. <a href="Color.html"><code>Color</code></a> reset added automatically.</p>
|
110
|
-
|
111
|
-
<pre class="ruby"><span class="ruby-string">'This text is green'</span>.<span class="ruby-identifier">green</span> <span class="ruby-operator">=></span> <span class="ruby-string">"\e[1;32mThis text is green\e[0m"</span>
|
112
|
-
</pre>
|
113
|
-
|
114
|
-
<p>@example Send a text string as a color</p>
|
115
|
-
|
116
|
-
<pre class="ruby"><span class="ruby-constant">Color</span>.<span class="ruby-identifier">send</span>(<span class="ruby-string">'red'</span>) <span class="ruby-operator">=></span> <span class="ruby-string">"\e[31m"</span>
|
117
|
-
</pre>
|
118
|
-
<dt id="ATTRIBUTE_NAMES">ATTRIBUTE_NAMES
|
119
|
-
<dd><p>Array of attribute keys only</p>
|
120
|
-
<dt id="COLORED_REGEXP">COLORED_REGEXP
|
121
|
-
<dd><p>Regular expression that is used to scan for ANSI-sequences while uncoloring strings.</p>
|
122
|
-
<dt id="ESCAPE_REGEX">ESCAPE_REGEX
|
123
|
-
<dd><p>Regexp to match excape sequences</p>
|
124
|
-
</dl>
|
125
|
-
</section>
|
126
|
-
|
127
|
-
<section class="attribute-method-details" class="method-section">
|
128
|
-
<header>
|
129
|
-
<h3>Attributes</h3>
|
130
|
-
</header>
|
131
|
-
|
132
|
-
<div id="attribute-c-coloring" class="method-detail">
|
133
|
-
<div class="method-heading attribute-method-heading">
|
134
|
-
<span class="method-name">coloring</span><span
|
135
|
-
class="attribute-access-type">[W]</span>
|
136
|
-
</div>
|
137
|
-
|
138
|
-
<div class="method-description">
|
139
|
-
|
140
|
-
</div>
|
141
|
-
</div>
|
142
|
-
</section>
|
143
|
-
|
144
|
-
|
145
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
146
|
-
<header>
|
147
|
-
<h3>Public Class Methods</h3>
|
148
|
-
</header>
|
149
|
-
|
150
|
-
<div id="method-c-coloring" class="method-detail ">
|
151
|
-
<div class="method-heading">
|
152
|
-
<span class="method-name">coloring</span><span
|
153
|
-
class="method-args">()</span>
|
154
|
-
<span class="method-click-advice">click to toggle source</span>
|
155
|
-
</div>
|
156
|
-
|
157
|
-
<div class="method-description">
|
158
|
-
<p>Enables colored output</p>
|
159
|
-
|
160
|
-
<p>@example Turn color on or off based on TTY</p>
|
161
|
-
|
162
|
-
<pre class="ruby"><span class="ruby-constant">NA</span><span class="ruby-operator">::</span><span class="ruby-constant">Color</span>.<span class="ruby-identifier">coloring</span> = <span class="ruby-constant">STDOUT</span>.<span class="ruby-identifier">isatty</span>
|
163
|
-
</pre>
|
164
|
-
|
165
|
-
<div class="method-source-code" id="coloring-source">
|
166
|
-
<pre><span class="ruby-comment"># File lib/na/colors.rb, line 204</span>
|
167
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">coloring</span>
|
168
|
-
<span class="ruby-ivar">@coloring</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">true</span>
|
169
|
-
<span class="ruby-keyword">end</span></pre>
|
170
|
-
</div>
|
171
|
-
</div>
|
172
|
-
|
173
|
-
|
174
|
-
</div>
|
175
|
-
|
176
|
-
<div id="method-c-coloring-3F" class="method-detail ">
|
177
|
-
<div class="method-heading">
|
178
|
-
<span class="method-name">coloring?</span><span
|
179
|
-
class="method-args">()</span>
|
180
|
-
<span class="method-click-advice">click to toggle source</span>
|
181
|
-
</div>
|
182
|
-
|
183
|
-
<div class="method-description">
|
184
|
-
<p>Returns true if the coloring function of this module is switched on, false otherwise.</p>
|
185
|
-
|
186
|
-
<div class="method-source-code" id="coloring-3F-source">
|
187
|
-
<pre><span class="ruby-comment"># File lib/na/colors.rb, line 193</span>
|
188
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">coloring?</span>
|
189
|
-
<span class="ruby-ivar">@coloring</span>
|
190
|
-
<span class="ruby-keyword">end</span></pre>
|
191
|
-
</div>
|
192
|
-
</div>
|
193
|
-
|
194
|
-
|
195
|
-
</div>
|
196
|
-
|
197
|
-
<div id="method-c-template" class="method-detail ">
|
198
|
-
<div class="method-heading">
|
199
|
-
<span class="method-name">template</span><span
|
200
|
-
class="method-args">(input)</span>
|
201
|
-
<span class="method-click-advice">click to toggle source</span>
|
202
|
-
</div>
|
203
|
-
|
204
|
-
<div class="method-description">
|
205
|
-
<p>Convert a template string to a colored string. Colors are specified with single letters inside curly braces. Uppercase changes background color.</p>
|
206
|
-
|
207
|
-
<p>w: white, k: black, g: green, l: blue, y: yellow, c: cyan, m: magenta, r: red, b: bold, u: underline, i: italic, x: reset (remove background, color, emphasis)</p>
|
208
|
-
|
209
|
-
<p>@example Convert a templated string</p>
|
210
|
-
|
211
|
-
<pre class="ruby"><span class="ruby-constant">Color</span>.<span class="ruby-identifier">template</span>(<span class="ruby-string">'{Rwb}Warning:{x} {w}you look a little {g}ill{x}'</span>)
|
212
|
-
</pre>
|
213
|
-
|
214
|
-
<p>@param input [String, Array] The template</p>
|
215
|
-
|
216
|
-
<pre>string. If this is an array, the
|
217
|
-
elements will be joined with a
|
218
|
-
space.</pre>
|
219
|
-
|
220
|
-
<p>@return [String] Colorized string</p>
|
221
|
-
|
222
|
-
<div class="method-source-code" id="template-source">
|
223
|
-
<pre><span class="ruby-comment"># File lib/na/colors.rb, line 227</span>
|
224
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">template</span>(<span class="ruby-identifier">input</span>)
|
225
|
-
<span class="ruby-identifier">input</span> = <span class="ruby-identifier">input</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">' '</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">input</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Array</span>
|
226
|
-
<span class="ruby-identifier">fmt</span> = <span class="ruby-identifier">input</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/%/</span>, <span class="ruby-string">'%%'</span>)
|
227
|
-
<span class="ruby-identifier">fmt</span> = <span class="ruby-identifier">fmt</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/(?<!\\u)\{(\w+)\}/i</span>) <span class="ruby-keyword">do</span>
|
228
|
-
<span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>(<span class="ruby-value">1</span>).<span class="ruby-identifier">split</span>(<span class="ruby-string">''</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-node">"%<#{c}>s"</span> }.<span class="ruby-identifier">join</span>(<span class="ruby-string">''</span>)
|
229
|
-
<span class="ruby-keyword">end</span>
|
230
|
-
|
231
|
-
<span class="ruby-identifier">colors</span> = { <span class="ruby-value">w:</span> <span class="ruby-identifier">white</span>, <span class="ruby-value">k:</span> <span class="ruby-identifier">black</span>, <span class="ruby-value">g:</span> <span class="ruby-identifier">green</span>, <span class="ruby-value">l:</span> <span class="ruby-identifier">blue</span>,
|
232
|
-
<span class="ruby-value">y:</span> <span class="ruby-identifier">yellow</span>, <span class="ruby-value">c:</span> <span class="ruby-identifier">cyan</span>, <span class="ruby-value">m:</span> <span class="ruby-identifier">magenta</span>, <span class="ruby-value">r:</span> <span class="ruby-identifier">red</span>,
|
233
|
-
<span class="ruby-value">W:</span> <span class="ruby-identifier">bgwhite</span>, <span class="ruby-value">K:</span> <span class="ruby-identifier">bgblack</span>, <span class="ruby-value">G:</span> <span class="ruby-identifier">bggreen</span>, <span class="ruby-value">L:</span> <span class="ruby-identifier">bgblue</span>,
|
234
|
-
<span class="ruby-value">Y:</span> <span class="ruby-identifier">bgyellow</span>, <span class="ruby-value">C:</span> <span class="ruby-identifier">bgcyan</span>, <span class="ruby-value">M:</span> <span class="ruby-identifier">bgmagenta</span>, <span class="ruby-value">R:</span> <span class="ruby-identifier">bgred</span>,
|
235
|
-
<span class="ruby-value">d:</span> <span class="ruby-identifier">dark</span>, <span class="ruby-value">b:</span> <span class="ruby-identifier">bold</span>, <span class="ruby-value">u:</span> <span class="ruby-identifier">underline</span>, <span class="ruby-value">i:</span> <span class="ruby-identifier">italic</span>, <span class="ruby-value">x:</span> <span class="ruby-identifier">reset</span> }
|
236
|
-
|
237
|
-
<span class="ruby-identifier">format</span>(<span class="ruby-identifier">fmt</span>, <span class="ruby-identifier">colors</span>)
|
238
|
-
<span class="ruby-keyword">end</span></pre>
|
239
|
-
</div>
|
240
|
-
</div>
|
241
|
-
|
242
|
-
|
243
|
-
</div>
|
244
|
-
|
245
|
-
</section>
|
246
|
-
|
247
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
248
|
-
<header>
|
249
|
-
<h3>Public Instance Methods</h3>
|
250
|
-
</header>
|
251
|
-
|
252
|
-
<div id="method-i-attributes" class="method-detail ">
|
253
|
-
<div class="method-heading">
|
254
|
-
<span class="method-name">attributes</span><span
|
255
|
-
class="method-args">()</span>
|
256
|
-
<span class="method-click-advice">click to toggle source</span>
|
257
|
-
</div>
|
258
|
-
|
259
|
-
<div class="method-description">
|
260
|
-
<p>Returns an array of all <a href="Color.html"><code>NA::Color</code></a> attributes as symbols.</p>
|
261
|
-
|
262
|
-
<div class="method-source-code" id="attributes-source">
|
263
|
-
<pre><span class="ruby-comment"># File lib/na/colors.rb, line 330</span>
|
264
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">attributes</span>
|
265
|
-
<span class="ruby-constant">ATTRIBUTE_NAMES</span>
|
266
|
-
<span class="ruby-keyword">end</span></pre>
|
267
|
-
</div>
|
268
|
-
</div>
|
269
|
-
|
270
|
-
|
271
|
-
</div>
|
272
|
-
|
273
|
-
<div id="method-i-rgb" class="method-detail ">
|
274
|
-
<div class="method-heading">
|
275
|
-
<span class="method-name">rgb</span><span
|
276
|
-
class="method-args">(hex)</span>
|
277
|
-
<span class="method-click-advice">click to toggle source</span>
|
278
|
-
</div>
|
279
|
-
|
280
|
-
<div class="method-description">
|
281
|
-
<p>Generate escape codes for hex colors</p>
|
282
|
-
|
283
|
-
<p>@param hex [String] The hexadecimal color code</p>
|
284
|
-
|
285
|
-
<p>@return [String] ANSI escape string</p>
|
286
|
-
|
287
|
-
<div class="method-source-code" id="rgb-source">
|
288
|
-
<pre><span class="ruby-comment"># File lib/na/colors.rb, line 298</span>
|
289
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">rgb</span>(<span class="ruby-identifier">hex</span>)
|
290
|
-
<span class="ruby-identifier">is_bg</span> = <span class="ruby-identifier">hex</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/^bg?#/</span>) <span class="ruby-operator">?</span> <span class="ruby-keyword">true</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">false</span>
|
291
|
-
<span class="ruby-identifier">hex_string</span> = <span class="ruby-identifier">hex</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/^([fb]g?)?#/</span>, <span class="ruby-string">''</span>)
|
292
|
-
|
293
|
-
<span class="ruby-identifier">parts</span> = <span class="ruby-identifier">hex_string</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/(?<r>..)(?<g>..)(?<b>..)/</span>)
|
294
|
-
<span class="ruby-identifier">t</span> = []
|
295
|
-
<span class="ruby-node">%w[r g b]</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>
|
296
|
-
<span class="ruby-identifier">t</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">parts</span>[<span class="ruby-identifier">e</span>].<span class="ruby-identifier">hex</span>
|
297
|
-
<span class="ruby-keyword">end</span>
|
298
|
-
<span class="ruby-identifier">color</span> =
|
299
|
-
<span class="ruby-node">"\e[#{is_bg ? '48' : '38'};2;#{t.join(';')}m"</span>
|
300
|
-
<span class="ruby-keyword">end</span></pre>
|
301
|
-
</div>
|
302
|
-
</div>
|
303
|
-
|
304
|
-
|
305
|
-
</div>
|
306
|
-
|
307
|
-
<div id="method-i-support-3F" class="method-detail ">
|
308
|
-
<div class="method-heading">
|
309
|
-
<span class="method-name">support?</span><span
|
310
|
-
class="method-args">(feature)</span>
|
311
|
-
<span class="method-click-advice">click to toggle source</span>
|
312
|
-
</div>
|
313
|
-
|
314
|
-
<div class="method-description">
|
315
|
-
<p>Returns true if <a href="Color.html"><code>NA::Color</code></a> supports the <code>feature</code>.</p>
|
316
|
-
|
317
|
-
<p>The feature :clear, that is mixing the clear color attribute into <a href="../String.html"><code>String</code></a>, is only supported on ruby implementations, that do <strong>not</strong> already implement the String#clear method. It's better to use the reset color attribute instead.</p>
|
318
|
-
|
319
|
-
<div class="method-source-code" id="support-3F-source">
|
320
|
-
<pre><span class="ruby-comment"># File lib/na/colors.rb, line 93</span>
|
321
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">support?</span>(<span class="ruby-identifier">feature</span>)
|
322
|
-
<span class="ruby-keyword">case</span> <span class="ruby-identifier">feature</span>
|
323
|
-
<span class="ruby-keyword">when</span> <span class="ruby-value">:clear</span>
|
324
|
-
<span class="ruby-operator">!</span><span class="ruby-constant">String</span>.<span class="ruby-identifier">instance_methods</span>(<span class="ruby-keyword">false</span>).<span class="ruby-identifier">map</span>(<span class="ruby-operator">&</span><span class="ruby-value">:to_sym</span>).<span class="ruby-identifier">include?</span>(<span class="ruby-value">:clear</span>)
|
325
|
-
<span class="ruby-keyword">end</span>
|
326
|
-
<span class="ruby-keyword">end</span></pre>
|
327
|
-
</div>
|
328
|
-
</div>
|
329
|
-
|
330
|
-
|
331
|
-
</div>
|
332
|
-
|
333
|
-
<div id="method-i-uncolor" class="method-detail ">
|
334
|
-
<div class="method-heading">
|
335
|
-
<span class="method-name">uncolor</span><span
|
336
|
-
class="method-args">(string = nil) { || ... }</span>
|
337
|
-
<span class="method-click-advice">click to toggle source</span>
|
338
|
-
</div>
|
339
|
-
|
340
|
-
<div class="method-description">
|
341
|
-
<p>Returns an uncolored version of the string, that is all ANSI-sequences are stripped from the string.</p>
|
342
|
-
|
343
|
-
<div class="method-source-code" id="uncolor-source">
|
344
|
-
<pre><span class="ruby-comment"># File lib/na/colors.rb, line 317</span>
|
345
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">uncolor</span>(<span class="ruby-identifier">string</span> = <span class="ruby-keyword">nil</span>) <span class="ruby-comment"># :yields:</span>
|
346
|
-
<span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
|
347
|
-
<span class="ruby-keyword">yield</span>.<span class="ruby-identifier">to_str</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-constant">COLORED_REGEXP</span>, <span class="ruby-string">''</span>)
|
348
|
-
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">string</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:to_str</span>)
|
349
|
-
<span class="ruby-identifier">string</span>.<span class="ruby-identifier">to_str</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-constant">COLORED_REGEXP</span>, <span class="ruby-string">''</span>)
|
350
|
-
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:to_str</span>)
|
351
|
-
<span class="ruby-identifier">to_str</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-constant">COLORED_REGEXP</span>, <span class="ruby-string">''</span>)
|
352
|
-
<span class="ruby-keyword">else</span>
|
353
|
-
<span class="ruby-string">''</span>
|
354
|
-
<span class="ruby-keyword">end</span>
|
355
|
-
<span class="ruby-keyword">end</span></pre>
|
356
|
-
</div>
|
357
|
-
</div>
|
358
|
-
|
359
|
-
|
360
|
-
</div>
|
361
|
-
|
362
|
-
</section>
|
363
|
-
|
364
|
-
</section>
|
365
|
-
</main>
|
366
|
-
|
367
|
-
|
368
|
-
<footer id="validator-badges" role="contentinfo">
|
369
|
-
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
370
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
371
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
372
|
-
</footer>
|
373
|
-
|
data/html/NA.html
DELETED
@@ -1,100 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>module Na - Your application title</title>
|
8
|
-
|
9
|
-
<script type="text/javascript">
|
10
|
-
var rdoc_rel_prefix = "./";
|
11
|
-
var index_rel_prefix = "./";
|
12
|
-
</script>
|
13
|
-
|
14
|
-
<script src="./js/navigation.js" defer></script>
|
15
|
-
<script src="./js/search.js" defer></script>
|
16
|
-
<script src="./js/search_index.js" defer></script>
|
17
|
-
<script src="./js/searcher.js" defer></script>
|
18
|
-
<script src="./js/darkfish.js" defer></script>
|
19
|
-
|
20
|
-
<link href="./css/fonts.css" rel="stylesheet">
|
21
|
-
<link href="./css/rdoc.css" rel="stylesheet">
|
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
|
-
|
58
|
-
<div id="class-metadata">
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
</div>
|
65
|
-
</nav>
|
66
|
-
|
67
|
-
<main role="main" aria-labelledby="module-Na">
|
68
|
-
<h1 id="module-Na" class="module">
|
69
|
-
module Na
|
70
|
-
</h1>
|
71
|
-
|
72
|
-
<section class="description">
|
73
|
-
|
74
|
-
</section>
|
75
|
-
|
76
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
77
|
-
|
78
|
-
|
79
|
-
<section class="constants-list">
|
80
|
-
<header>
|
81
|
-
<h3>Constants</h3>
|
82
|
-
</header>
|
83
|
-
<dl>
|
84
|
-
<dt id="VERSION">VERSION
|
85
|
-
<dd>
|
86
|
-
</dl>
|
87
|
-
</section>
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
</section>
|
92
|
-
</main>
|
93
|
-
|
94
|
-
|
95
|
-
<footer id="validator-badges" role="contentinfo">
|
96
|
-
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
97
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
98
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
99
|
-
</footer>
|
100
|
-
|