facets 2.5.0 → 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +1 -1
- data/CHANGES +28 -45
- data/MANIFEST +35 -4
- data/README +3 -14
- data/RELEASE +36 -70
- data/VERSION +1 -1
- data/doc/archive/RELEASE-2.5.0 +83 -0
- data/doc/log/basic_stats/index.html +4 -4
- data/doc/log/changelog.html +509 -2
- data/doc/log/changelog.txt +130 -1522
- data/doc/rdoc/core/classes/Array.html +366 -141
- data/doc/rdoc/core/classes/Binding.html +45 -45
- data/doc/rdoc/core/classes/Class.html +38 -38
- data/doc/rdoc/core/classes/Comparable.html +26 -26
- data/doc/rdoc/core/classes/Enumerable.html +174 -170
- data/doc/rdoc/core/classes/Enumerable/Enumerator.html +130 -0
- data/doc/rdoc/core/classes/Enumerator.html +132 -0
- data/doc/rdoc/core/classes/Exception.html +8 -8
- data/doc/rdoc/core/classes/File.html +58 -58
- data/doc/rdoc/core/classes/FileTest.html +4 -4
- data/doc/rdoc/core/classes/Float.html +8 -8
- data/doc/rdoc/core/classes/Functor.html +12 -12
- data/doc/rdoc/core/classes/Hash.html +447 -263
- data/doc/rdoc/core/classes/Indexable.html +110 -110
- data/doc/rdoc/core/classes/Integer.html +2 -2
- data/doc/rdoc/core/classes/Kernel.html +329 -329
- data/doc/rdoc/core/classes/Lazy/Promise.html +1 -1
- data/doc/rdoc/core/classes/MatchData.html +15 -15
- data/doc/rdoc/core/classes/Module.html +176 -157
- data/doc/rdoc/core/classes/NilClass.html +23 -23
- data/doc/rdoc/core/classes/Numeric.html +27 -27
- data/doc/rdoc/core/classes/Object.html +8 -8
- data/doc/rdoc/core/classes/ObjectSpace.html +5 -5
- data/doc/rdoc/core/classes/Proc.html +22 -22
- data/doc/rdoc/core/classes/Regexp.html +1 -1
- data/doc/rdoc/core/classes/Stackable.html +31 -31
- data/doc/rdoc/core/classes/String.html +332 -291
- data/doc/rdoc/core/classes/Symbol.html +1 -1
- data/doc/rdoc/core/classes/TrueClass.html +8 -8
- data/doc/rdoc/core/classes/UnboundMethod.html +18 -13
- data/doc/rdoc/core/created.rid +1 -1
- data/doc/rdoc/core/files/README.html +7 -29
- data/doc/rdoc/core/files/lib/core/facets/array/product_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/collect_rb.html +10 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/compact_map_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/enumerable/map_with_index_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/enumerable/split_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/collate_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/group_by_value_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/hash/new_with_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/module/conflict_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/extend_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/string/align_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/file_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/string/xor_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/to_hash_rb.html +5 -1
- data/doc/rdoc/core/files/lib/core/facets/unboundmethod/name_rb.html +1 -1
- data/doc/rdoc/core/fr_class_index.html +2 -0
- data/doc/rdoc/core/fr_file_index.html +6 -0
- data/doc/rdoc/core/fr_method_index.html +386 -373
- data/doc/rdoc/lore/classes/OpenStruct.html +6 -4
- data/doc/rdoc/lore/created.rid +1 -1
- data/doc/rdoc/lore/files/README.html +7 -29
- data/doc/rdoc/lore/files/lib/lore/facets/ostruct_rb.html +1 -1
- data/doc/rdoc/more/classes/ANSICode.html +66 -66
- data/doc/rdoc/more/classes/Advisable.html +37 -37
- data/doc/rdoc/more/classes/Advisable/Method.html +20 -20
- data/doc/rdoc/more/classes/Archive/Tar/Minitar.html +27 -27
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Input.html +28 -28
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Output.html +19 -19
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Reader.html +31 -31
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Writer.html +33 -33
- data/doc/rdoc/more/classes/Association.html +67 -53
- data/doc/rdoc/more/classes/Association/Kernel.html +11 -12
- data/doc/rdoc/more/classes/BBCode.html +36 -36
- data/doc/rdoc/more/classes/BaseX.html +16 -16
- data/doc/rdoc/more/classes/BiCrypt.html +67 -67
- data/doc/rdoc/more/classes/BinReadable.html +85 -85
- data/doc/rdoc/more/classes/BinReadable/ByteOrder.html +25 -25
- data/doc/rdoc/more/classes/Binding.html +8 -8
- data/doc/rdoc/more/classes/Buildable.html +4 -4
- data/doc/rdoc/more/classes/Cloneable.html +4 -4
- data/doc/rdoc/more/classes/ConsoleUtils.html +18 -18
- data/doc/rdoc/more/classes/Crypt.html +16 -16
- data/doc/rdoc/more/classes/CssTree.html +8 -8
- data/doc/rdoc/more/classes/Dictionary.html +52 -45
- data/doc/rdoc/more/classes/Enumerable.html +50 -50
- data/doc/rdoc/more/classes/Enumerable/Elementor.html +16 -16
- data/doc/rdoc/more/classes/Enumerable/Enumerator.html +4 -4
- data/doc/rdoc/more/classes/Enumerable/Filterable.html +30 -30
- data/doc/rdoc/more/classes/EnumerablePass.html +15 -15
- data/doc/rdoc/more/classes/Equatable.html +16 -16
- data/doc/rdoc/more/classes/Expirable.html +17 -17
- data/doc/rdoc/more/classes/Fileable.html +14 -14
- data/doc/rdoc/more/classes/Fileable/DSL.html +41 -41
- data/doc/rdoc/more/classes/Hash2Xml.html +4 -4
- data/doc/rdoc/more/classes/Hook.html +162 -0
- data/doc/rdoc/more/classes/HtmlFilter.html +9 -9
- data/doc/rdoc/more/classes/Instantiable.html +9 -9
- data/doc/rdoc/more/classes/Instantize.html +8 -8
- data/doc/rdoc/more/classes/Interval.html +187 -187
- data/doc/rdoc/more/classes/It.html +12 -12
- data/doc/rdoc/more/classes/Matcher.html +38 -38
- data/doc/rdoc/more/classes/Matcher/MatchData.html +4 -4
- data/doc/rdoc/more/classes/Memoizer.html +21 -21
- data/doc/rdoc/more/classes/Multiton.html +12 -12
- data/doc/rdoc/more/classes/Multiton/MetaMethods.html +28 -28
- data/doc/rdoc/more/classes/Net/SMTP.html +8 -8
- data/doc/rdoc/more/classes/OpEsc.html +5 -5
- data/doc/rdoc/more/classes/OpenCascade.html +4 -4
- data/doc/rdoc/more/classes/OpenHash.html +9 -9
- data/doc/rdoc/more/classes/OpenStructable.html +36 -36
- data/doc/rdoc/more/classes/PQueue.html +84 -84
- data/doc/rdoc/more/classes/Paramix.html +16 -16
- data/doc/rdoc/more/classes/Paramix/Delegator.html +16 -16
- data/doc/rdoc/more/classes/RWDelegator.html +16 -16
- data/doc/rdoc/more/classes/Random.html +5 -5
- data/doc/rdoc/more/classes/Random/Array.html +37 -37
- data/doc/rdoc/more/classes/Random/Hash.html +52 -52
- data/doc/rdoc/more/classes/Random/Object.html +4 -4
- data/doc/rdoc/more/classes/Random/String.html +34 -34
- data/doc/rdoc/more/classes/Random/String/Self.html +9 -9
- data/doc/rdoc/more/classes/Registerable.html +13 -13
- data/doc/rdoc/more/classes/Stash.html +28 -28
- data/doc/rdoc/more/classes/String/Mask.html +72 -72
- data/doc/rdoc/more/classes/String/Words.html +31 -31
- data/doc/rdoc/more/classes/System.html +253 -253
- data/doc/rdoc/more/classes/Timer.html +48 -48
- data/doc/rdoc/more/classes/Timer/Dummy.html +9 -9
- data/doc/rdoc/more/classes/Tuple.html +170 -170
- data/doc/rdoc/more/classes/TypeCast/Class.html +4 -4
- data/doc/rdoc/more/classes/TypeCast/Object.html +4 -4
- data/doc/rdoc/more/classes/Uninheritable.html +6 -6
- data/doc/rdoc/more/classes/X.html +117 -0
- data/doc/rdoc/more/classes/XOXO.html +11 -11
- data/doc/rdoc/more/classes/ZipUtils.html +88 -88
- data/doc/rdoc/more/classes/ZipUtils/DryRun.html +68 -68
- data/doc/rdoc/more/classes/ZipUtils/NoWrite.html +68 -68
- data/doc/rdoc/more/classes/ZipUtils/Verbose.html +60 -60
- data/doc/rdoc/more/created.rid +1 -1
- data/doc/rdoc/more/files/README.html +7 -29
- data/doc/rdoc/more/files/lib/more/facets/association_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/dictionary_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/hook_rb.html +96 -0
- data/doc/rdoc/more/files/lib/more/facets/paramix_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/xoxo_rb.html +2 -2
- data/doc/rdoc/more/fr_class_index.html +2 -0
- data/doc/rdoc/more/fr_file_index.html +1 -0
- data/doc/rdoc/more/fr_method_index.html +686 -681
- data/lib/core/facets/array/product.rb +6 -23
- data/lib/core/facets/enumerable/collect.rb +3 -53
- data/lib/core/facets/enumerable/compact_map.rb +35 -0
- data/lib/core/facets/enumerable/map_with_index.rb +23 -0
- data/lib/core/facets/enumerable/split.rb +3 -3
- data/lib/core/facets/hash/collate.rb +45 -14
- data/lib/core/facets/hash/group_by_value.rb +65 -0
- data/lib/core/facets/hash/new_with.rb +15 -0
- data/lib/core/facets/module/extend.rb +11 -0
- data/lib/core/facets/string/align.rb +19 -18
- data/lib/core/facets/string/file.rb +17 -0
- data/lib/core/facets/string/xor.rb +9 -3
- data/lib/core/facets/to_hash.rb +274 -17
- data/lib/core/facets/unboundmethod/name.rb +4 -2
- data/lib/lore/facets/ostruct.rb +3 -0
- data/lib/more/facets/association.rb +28 -12
- data/lib/more/facets/dictionary.rb +10 -4
- data/lib/more/facets/hook.rb +65 -0
- data/lib/more/facets/paramix.rb +5 -5
- data/meta/abstract +13 -0
- data/meta/authors +1 -0
- data/meta/contact +1 -0
- data/meta/contributors +48 -0
- data/meta/created +1 -0
- data/meta/homepage +1 -0
- data/meta/license +1 -0
- data/meta/loadpath +3 -0
- data/meta/releases +14 -0
- data/meta/slogan +1 -0
- data/meta/summary +1 -0
- data/task/test.rake +116 -18
- data/test/core/array/test_product.rb +0 -6
- data/test/core/binding/test_local_variables.rb +9 -3
- data/test/core/enumerable/test_split.rb +19 -0
- data/test/core/module/test_conflict.rb +8 -3
- data/test/core/test_to_hash.rb +152 -0
- data/test/core/unboundmethod/test_arguments.rb +1 -1
- data/test/core/unboundmethod/test_name.rb +2 -2
- metadata +39 -8
- data/doc/log/bstats/stats.html +0 -39
- data/doc/log/stats.html +0 -25
- data/test/more/test_to_hash.rb +0 -58
@@ -133,7 +133,7 @@ CREDIT: Trans
|
|
133
133
|
Simply returns itself. Helpful when converting strings to regular
|
134
134
|
expressions, where regexp might occur as well —in the same vien as
|
135
135
|
using to_s on symbols. The parameter is actaully a dummy parameter to
|
136
|
-
coincide with <a href="String.html#
|
136
|
+
coincide with <a href="String.html#M000267">String#to_re</a>.
|
137
137
|
</p>
|
138
138
|
<pre>
|
139
139
|
/abc/.to_re #=> /abc/
|
@@ -72,9 +72,9 @@
|
|
72
72
|
<div class="description"><h1><a href="Stackable.html">Stackable</a></h1>
|
73
73
|
<p>
|
74
74
|
<a href="Stackable.html">Stackable</a> mixin provides <a
|
75
|
-
href="Stackable.html#
|
76
|
-
href="Stackable.html#
|
77
|
-
href="Stackable.html#
|
75
|
+
href="Stackable.html#M000347">pop</a>, <a
|
76
|
+
href="Stackable.html#M000348">push</a>, <a
|
77
|
+
href="Stackable.html#M000349">pull</a>, etc. It depends on slice, splice
|
78
78
|
and insert.
|
79
79
|
</p>
|
80
80
|
</div>
|
@@ -82,13 +82,13 @@ and insert.
|
|
82
82
|
|
83
83
|
|
84
84
|
<div class="sectiontitle">Methods</div>
|
85
|
-
<span style="padding-right: 5px;"><a href="#
|
86
|
-
<span style="padding-right: 5px;"><a href="#
|
87
|
-
<span style="padding-right: 5px;"><a href="#
|
88
|
-
<span style="padding-right: 5px;"><a href="#
|
89
|
-
<span style="padding-right: 5px;"><a href="#
|
90
|
-
<span style="padding-right: 5px;"><a href="#
|
91
|
-
<span style="padding-right: 5px;"><a href="#
|
85
|
+
<span style="padding-right: 5px;"><a href="#M000353">peek</a></span>
|
86
|
+
<span style="padding-right: 5px;"><a href="#M000351">poke</a></span>
|
87
|
+
<span style="padding-right: 5px;"><a href="#M000347">pop</a></span>
|
88
|
+
<span style="padding-right: 5px;"><a href="#M000349">pull</a></span>
|
89
|
+
<span style="padding-right: 5px;"><a href="#M000348">push</a></span>
|
90
|
+
<span style="padding-right: 5px;"><a href="#M000350">shift</a></span>
|
91
|
+
<span style="padding-right: 5px;"><a href="#M000352">unshift</a></span>
|
92
92
|
|
93
93
|
|
94
94
|
|
@@ -98,7 +98,7 @@ and insert.
|
|
98
98
|
<div class="sectiontitle">Public Instance methods</div>
|
99
99
|
<div class="method">
|
100
100
|
<div class="title">
|
101
|
-
<a name="
|
101
|
+
<a name="M000353"></a><b>peek</b>()
|
102
102
|
</div>
|
103
103
|
<div class="description">
|
104
104
|
<p>
|
@@ -111,8 +111,8 @@ Peek at the top of the stack.
|
|
111
111
|
</pre>
|
112
112
|
</div>
|
113
113
|
<div class="sourcecode">
|
114
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
115
|
-
<div id="
|
114
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000353_source')" id="l_M000353_source">+</a> ]</p>
|
115
|
+
<div id="M000353_source" class="dyn-source">
|
116
116
|
<pre>
|
117
117
|
<span class="ruby-comment cmt"># File lib/core/facets/stackable.rb, line 81</span>
|
118
118
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">peek</span>
|
@@ -124,7 +124,7 @@ Peek at the top of the stack.
|
|
124
124
|
</div>
|
125
125
|
<div class="method">
|
126
126
|
<div class="title">
|
127
|
-
<a name="
|
127
|
+
<a name="M000351"></a><b>poke</b>(x)
|
128
128
|
</div>
|
129
129
|
<div class="description">
|
130
130
|
<p>
|
@@ -139,11 +139,11 @@ Poke item onto the stack.
|
|
139
139
|
</div>
|
140
140
|
<div class="aka">
|
141
141
|
This method is also aliased as
|
142
|
-
<a href="Stackable.html#
|
142
|
+
<a href="Stackable.html#M000352">unshift</a>
|
143
143
|
</div>
|
144
144
|
<div class="sourcecode">
|
145
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
146
|
-
<div id="
|
145
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000351_source')" id="l_M000351_source">+</a> ]</p>
|
146
|
+
<div id="M000351_source" class="dyn-source">
|
147
147
|
<pre>
|
148
148
|
<span class="ruby-comment cmt"># File lib/core/facets/stackable.rb, line 69</span>
|
149
149
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">poke</span>(<span class="ruby-identifier">x</span>)
|
@@ -155,7 +155,7 @@ Poke item onto the stack.
|
|
155
155
|
</div>
|
156
156
|
<div class="method">
|
157
157
|
<div class="title">
|
158
|
-
<a name="
|
158
|
+
<a name="M000347"></a><b>pop</b>()
|
159
159
|
</div>
|
160
160
|
<div class="description">
|
161
161
|
<p>
|
@@ -168,8 +168,8 @@ Pop item off stack.
|
|
168
168
|
</pre>
|
169
169
|
</div>
|
170
170
|
<div class="sourcecode">
|
171
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
172
|
-
<div id="
|
171
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000347_source')" id="l_M000347_source">+</a> ]</p>
|
172
|
+
<div id="M000347_source" class="dyn-source">
|
173
173
|
<pre>
|
174
174
|
<span class="ruby-comment cmt"># File lib/core/facets/stackable.rb, line 37</span>
|
175
175
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pop</span>
|
@@ -181,7 +181,7 @@ Pop item off stack.
|
|
181
181
|
</div>
|
182
182
|
<div class="method">
|
183
183
|
<div class="title">
|
184
|
-
<a name="
|
184
|
+
<a name="M000349"></a><b>pull</b>()
|
185
185
|
</div>
|
186
186
|
<div class="description">
|
187
187
|
<p>
|
@@ -195,11 +195,11 @@ Pull item off the stack.
|
|
195
195
|
</div>
|
196
196
|
<div class="aka">
|
197
197
|
This method is also aliased as
|
198
|
-
<a href="Stackable.html#
|
198
|
+
<a href="Stackable.html#M000350">shift</a>
|
199
199
|
</div>
|
200
200
|
<div class="sourcecode">
|
201
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
202
|
-
<div id="
|
201
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000349_source')" id="l_M000349_source">+</a> ]</p>
|
202
|
+
<div id="M000349_source" class="dyn-source">
|
203
203
|
<pre>
|
204
204
|
<span class="ruby-comment cmt"># File lib/core/facets/stackable.rb, line 56</span>
|
205
205
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pull</span>
|
@@ -211,7 +211,7 @@ Pull item off the stack.
|
|
211
211
|
</div>
|
212
212
|
<div class="method">
|
213
213
|
<div class="title">
|
214
|
-
<a name="
|
214
|
+
<a name="M000348"></a><b>push</b>(x)
|
215
215
|
</div>
|
216
216
|
<div class="description">
|
217
217
|
<p>
|
@@ -223,8 +223,8 @@ Push item onto the stack.
|
|
223
223
|
</pre>
|
224
224
|
</div>
|
225
225
|
<div class="sourcecode">
|
226
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
227
|
-
<div id="
|
226
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000348_source')" id="l_M000348_source">+</a> ]</p>
|
227
|
+
<div id="M000348_source" class="dyn-source">
|
228
228
|
<pre>
|
229
229
|
<span class="ruby-comment cmt"># File lib/core/facets/stackable.rb, line 46</span>
|
230
230
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">push</span>(<span class="ruby-identifier">x</span>)
|
@@ -236,21 +236,21 @@ Push item onto the stack.
|
|
236
236
|
</div>
|
237
237
|
<div class="method">
|
238
238
|
<div class="title">
|
239
|
-
<a name="
|
239
|
+
<a name="M000350"></a><b>shift</b>()
|
240
240
|
</div>
|
241
241
|
<div class="description">
|
242
242
|
<p>
|
243
|
-
Alias for <a href="Stackable.html#
|
243
|
+
Alias for <a href="Stackable.html#M000349">pull</a>
|
244
244
|
</p>
|
245
245
|
</div>
|
246
246
|
</div>
|
247
247
|
<div class="method">
|
248
248
|
<div class="title">
|
249
|
-
<a name="
|
249
|
+
<a name="M000352"></a><b>unshift</b>(x)
|
250
250
|
</div>
|
251
251
|
<div class="description">
|
252
252
|
<p>
|
253
|
-
Alias for <a href="Stackable.html#
|
253
|
+
Alias for <a href="Stackable.html#M000351">poke</a>
|
254
254
|
</p>
|
255
255
|
</div>
|
256
256
|
</div>
|
@@ -60,6 +60,7 @@
|
|
60
60
|
<a href="../files/lib/core/facets/boolean_rb.html">lib/core/facets/boolean.rb</a>
|
61
61
|
<a href="../files/lib/core/facets/comparable/cmp_rb.html">lib/core/facets/comparable/cmp.rb</a>
|
62
62
|
<a href="../files/lib/core/facets/string/shatter_rb.html">lib/core/facets/string/shatter.rb</a>
|
63
|
+
<a href="../files/lib/core/facets/string/file_rb.html">lib/core/facets/string/file.rb</a>
|
63
64
|
<a href="../files/lib/core/facets/string/to_re_rb.html">lib/core/facets/string/to_re.rb</a>
|
64
65
|
<a href="../files/lib/core/facets/string/fold_rb.html">lib/core/facets/string/fold.rb</a>
|
65
66
|
<a href="../files/lib/core/facets/string/start_with_rb.html">lib/core/facets/string/start_with.rb</a>
|
@@ -123,68 +124,69 @@ Object
|
|
123
124
|
|
124
125
|
|
125
126
|
<div class="sectiontitle">Methods</div>
|
126
|
-
<span style="padding-right: 5px;"><a href="#
|
127
|
-
<span style="padding-right: 5px;"><a href="#
|
128
|
-
<span style="padding-right: 5px;"><a href="#
|
129
|
-
<span style="padding-right: 5px;"><a href="#
|
130
|
-
<span style="padding-right: 5px;"><a href="#
|
131
|
-
<span style="padding-right: 5px;"><a href="#
|
132
|
-
<span style="padding-right: 5px;"><a href="#
|
133
|
-
<span style="padding-right: 5px;"><a href="#
|
134
|
-
<span style="padding-right: 5px;"><a href="#
|
135
|
-
<span style="padding-right: 5px;"><a href="#
|
136
|
-
<span style="padding-right: 5px;"><a href="#
|
137
|
-
<span style="padding-right: 5px;"><a href="#
|
138
|
-
<span style="padding-right: 5px;"><a href="#
|
139
|
-
<span style="padding-right: 5px;"><a href="#
|
140
|
-
<span style="padding-right: 5px;"><a href="#
|
141
|
-
<span style="padding-right: 5px;"><a href="#
|
142
|
-
<span style="padding-right: 5px;"><a href="#
|
143
|
-
<span style="padding-right: 5px;"><a href="#
|
144
|
-
<span style="padding-right: 5px;"><a href="#
|
145
|
-
<span style="padding-right: 5px;"><a href="#
|
146
|
-
<span style="padding-right: 5px;"><a href="#
|
147
|
-
<span style="padding-right: 5px;"><a href="#
|
148
|
-
<span style="padding-right: 5px;"><a href="#
|
149
|
-
<span style="padding-right: 5px;"><a href="#
|
150
|
-
<span style="padding-right: 5px;"><a href="#
|
151
|
-
<span style="padding-right: 5px;"><a href="#
|
152
|
-
<span style="padding-right: 5px;"><a href="#
|
153
|
-
<span style="padding-right: 5px;"><a href="#
|
154
|
-
<span style="padding-right: 5px;"><a href="#
|
155
|
-
<span style="padding-right: 5px;"><a href="#
|
156
|
-
<span style="padding-right: 5px;"><a href="#
|
157
|
-
<span style="padding-right: 5px;"><a href="#
|
158
|
-
<span style="padding-right: 5px;"><a href="#
|
159
|
-
<span style="padding-right: 5px;"><a href="#
|
160
|
-
<span style="padding-right: 5px;"><a href="#
|
161
|
-
<span style="padding-right: 5px;"><a href="#
|
162
|
-
<span style="padding-right: 5px;"><a href="#
|
163
|
-
<span style="padding-right: 5px;"><a href="#
|
164
|
-
<span style="padding-right: 5px;"><a href="#
|
165
|
-
<span style="padding-right: 5px;"><a href="#
|
166
|
-
<span style="padding-right: 5px;"><a href="#
|
167
|
-
<span style="padding-right: 5px;"><a href="#
|
168
|
-
<span style="padding-right: 5px;"><a href="#
|
169
|
-
<span style="padding-right: 5px;"><a href="#
|
170
|
-
<span style="padding-right: 5px;"><a href="#
|
171
|
-
<span style="padding-right: 5px;"><a href="#
|
172
|
-
<span style="padding-right: 5px;"><a href="#
|
173
|
-
<span style="padding-right: 5px;"><a href="#
|
174
|
-
<span style="padding-right: 5px;"><a href="#
|
175
|
-
<span style="padding-right: 5px;"><a href="#
|
176
|
-
<span style="padding-right: 5px;"><a href="#
|
177
|
-
<span style="padding-right: 5px;"><a href="#
|
178
|
-
<span style="padding-right: 5px;"><a href="#
|
179
|
-
<span style="padding-right: 5px;"><a href="#
|
180
|
-
<span style="padding-right: 5px;"><a href="#
|
181
|
-
<span style="padding-right: 5px;"><a href="#
|
182
|
-
<span style="padding-right: 5px;"><a href="#
|
183
|
-
<span style="padding-right: 5px;"><a href="#
|
184
|
-
<span style="padding-right: 5px;"><a href="#
|
185
|
-
<span style="padding-right: 5px;"><a href="#
|
186
|
-
<span style="padding-right: 5px;"><a href="#
|
187
|
-
<span style="padding-right: 5px;"><a href="#
|
127
|
+
<span style="padding-right: 5px;"><a href="#M000283">-</a></span>
|
128
|
+
<span style="padding-right: 5px;"><a href="#M000323">^</a></span>
|
129
|
+
<span style="padding-right: 5px;"><a href="#M000277">align</a></span>
|
130
|
+
<span style="padding-right: 5px;"><a href="#M000280">align_center</a></span>
|
131
|
+
<span style="padding-right: 5px;"><a href="#M000279">align_left</a></span>
|
132
|
+
<span style="padding-right: 5px;"><a href="#M000278">align_right</a></span>
|
133
|
+
<span style="padding-right: 5px;"><a href="#M000325">blank?</a></span>
|
134
|
+
<span style="padding-right: 5px;"><a href="#M000311">bracket</a></span>
|
135
|
+
<span style="padding-right: 5px;"><a href="#M000312">bracket!</a></span>
|
136
|
+
<span style="padding-right: 5px;"><a href="#M000301">bytes</a></span>
|
137
|
+
<span style="padding-right: 5px;"><a href="#M000272">camelcase</a></span>
|
138
|
+
<span style="padding-right: 5px;"><a href="#M000294">capitalized?</a></span>
|
139
|
+
<span style="padding-right: 5px;"><a href="#M000317">chars</a></span>
|
140
|
+
<span style="padding-right: 5px;"><a href="#M000309">cleave</a></span>
|
141
|
+
<span style="padding-right: 5px;"><a href="#M000264">cmp</a></span>
|
142
|
+
<span style="padding-right: 5px;"><a href="#M000284">compress_lines</a></span>
|
143
|
+
<span style="padding-right: 5px;"><a href="#M000316">dequote</a></span>
|
144
|
+
<span style="padding-right: 5px;"><a href="#M000291">divide</a></span>
|
145
|
+
<span style="padding-right: 5px;"><a href="#M000295">downcase?</a></span>
|
146
|
+
<span style="padding-right: 5px;"><a href="#M000290">each_char</a></span>
|
147
|
+
<span style="padding-right: 5px;"><a href="#M000324">each_word</a></span>
|
148
|
+
<span style="padding-right: 5px;"><a href="#M000271">end_with?</a></span>
|
149
|
+
<span style="padding-right: 5px;"><a href="#M000297">expand_tab</a></span>
|
150
|
+
<span style="padding-right: 5px;"><a href="#M000298">expand_tabs</a></span>
|
151
|
+
<span style="padding-right: 5px;"><a href="#M000266">file</a></span>
|
152
|
+
<span style="padding-right: 5px;"><a href="#M000269">fold</a></span>
|
153
|
+
<span style="padding-right: 5px;"><a href="#M000303">indent</a></span>
|
154
|
+
<span style="padding-right: 5px;"><a href="#M000288">index_all</a></span>
|
155
|
+
<span style="padding-right: 5px;"><a href="#M000308">interpolate</a></span>
|
156
|
+
<span style="padding-right: 5px;"><a href="#M000318">lchomp</a></span>
|
157
|
+
<span style="padding-right: 5px;"><a href="#M000319">lchomp!</a></span>
|
158
|
+
<span style="padding-right: 5px;"><a href="#M000310">line_wrap</a></span>
|
159
|
+
<span style="padding-right: 5px;"><a href="#M000273">lines</a></span>
|
160
|
+
<span style="padding-right: 5px;"><a href="#M000292">margin</a></span>
|
161
|
+
<span style="padding-right: 5px;"><a href="#M000282">methodize</a></span>
|
162
|
+
<span style="padding-right: 5px;"><a href="#M000274">modulize</a></span>
|
163
|
+
<span style="padding-right: 5px;"><a href="#M000293">mscan</a></span>
|
164
|
+
<span style="padding-right: 5px;"><a href="#M000299">natcmp</a></span>
|
165
|
+
<span style="padding-right: 5px;"><a href="#M000322">nchar</a></span>
|
166
|
+
<span style="padding-right: 5px;"><a href="#M000304">outdent</a></span>
|
167
|
+
<span style="padding-right: 5px;"><a href="#M000302">pathize</a></span>
|
168
|
+
<span style="padding-right: 5px;"><a href="#M000315">quote</a></span>
|
169
|
+
<span style="padding-right: 5px;"><a href="#M000285">range</a></span>
|
170
|
+
<span style="padding-right: 5px;"><a href="#M000286">range_all</a></span>
|
171
|
+
<span style="padding-right: 5px;"><a href="#M000287">range_of_line</a></span>
|
172
|
+
<span style="padding-right: 5px;"><a href="#M000321">rewrite</a></span>
|
173
|
+
<span style="padding-right: 5px;"><a href="#M000265">shatter</a></span>
|
174
|
+
<span style="padding-right: 5px;"><a href="#M000289">snakecase</a></span>
|
175
|
+
<span style="padding-right: 5px;"><a href="#M000320">splice</a></span>
|
176
|
+
<span style="padding-right: 5px;"><a href="#M000270">start_with?</a></span>
|
177
|
+
<span style="padding-right: 5px;"><a href="#M000281">tab</a></span>
|
178
|
+
<span style="padding-right: 5px;"><a href="#M000306">tabto</a></span>
|
179
|
+
<span style="padding-right: 5px;"><a href="#M000305">titlecase</a></span>
|
180
|
+
<span style="padding-right: 5px;"><a href="#M000263">to_b</a></span>
|
181
|
+
<span style="padding-right: 5px;"><a href="#M000267">to_re</a></span>
|
182
|
+
<span style="padding-right: 5px;"><a href="#M000268">to_rx</a></span>
|
183
|
+
<span style="padding-right: 5px;"><a href="#M000313">unbracket</a></span>
|
184
|
+
<span style="padding-right: 5px;"><a href="#M000314">unbracket!</a></span>
|
185
|
+
<span style="padding-right: 5px;"><a href="#M000296">upcase?</a></span>
|
186
|
+
<span style="padding-right: 5px;"><a href="#M000300">variablize</a></span>
|
187
|
+
<span style="padding-right: 5px;"><a href="#M000275">word_wrap</a></span>
|
188
|
+
<span style="padding-right: 5px;"><a href="#M000276">word_wrap!</a></span>
|
189
|
+
<span style="padding-right: 5px;"><a href="#M000307">words</a></span>
|
188
190
|
|
189
191
|
|
190
192
|
|
@@ -202,7 +204,7 @@ Object
|
|
202
204
|
<div class="sectiontitle">Public Class methods</div>
|
203
205
|
<div class="method">
|
204
206
|
<div class="title">
|
205
|
-
<a name="
|
207
|
+
<a name="M000308"></a><b>interpolate</b>(&str)
|
206
208
|
</div>
|
207
209
|
<div class="description">
|
208
210
|
<p>
|
@@ -222,8 +224,8 @@ CREDIT: Trans
|
|
222
224
|
</p>
|
223
225
|
</div>
|
224
226
|
<div class="sourcecode">
|
225
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
226
|
-
<div id="
|
227
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000308_source')" id="l_M000308_source">+</a> ]</p>
|
228
|
+
<div id="M000308_source" class="dyn-source">
|
227
229
|
<pre>
|
228
230
|
<span class="ruby-comment cmt"># File lib/core/facets/string/interpolate.rb, line 15</span>
|
229
231
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">interpolate</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">str</span>)
|
@@ -236,7 +238,7 @@ CREDIT: Trans
|
|
236
238
|
<div class="sectiontitle">Public Instance methods</div>
|
237
239
|
<div class="method">
|
238
240
|
<div class="title">
|
239
|
-
<a name="
|
241
|
+
<a name="M000283"></a><b>-</b>(pattern)
|
240
242
|
</div>
|
241
243
|
<div class="description">
|
242
244
|
<p>
|
@@ -250,8 +252,8 @@ CREDIT: Benjamin David Oakes
|
|
250
252
|
</p>
|
251
253
|
</div>
|
252
254
|
<div class="sourcecode">
|
253
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
254
|
-
<div id="
|
255
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000283_source')" id="l_M000283_source">+</a> ]</p>
|
256
|
+
<div id="M000283_source" class="dyn-source">
|
255
257
|
<pre>
|
256
258
|
<span class="ruby-comment cmt"># File lib/core/facets/string/op_sub.rb, line 9</span>
|
257
259
|
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">-</span>(<span class="ruby-identifier">pattern</span>)
|
@@ -263,21 +265,29 @@ CREDIT: Benjamin David Oakes
|
|
263
265
|
</div>
|
264
266
|
<div class="method">
|
265
267
|
<div class="title">
|
266
|
-
<a name="
|
268
|
+
<a name="M000323"></a><b>^</b>(aString)
|
267
269
|
</div>
|
268
270
|
<div class="description">
|
269
271
|
<p>
|
270
|
-
XOR two
|
272
|
+
Binary XOR of two strings.
|
271
273
|
</p>
|
274
|
+
<pre>
|
275
|
+
puts "\000\000\001\001" ^ "\000\001\000\001"
|
276
|
+
puts "\003\003\003" ^ "\000\001\002"
|
277
|
+
</pre>
|
272
278
|
<p>
|
273
|
-
|
279
|
+
<em>produces</em>
|
274
280
|
</p>
|
281
|
+
<pre>
|
282
|
+
"\000\001\001\000"
|
283
|
+
"\003\002\001"
|
284
|
+
</pre>
|
275
285
|
</div>
|
276
286
|
<div class="sourcecode">
|
277
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
278
|
-
<div id="
|
287
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000323_source')" id="l_M000323_source">+</a> ]</p>
|
288
|
+
<div id="M000323_source" class="dyn-source">
|
279
289
|
<pre>
|
280
|
-
<span class="ruby-comment cmt"># File lib/core/facets/string/xor.rb, line
|
290
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/xor.rb, line 13</span>
|
281
291
|
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">^</span>(<span class="ruby-identifier">aString</span>)
|
282
292
|
<span class="ruby-identifier">a</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'C'</span><span class="ruby-operator">*</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>))
|
283
293
|
<span class="ruby-identifier">b</span> = <span class="ruby-identifier">aString</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'C'</span><span class="ruby-operator">*</span>(<span class="ruby-identifier">aString</span>.<span class="ruby-identifier">length</span>))
|
@@ -297,11 +307,11 @@ TODO: This is used by crypt.rb, it needs to be documented.
|
|
297
307
|
</div>
|
298
308
|
<div class="method">
|
299
309
|
<div class="title">
|
300
|
-
<a name="
|
310
|
+
<a name="M000277"></a><b>align</b>(direction, n, sep="\n", c=' ')
|
301
311
|
</div>
|
302
312
|
<div class="sourcecode">
|
303
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
304
|
-
<div id="
|
313
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000277_source')" id="l_M000277_source">+</a> ]</p>
|
314
|
+
<div id="M000277_source" class="dyn-source">
|
305
315
|
<pre>
|
306
316
|
<span class="ruby-comment cmt"># File lib/core/facets/string/align.rb, line 3</span>
|
307
317
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">align</span>(<span class="ruby-identifier">direction</span>, <span class="ruby-identifier">n</span>, <span class="ruby-identifier">sep</span>=<span class="ruby-value str">"\n"</span>, <span class="ruby-identifier">c</span>=<span class="ruby-value str">' '</span>)
|
@@ -322,15 +332,15 @@ TODO: This is used by crypt.rb, it needs to be documented.
|
|
322
332
|
</div>
|
323
333
|
<div class="method">
|
324
334
|
<div class="title">
|
325
|
-
<a name="
|
335
|
+
<a name="M000280"></a><b>align_center</b>(n, sep="\n", c=' ')
|
326
336
|
</div>
|
327
337
|
<div class="description">
|
328
338
|
<p>
|
329
339
|
Centers each line of a string.
|
330
340
|
</p>
|
331
341
|
<p>
|
332
|
-
The
|
333
|
-
changed as can be the padding string which defaults to a single space
|
342
|
+
The default alignment separation is a new line ("\n"). This can
|
343
|
+
be changed as can be the padding string which defaults to a single space
|
334
344
|
(’ ’).
|
335
345
|
</p>
|
336
346
|
<pre>
|
@@ -355,10 +365,10 @@ CREDIT: Trans
|
|
355
365
|
</p>
|
356
366
|
</div>
|
357
367
|
<div class="sourcecode">
|
358
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
359
|
-
<div id="
|
368
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000280_source')" id="l_M000280_source">+</a> ]</p>
|
369
|
+
<div id="M000280_source" class="dyn-source">
|
360
370
|
<pre>
|
361
|
-
<span class="ruby-comment cmt"># File lib/core/facets/string/align.rb, line
|
371
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/align.rb, line 98</span>
|
362
372
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">align_center</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">sep</span>=<span class="ruby-value str">"\n"</span>, <span class="ruby-identifier">c</span>=<span class="ruby-value str">' '</span>)
|
363
373
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">center</span>(<span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_i</span>,<span class="ruby-identifier">c</span>.<span class="ruby-identifier">to_s</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sep</span><span class="ruby-operator">==</span><span class="ruby-keyword kw">nil</span>
|
364
374
|
<span class="ruby-identifier">q</span> = <span class="ruby-identifier">split</span>(<span class="ruby-identifier">sep</span>.<span class="ruby-identifier">to_s</span>).<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
|
@@ -372,15 +382,15 @@ CREDIT: Trans
|
|
372
382
|
</div>
|
373
383
|
<div class="method">
|
374
384
|
<div class="title">
|
375
|
-
<a name="
|
385
|
+
<a name="M000279"></a><b>align_left</b>(n, sep="\n", c=' ')
|
376
386
|
</div>
|
377
387
|
<div class="description">
|
378
388
|
<p>
|
379
389
|
Align a string to the left.
|
380
390
|
</p>
|
381
391
|
<p>
|
382
|
-
The
|
383
|
-
|
392
|
+
The default alignment separation is a new line ("\n"). This can
|
393
|
+
be changed as can be the padding string which defaults to a single space
|
384
394
|
(’ ’).
|
385
395
|
</p>
|
386
396
|
<pre>
|
@@ -390,30 +400,30 @@ changes as can be the padding string which defaults to a single space
|
|
390
400
|
so on
|
391
401
|
EOS
|
392
402
|
|
393
|
-
puts s.align_left(
|
403
|
+
puts s.align_left(20, "\n", '.')
|
394
404
|
</pre>
|
395
405
|
<p>
|
396
406
|
<em>produces</em>
|
397
407
|
</p>
|
398
408
|
<pre>
|
399
|
-
|
400
|
-
|
401
|
-
|
409
|
+
This is a test......
|
410
|
+
and.................
|
411
|
+
so on...............
|
402
412
|
</pre>
|
403
413
|
<p>
|
404
414
|
CREDIT: Trans
|
405
415
|
</p>
|
406
416
|
</div>
|
407
417
|
<div class="sourcecode">
|
408
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
409
|
-
<div id="
|
418
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000279_source')" id="l_M000279_source">+</a> ]</p>
|
419
|
+
<div id="M000279_source" class="dyn-source">
|
410
420
|
<pre>
|
411
|
-
<span class="ruby-comment cmt"># File lib/core/facets/string/align.rb, line
|
421
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/align.rb, line 68</span>
|
412
422
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">align_left</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">sep</span>=<span class="ruby-value str">"\n"</span>, <span class="ruby-identifier">c</span>=<span class="ruby-value str">' '</span>)
|
413
423
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ljust</span>(<span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_i</span>,<span class="ruby-identifier">c</span>.<span class="ruby-identifier">to_s</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sep</span><span class="ruby-operator">==</span><span class="ruby-keyword kw">nil</span>
|
414
|
-
<span class="ruby-identifier">q</span> = <span class="ruby-identifier">split</span>(<span class="ruby-identifier">sep</span>.<span class="ruby-identifier">to_s</span>).<span class="ruby-identifier">
|
415
|
-
<span class="ruby-identifier">line</span>.<span class="ruby-identifier">ljust</span>(<span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_i</span>,<span class="ruby-identifier">c</span>.<span class="ruby-identifier">to_s</span>)
|
416
|
-
|
424
|
+
<span class="ruby-identifier">q</span> = <span class="ruby-identifier">split</span>(<span class="ruby-identifier">sep</span>.<span class="ruby-identifier">to_s</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
|
425
|
+
<span class="ruby-identifier">line</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">ljust</span>(<span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_i</span>,<span class="ruby-identifier">c</span>.<span class="ruby-identifier">to_s</span>)
|
426
|
+
<span class="ruby-keyword kw">end</span>
|
417
427
|
<span class="ruby-identifier">q</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">sep</span>.<span class="ruby-identifier">to_s</span>)
|
418
428
|
<span class="ruby-keyword kw">end</span>
|
419
429
|
</pre>
|
@@ -422,13 +432,16 @@ CREDIT: Trans
|
|
422
432
|
</div>
|
423
433
|
<div class="method">
|
424
434
|
<div class="title">
|
425
|
-
<a name="
|
435
|
+
<a name="M000278"></a><b>align_right</b>(n, sep="\n", c=' ')
|
426
436
|
</div>
|
427
437
|
<div class="description">
|
428
438
|
<p>
|
429
|
-
Align a string to the right.
|
430
|
-
|
431
|
-
|
439
|
+
Align a string to the right.
|
440
|
+
</p>
|
441
|
+
<p>
|
442
|
+
The default alignment separation is a new line ("\n"). This can
|
443
|
+
be changed as can be the padding string which defaults to a single space
|
444
|
+
(’ ’).
|
432
445
|
</p>
|
433
446
|
<pre>
|
434
447
|
s = <<-EOS
|
@@ -437,30 +450,30 @@ defaults to a single space (’ ’).
|
|
437
450
|
so on
|
438
451
|
EOS
|
439
452
|
|
440
|
-
puts s.align_right(
|
453
|
+
puts s.align_right(14)
|
441
454
|
</pre>
|
442
455
|
<p>
|
443
456
|
<em>produces</em>
|
444
457
|
</p>
|
445
458
|
<pre>
|
446
|
-
|
447
|
-
|
448
|
-
|
459
|
+
This is a test
|
460
|
+
and
|
461
|
+
so on
|
449
462
|
</pre>
|
450
463
|
<p>
|
451
464
|
CREDIT: Trans
|
452
465
|
</p>
|
453
466
|
</div>
|
454
467
|
<div class="sourcecode">
|
455
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
456
|
-
<div id="
|
468
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000278_source')" id="l_M000278_source">+</a> ]</p>
|
469
|
+
<div id="M000278_source" class="dyn-source">
|
457
470
|
<pre>
|
458
|
-
<span class="ruby-comment cmt"># File lib/core/facets/string/align.rb, line
|
471
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/align.rb, line 38</span>
|
459
472
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">align_right</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">sep</span>=<span class="ruby-value str">"\n"</span>, <span class="ruby-identifier">c</span>=<span class="ruby-value str">' '</span>)
|
460
473
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">rjust</span>(<span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_i</span>,<span class="ruby-identifier">c</span>.<span class="ruby-identifier">to_s</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sep</span><span class="ruby-operator">==</span><span class="ruby-keyword kw">nil</span>
|
461
|
-
<span class="ruby-identifier">q</span> = <span class="ruby-identifier">split</span>(<span class="ruby-identifier">sep</span>.<span class="ruby-identifier">to_s</span>).<span class="ruby-identifier">
|
474
|
+
<span class="ruby-identifier">q</span> = <span class="ruby-identifier">split</span>(<span class="ruby-identifier">sep</span>.<span class="ruby-identifier">to_s</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
|
462
475
|
<span class="ruby-identifier">line</span>.<span class="ruby-identifier">rjust</span>(<span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_i</span>,<span class="ruby-identifier">c</span>.<span class="ruby-identifier">to_s</span>)
|
463
|
-
|
476
|
+
<span class="ruby-keyword kw">end</span>
|
464
477
|
<span class="ruby-identifier">q</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">sep</span>.<span class="ruby-identifier">to_s</span>)
|
465
478
|
<span class="ruby-keyword kw">end</span>
|
466
479
|
</pre>
|
@@ -469,7 +482,7 @@ CREDIT: Trans
|
|
469
482
|
</div>
|
470
483
|
<div class="method">
|
471
484
|
<div class="title">
|
472
|
-
<a name="
|
485
|
+
<a name="M000325"></a><b>blank?</b>()
|
473
486
|
</div>
|
474
487
|
<div class="description">
|
475
488
|
<p>
|
@@ -481,8 +494,8 @@ Is this string just whitespace?
|
|
481
494
|
</pre>
|
482
495
|
</div>
|
483
496
|
<div class="sourcecode">
|
484
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
485
|
-
<div id="
|
497
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000325_source')" id="l_M000325_source">+</a> ]</p>
|
498
|
+
<div id="M000325_source" class="dyn-source">
|
486
499
|
<pre>
|
487
500
|
<span class="ruby-comment cmt"># File lib/core/facets/blank.rb, line 50</span>
|
488
501
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">blank?</span>
|
@@ -494,12 +507,12 @@ Is this string just whitespace?
|
|
494
507
|
</div>
|
495
508
|
<div class="method">
|
496
509
|
<div class="title">
|
497
|
-
<a name="
|
510
|
+
<a name="M000311"></a><b>bracket</b>(bra, ket=nil)
|
498
511
|
</div>
|
499
512
|
<div class="description">
|
500
513
|
<p>
|
501
514
|
Return a new string embraced by given brakets. If only one <a
|
502
|
-
href="String.html#
|
515
|
+
href="String.html#M000311">bracket</a> char is given it will be placed on
|
503
516
|
either side.
|
504
517
|
</p>
|
505
518
|
<pre>
|
@@ -511,8 +524,8 @@ CREDIT: Trans
|
|
511
524
|
</p>
|
512
525
|
</div>
|
513
526
|
<div class="sourcecode">
|
514
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
515
|
-
<div id="
|
527
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000311_source')" id="l_M000311_source">+</a> ]</p>
|
528
|
+
<div id="M000311_source" class="dyn-source">
|
516
529
|
<pre>
|
517
530
|
<span class="ruby-comment cmt"># File lib/core/facets/string/bracket.rb, line 14</span>
|
518
531
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bracket</span>(<span class="ruby-identifier">bra</span>, <span class="ruby-identifier">ket</span>=<span class="ruby-keyword kw">nil</span>)
|
@@ -526,7 +539,7 @@ CREDIT: Trans
|
|
526
539
|
</div>
|
527
540
|
<div class="method">
|
528
541
|
<div class="title">
|
529
|
-
<a name="
|
542
|
+
<a name="M000312"></a><b>bracket!</b>(bra, ket=nil)
|
530
543
|
</div>
|
531
544
|
<div class="description">
|
532
545
|
<p>
|
@@ -537,8 +550,8 @@ CREDIT: Trans
|
|
537
550
|
</p>
|
538
551
|
</div>
|
539
552
|
<div class="sourcecode">
|
540
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
541
|
-
<div id="
|
553
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000312_source')" id="l_M000312_source">+</a> ]</p>
|
554
|
+
<div id="M000312_source" class="dyn-source">
|
542
555
|
<pre>
|
543
556
|
<span class="ruby-comment cmt"># File lib/core/facets/string/bracket.rb, line 24</span>
|
544
557
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bracket!</span>(<span class="ruby-identifier">bra</span>, <span class="ruby-identifier">ket</span>=<span class="ruby-keyword kw">nil</span>)
|
@@ -550,16 +563,16 @@ CREDIT: Trans
|
|
550
563
|
</div>
|
551
564
|
<div class="method">
|
552
565
|
<div class="title">
|
553
|
-
<a name="
|
566
|
+
<a name="M000301"></a><b>bytes</b>()
|
554
567
|
</div>
|
555
568
|
<div class="description">
|
556
569
|
<p>
|
557
|
-
Upacks string into <a href="String.html#
|
570
|
+
Upacks string into <a href="String.html#M000301">bytes</a>.
|
558
571
|
</p>
|
559
572
|
</div>
|
560
573
|
<div class="sourcecode">
|
561
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
562
|
-
<div id="
|
574
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000301_source')" id="l_M000301_source">+</a> ]</p>
|
575
|
+
<div id="M000301_source" class="dyn-source">
|
563
576
|
<pre>
|
564
577
|
<span class="ruby-comment cmt"># File lib/core/facets/string/bytes.rb, line 8</span>
|
565
578
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bytes</span>
|
@@ -571,19 +584,19 @@ Upacks string into <a href="String.html#M000289">bytes</a>.
|
|
571
584
|
</div>
|
572
585
|
<div class="method">
|
573
586
|
<div class="title">
|
574
|
-
<a name="
|
587
|
+
<a name="M000272"></a><b>camelcase</b>(upcase_first_letter=true)
|
575
588
|
</div>
|
576
589
|
<div class="description">
|
577
590
|
<p>
|
578
|
-
Converts a string to <a href="String.html#
|
591
|
+
Converts a string to <a href="String.html#M000272">camelcase</a>.
|
579
592
|
</p>
|
580
593
|
<p>
|
581
|
-
By default <a href="String.html#
|
594
|
+
By default <a href="String.html#M000272">camelcase</a> convert to
|
582
595
|
UpperCamelCase, If an argument is set to <tt>false</tt>, then <a
|
583
|
-
href="String.html#
|
596
|
+
href="String.html#M000272">camelcase</a> will produce lowerCamelCase.
|
584
597
|
</p>
|
585
598
|
<p>
|
586
|
-
<tt><a href="String.html#
|
599
|
+
<tt><a href="String.html#M000272">camelcase</a></tt> also converts
|
587
600
|
’/’ to ’::’ which is useful for converting paths to
|
588
601
|
namespaces.
|
589
602
|
</p>
|
@@ -597,8 +610,8 @@ Examples
|
|
597
610
|
</pre>
|
598
611
|
</div>
|
599
612
|
<div class="sourcecode">
|
600
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
601
|
-
<div id="
|
613
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000272_source')" id="l_M000272_source">+</a> ]</p>
|
614
|
+
<div id="M000272_source" class="dyn-source">
|
602
615
|
<pre>
|
603
616
|
<span class="ruby-comment cmt"># File lib/core/facets/string/camelcase.rb, line 16</span>
|
604
617
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">camelcase</span>(<span class="ruby-identifier">upcase_first_letter</span>=<span class="ruby-keyword kw">true</span>)
|
@@ -615,7 +628,7 @@ Examples
|
|
615
628
|
</div>
|
616
629
|
<div class="method">
|
617
630
|
<div class="title">
|
618
|
-
<a name="
|
631
|
+
<a name="M000294"></a><b>capitalized?</b>()
|
619
632
|
</div>
|
620
633
|
<div class="description">
|
621
634
|
<p>
|
@@ -631,8 +644,8 @@ CREDIT: Phil Tomson
|
|
631
644
|
</p>
|
632
645
|
</div>
|
633
646
|
<div class="sourcecode">
|
634
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
635
|
-
<div id="
|
647
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000294_source')" id="l_M000294_source">+</a> ]</p>
|
648
|
+
<div id="M000294_source" class="dyn-source">
|
636
649
|
<pre>
|
637
650
|
<span class="ruby-comment cmt"># File lib/core/facets/string/capitalized.rb, line 11</span>
|
638
651
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">capitalized?</span>
|
@@ -644,7 +657,7 @@ CREDIT: Phil Tomson
|
|
644
657
|
</div>
|
645
658
|
<div class="method">
|
646
659
|
<div class="title">
|
647
|
-
<a name="
|
660
|
+
<a name="M000317"></a><b>chars</b>()
|
648
661
|
</div>
|
649
662
|
<div class="description">
|
650
663
|
<p>
|
@@ -655,8 +668,8 @@ Returns an array of characters.
|
|
655
668
|
</pre>
|
656
669
|
</div>
|
657
670
|
<div class="sourcecode">
|
658
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
659
|
-
<div id="
|
671
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000317_source')" id="l_M000317_source">+</a> ]</p>
|
672
|
+
<div id="M000317_source" class="dyn-source">
|
660
673
|
<pre>
|
661
674
|
<span class="ruby-comment cmt"># File lib/core/facets/string/chars.rb, line 9</span>
|
662
675
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">chars</span>
|
@@ -668,7 +681,7 @@ Returns an array of characters.
|
|
668
681
|
</div>
|
669
682
|
<div class="method">
|
670
683
|
<div class="title">
|
671
|
-
<a name="
|
684
|
+
<a name="M000309"></a><b>cleave</b>(threshold=nil, len=nil)
|
672
685
|
</div>
|
673
686
|
<div class="description">
|
674
687
|
<p>
|
@@ -679,8 +692,8 @@ CREDIT: Trans
|
|
679
692
|
</p>
|
680
693
|
</div>
|
681
694
|
<div class="sourcecode">
|
682
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
683
|
-
<div id="
|
695
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000309_source')" id="l_M000309_source">+</a> ]</p>
|
696
|
+
<div id="M000309_source" class="dyn-source">
|
684
697
|
<pre>
|
685
698
|
<span class="ruby-comment cmt"># File lib/core/facets/string/cleave.rb, line 8</span>
|
686
699
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cleave</span>(<span class="ruby-identifier">threshold</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">len</span>=<span class="ruby-keyword kw">nil</span>)
|
@@ -716,7 +729,7 @@ CREDIT: Trans
|
|
716
729
|
</div>
|
717
730
|
<div class="method">
|
718
731
|
<div class="title">
|
719
|
-
<a name="
|
732
|
+
<a name="M000264"></a><b>cmp</b>(other)
|
720
733
|
</div>
|
721
734
|
<div class="description">
|
722
735
|
<p>
|
@@ -734,8 +747,8 @@ CREDIT: Peter Vanbroekhoven
|
|
734
747
|
</p>
|
735
748
|
</div>
|
736
749
|
<div class="sourcecode">
|
737
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
738
|
-
<div id="
|
750
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000264_source')" id="l_M000264_source">+</a> ]</p>
|
751
|
+
<div id="M000264_source" class="dyn-source">
|
739
752
|
<pre>
|
740
753
|
<span class="ruby-comment cmt"># File lib/core/facets/comparable/cmp.rb, line 31</span>
|
741
754
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmp</span>(<span class="ruby-identifier">other</span>)
|
@@ -749,7 +762,7 @@ CREDIT: Peter Vanbroekhoven
|
|
749
762
|
</div>
|
750
763
|
<div class="method">
|
751
764
|
<div class="title">
|
752
|
-
<a name="
|
765
|
+
<a name="M000284"></a><b>compress_lines</b>(spaced = true)
|
753
766
|
</div>
|
754
767
|
<div class="description">
|
755
768
|
<p>
|
@@ -767,8 +780,8 @@ Matches any whitespace (including newline) and replaces with a single space
|
|
767
780
|
</pre>
|
768
781
|
</div>
|
769
782
|
<div class="sourcecode">
|
770
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
771
|
-
<div id="
|
783
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000284_source')" id="l_M000284_source">+</a> ]</p>
|
784
|
+
<div id="M000284_source" class="dyn-source">
|
772
785
|
<pre>
|
773
786
|
<span class="ruby-comment cmt"># File lib/core/facets/string/compress_lines.rb, line 12</span>
|
774
787
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compress_lines</span>(<span class="ruby-identifier">spaced</span> = <span class="ruby-keyword kw">true</span>)
|
@@ -780,7 +793,7 @@ Matches any whitespace (including newline) and replaces with a single space
|
|
780
793
|
</div>
|
781
794
|
<div class="method">
|
782
795
|
<div class="title">
|
783
|
-
<a name="
|
796
|
+
<a name="M000316"></a><b>dequote</b>()
|
784
797
|
</div>
|
785
798
|
<div class="description">
|
786
799
|
<p>
|
@@ -794,8 +807,8 @@ CREDIT: Trans
|
|
794
807
|
</p>
|
795
808
|
</div>
|
796
809
|
<div class="sourcecode">
|
797
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
798
|
-
<div id="
|
810
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000316_source')" id="l_M000316_source">+</a> ]</p>
|
811
|
+
<div id="M000316_source" class="dyn-source">
|
799
812
|
<pre>
|
800
813
|
<span class="ruby-comment cmt"># File lib/core/facets/string/bracket.rb, line 88</span>
|
801
814
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dequote</span>
|
@@ -819,7 +832,7 @@ CREDIT: Trans
|
|
819
832
|
</div>
|
820
833
|
<div class="method">
|
821
834
|
<div class="title">
|
822
|
-
<a name="
|
835
|
+
<a name="M000291"></a><b>divide</b>( re )
|
823
836
|
</div>
|
824
837
|
<div class="description">
|
825
838
|
<p>
|
@@ -841,8 +854,8 @@ CREDIT: Trans
|
|
841
854
|
</p>
|
842
855
|
</div>
|
843
856
|
<div class="sourcecode">
|
844
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
845
|
-
<div id="
|
857
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000291_source')" id="l_M000291_source">+</a> ]</p>
|
858
|
+
<div id="M000291_source" class="dyn-source">
|
846
859
|
<pre>
|
847
860
|
<span class="ruby-comment cmt"># File lib/core/facets/string/divide.rb, line 15</span>
|
848
861
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">divide</span>( <span class="ruby-identifier">re</span> )
|
@@ -855,7 +868,7 @@ CREDIT: Trans
|
|
855
868
|
</div>
|
856
869
|
<div class="method">
|
857
870
|
<div class="title">
|
858
|
-
<a name="
|
871
|
+
<a name="M000295"></a><b>downcase?</b>()
|
859
872
|
</div>
|
860
873
|
<div class="description">
|
861
874
|
<p>
|
@@ -871,8 +884,8 @@ CREDIT: Phil Tomson
|
|
871
884
|
</p>
|
872
885
|
</div>
|
873
886
|
<div class="sourcecode">
|
874
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
875
|
-
<div id="
|
887
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000295_source')" id="l_M000295_source">+</a> ]</p>
|
888
|
+
<div id="M000295_source" class="dyn-source">
|
876
889
|
<pre>
|
877
890
|
<span class="ruby-comment cmt"># File lib/core/facets/string/capitalized.rb, line 23</span>
|
878
891
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">downcase?</span>
|
@@ -884,7 +897,7 @@ CREDIT: Phil Tomson
|
|
884
897
|
</div>
|
885
898
|
<div class="method">
|
886
899
|
<div class="title">
|
887
|
-
<a name="
|
900
|
+
<a name="M000290"></a><b>each_char</b>() {|scanner.scan(char || break)| ...}
|
888
901
|
</div>
|
889
902
|
<div class="description">
|
890
903
|
<p>
|
@@ -894,8 +907,8 @@ appropriately.
|
|
894
907
|
</p>
|
895
908
|
</div>
|
896
909
|
<div class="sourcecode">
|
897
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
898
|
-
<div id="
|
910
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000290_source')" id="l_M000290_source">+</a> ]</p>
|
911
|
+
<div id="M000290_source" class="dyn-source">
|
899
912
|
<pre>
|
900
913
|
<span class="ruby-comment cmt"># File lib/core/facets/string/each_char.rb, line 22</span>
|
901
914
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_char</span>
|
@@ -908,7 +921,7 @@ appropriately.
|
|
908
921
|
</div>
|
909
922
|
<div class="method">
|
910
923
|
<div class="title">
|
911
|
-
<a name="
|
924
|
+
<a name="M000324"></a><b>each_word</b>(&block)
|
912
925
|
</div>
|
913
926
|
<div class="description">
|
914
927
|
<p>
|
@@ -919,8 +932,8 @@ Iterate through each word of a string.
|
|
919
932
|
</pre>
|
920
933
|
</div>
|
921
934
|
<div class="sourcecode">
|
922
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
923
|
-
<div id="
|
935
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000324_source')" id="l_M000324_source">+</a> ]</p>
|
936
|
+
<div id="M000324_source" class="dyn-source">
|
924
937
|
<pre>
|
925
938
|
<span class="ruby-comment cmt"># File lib/core/facets/string/each_word.rb, line 9</span>
|
926
939
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_word</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -932,7 +945,7 @@ Iterate through each word of a string.
|
|
932
945
|
</div>
|
933
946
|
<div class="method">
|
934
947
|
<div class="title">
|
935
|
-
<a name="
|
948
|
+
<a name="M000271"></a><b>end_with?</b>(suffix)
|
936
949
|
</div>
|
937
950
|
<div class="description">
|
938
951
|
<p>
|
@@ -947,8 +960,8 @@ CREDIT: Lucas Carlson, Blaine Cook
|
|
947
960
|
</p>
|
948
961
|
</div>
|
949
962
|
<div class="sourcecode">
|
950
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
951
|
-
<div id="
|
963
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000271_source')" id="l_M000271_source">+</a> ]</p>
|
964
|
+
<div id="M000271_source" class="dyn-source">
|
952
965
|
<pre>
|
953
966
|
<span class="ruby-comment cmt"># File lib/core/facets/string/start_with.rb, line 23</span>
|
954
967
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">end_with?</span>(<span class="ruby-identifier">suffix</span>)
|
@@ -960,7 +973,7 @@ CREDIT: Lucas Carlson, Blaine Cook
|
|
960
973
|
</div>
|
961
974
|
<div class="method">
|
962
975
|
<div class="title">
|
963
|
-
<a name="
|
976
|
+
<a name="M000297"></a><b>expand_tab</b>(n=8)
|
964
977
|
</div>
|
965
978
|
<div class="description">
|
966
979
|
<p>
|
@@ -980,11 +993,11 @@ CREDIT: Gavin Sinclair, Noah Gibbs, GGaramuno
|
|
980
993
|
</div>
|
981
994
|
<div class="aka">
|
982
995
|
This method is also aliased as
|
983
|
-
<a href="String.html#
|
996
|
+
<a href="String.html#M000298">expand_tabs</a>
|
984
997
|
</div>
|
985
998
|
<div class="sourcecode">
|
986
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
987
|
-
<div id="
|
999
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000297_source')" id="l_M000297_source">+</a> ]</p>
|
1000
|
+
<div id="M000297_source" class="dyn-source">
|
988
1001
|
<pre>
|
989
1002
|
<span class="ruby-comment cmt"># File lib/core/facets/string/expand_tab.rb, line 13</span>
|
990
1003
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expand_tab</span>(<span class="ruby-identifier">n</span>=<span class="ruby-value">8</span>)
|
@@ -1007,22 +1020,50 @@ CREDIT: Gavin Sinclair, Noah Gibbs, GGaramuno
|
|
1007
1020
|
</div>
|
1008
1021
|
<div class="method">
|
1009
1022
|
<div class="title">
|
1010
|
-
<a name="
|
1023
|
+
<a name="M000298"></a><b>expand_tabs</b>(n=8)
|
1011
1024
|
</div>
|
1012
1025
|
<div class="description">
|
1013
1026
|
<p>
|
1014
|
-
Alias for <a href="String.html#
|
1027
|
+
Alias for <a href="String.html#M000297">expand_tab</a>
|
1015
1028
|
</p>
|
1016
1029
|
</div>
|
1017
1030
|
</div>
|
1018
1031
|
<div class="method">
|
1019
1032
|
<div class="title">
|
1020
|
-
<a name="
|
1033
|
+
<a name="M000266"></a><b>file</b>()
|
1034
|
+
</div>
|
1035
|
+
<div class="description">
|
1036
|
+
<p>
|
1037
|
+
Use fluent notation for making <a href="String.html#M000266">file</a>
|
1038
|
+
directives.
|
1039
|
+
</p>
|
1040
|
+
<pre>
|
1041
|
+
'~/trans/Desktop/notes.txt'.file.mtime
|
1042
|
+
</pre>
|
1043
|
+
</div>
|
1044
|
+
<div class="sourcecode">
|
1045
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000266_source')" id="l_M000266_source">+</a> ]</p>
|
1046
|
+
<div id="M000266_source" class="dyn-source">
|
1047
|
+
<pre>
|
1048
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/file.rb, line 9</span>
|
1049
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">file</span>
|
1050
|
+
<span class="ruby-identifier">f</span> = <span class="ruby-keyword kw">self</span>
|
1051
|
+
<span class="ruby-constant">Functor</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">op</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
|
1052
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">op</span>, <span class="ruby-identifier">f</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">a</span>)
|
1053
|
+
<span class="ruby-keyword kw">end</span>
|
1054
|
+
<span class="ruby-keyword kw">end</span>
|
1055
|
+
</pre>
|
1056
|
+
</div>
|
1057
|
+
</div>
|
1058
|
+
</div>
|
1059
|
+
<div class="method">
|
1060
|
+
<div class="title">
|
1061
|
+
<a name="M000269"></a><b>fold</b>(ignore_indented=false)
|
1021
1062
|
</div>
|
1022
1063
|
<div class="description">
|
1023
1064
|
<p>
|
1024
|
-
Returns a new string with all new <a href="String.html#
|
1025
|
-
removed from adjacent <a href="String.html#
|
1065
|
+
Returns a new string with all new <a href="String.html#M000273">lines</a>
|
1066
|
+
removed from adjacent <a href="String.html#M000273">lines</a> of text.
|
1026
1067
|
</p>
|
1027
1068
|
<pre>
|
1028
1069
|
s = "This is\na test.\n\nIt clumps\nlines of text."
|
@@ -1043,8 +1084,8 @@ CREDIT: Trans
|
|
1043
1084
|
</p>
|
1044
1085
|
</div>
|
1045
1086
|
<div class="sourcecode">
|
1046
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1047
|
-
<div id="
|
1087
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000269_source')" id="l_M000269_source">+</a> ]</p>
|
1088
|
+
<div id="M000269_source" class="dyn-source">
|
1048
1089
|
<pre>
|
1049
1090
|
<span class="ruby-comment cmt"># File lib/core/facets/string/fold.rb, line 19</span>
|
1050
1091
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fold</span>(<span class="ruby-identifier">ignore_indented</span>=<span class="ruby-keyword kw">false</span>)
|
@@ -1071,21 +1112,21 @@ CREDIT: Trans
|
|
1071
1112
|
</div>
|
1072
1113
|
<div class="method">
|
1073
1114
|
<div class="title">
|
1074
|
-
<a name="
|
1115
|
+
<a name="M000303"></a><b>indent</b>(n)
|
1075
1116
|
</div>
|
1076
1117
|
<div class="description">
|
1077
1118
|
<p>
|
1078
1119
|
Indent left or right by n spaces. (This used to be called <a
|
1079
|
-
href="String.html#
|
1080
|
-
href="String.html#
|
1120
|
+
href="String.html#M000281">tab</a> and aliased as <a
|
1121
|
+
href="String.html#M000303">indent</a>.)
|
1081
1122
|
</p>
|
1082
1123
|
<p>
|
1083
1124
|
CREDIT: Gavin Sinclair, Trans
|
1084
1125
|
</p>
|
1085
1126
|
</div>
|
1086
1127
|
<div class="sourcecode">
|
1087
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1088
|
-
<div id="
|
1128
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000303_source')" id="l_M000303_source">+</a> ]</p>
|
1129
|
+
<div id="M000303_source" class="dyn-source">
|
1089
1130
|
<pre>
|
1090
1131
|
<span class="ruby-comment cmt"># File lib/core/facets/string/indent.rb, line 8</span>
|
1091
1132
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">indent</span>(<span class="ruby-identifier">n</span>)
|
@@ -1101,7 +1142,7 @@ CREDIT: Gavin Sinclair, Trans
|
|
1101
1142
|
</div>
|
1102
1143
|
<div class="method">
|
1103
1144
|
<div class="title">
|
1104
|
-
<a name="
|
1145
|
+
<a name="M000288"></a><b>index_all</b>(s, reuse=false)
|
1105
1146
|
</div>
|
1106
1147
|
<div class="description">
|
1107
1148
|
<p>
|
@@ -1120,8 +1161,8 @@ in general too.
|
|
1120
1161
|
</p>
|
1121
1162
|
</div>
|
1122
1163
|
<div class="sourcecode">
|
1123
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1124
|
-
<div id="
|
1164
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000288_source')" id="l_M000288_source">+</a> ]</p>
|
1165
|
+
<div id="M000288_source" class="dyn-source">
|
1125
1166
|
<pre>
|
1126
1167
|
<span class="ruby-comment cmt"># File lib/core/facets/string/range.rb, line 66</span>
|
1127
1168
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">index_all</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">reuse</span>=<span class="ruby-keyword kw">false</span>)
|
@@ -1139,7 +1180,7 @@ in general too.
|
|
1139
1180
|
</div>
|
1140
1181
|
<div class="method">
|
1141
1182
|
<div class="title">
|
1142
|
-
<a name="
|
1183
|
+
<a name="M000318"></a><b>lchomp</b>(match)
|
1143
1184
|
</div>
|
1144
1185
|
<div class="description">
|
1145
1186
|
<p>
|
@@ -1154,8 +1195,8 @@ CREDIT: Trans
|
|
1154
1195
|
</p>
|
1155
1196
|
</div>
|
1156
1197
|
<div class="sourcecode">
|
1157
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1158
|
-
<div id="
|
1198
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000318_source')" id="l_M000318_source">+</a> ]</p>
|
1199
|
+
<div id="M000318_source" class="dyn-source">
|
1159
1200
|
<pre>
|
1160
1201
|
<span class="ruby-comment cmt"># File lib/core/facets/string/chomp.rb, line 10</span>
|
1161
1202
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lchomp</span>(<span class="ruby-identifier">match</span>)
|
@@ -1171,7 +1212,7 @@ CREDIT: Trans
|
|
1171
1212
|
</div>
|
1172
1213
|
<div class="method">
|
1173
1214
|
<div class="title">
|
1174
|
-
<a name="
|
1215
|
+
<a name="M000319"></a><b>lchomp!</b>(match)
|
1175
1216
|
</div>
|
1176
1217
|
<div class="description">
|
1177
1218
|
<p>
|
@@ -1186,8 +1227,8 @@ CREDIT: Trans
|
|
1186
1227
|
</p>
|
1187
1228
|
</div>
|
1188
1229
|
<div class="sourcecode">
|
1189
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1190
|
-
<div id="
|
1230
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000319_source')" id="l_M000319_source">+</a> ]</p>
|
1231
|
+
<div id="M000319_source" class="dyn-source">
|
1191
1232
|
<pre>
|
1192
1233
|
<span class="ruby-comment cmt"># File lib/core/facets/string/chomp.rb, line 25</span>
|
1193
1234
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lchomp!</span>(<span class="ruby-identifier">match</span>)
|
@@ -1202,7 +1243,7 @@ CREDIT: Trans
|
|
1202
1243
|
</div>
|
1203
1244
|
<div class="method">
|
1204
1245
|
<div class="title">
|
1205
|
-
<a name="
|
1246
|
+
<a name="M000310"></a><b>line_wrap</b>(width, tabs=4)
|
1206
1247
|
</div>
|
1207
1248
|
<div class="description">
|
1208
1249
|
<p>
|
@@ -1223,8 +1264,8 @@ CREDIT: Trans
|
|
1223
1264
|
</p>
|
1224
1265
|
</div>
|
1225
1266
|
<div class="sourcecode">
|
1226
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1227
|
-
<div id="
|
1267
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000310_source')" id="l_M000310_source">+</a> ]</p>
|
1268
|
+
<div id="M000310_source" class="dyn-source">
|
1228
1269
|
<pre>
|
1229
1270
|
<span class="ruby-comment cmt"># File lib/core/facets/string/line_wrap.rb, line 14</span>
|
1230
1271
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">line_wrap</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">tabs</span>=<span class="ruby-value">4</span>)
|
@@ -1239,7 +1280,7 @@ CREDIT: Trans
|
|
1239
1280
|
</div>
|
1240
1281
|
<div class="method">
|
1241
1282
|
<div class="title">
|
1242
|
-
<a name="
|
1283
|
+
<a name="M000273"></a><b>lines</b>()
|
1243
1284
|
</div>
|
1244
1285
|
<div class="description">
|
1245
1286
|
<p>
|
@@ -1250,8 +1291,8 @@ Returns an array of characters.
|
|
1250
1291
|
</pre>
|
1251
1292
|
</div>
|
1252
1293
|
<div class="sourcecode">
|
1253
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1254
|
-
<div id="
|
1294
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000273_source')" id="l_M000273_source">+</a> ]</p>
|
1295
|
+
<div id="M000273_source" class="dyn-source">
|
1255
1296
|
<pre>
|
1256
1297
|
<span class="ruby-comment cmt"># File lib/core/facets/string/lines.rb, line 9</span>
|
1257
1298
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lines</span>
|
@@ -1263,11 +1304,11 @@ Returns an array of characters.
|
|
1263
1304
|
</div>
|
1264
1305
|
<div class="method">
|
1265
1306
|
<div class="title">
|
1266
|
-
<a name="
|
1307
|
+
<a name="M000292"></a><b>margin</b>(n=0)
|
1267
1308
|
</div>
|
1268
1309
|
<div class="description">
|
1269
1310
|
<p>
|
1270
|
-
Provides a <a href="String.html#
|
1311
|
+
Provides a <a href="String.html#M000292">margin</a> controlled string.
|
1271
1312
|
</p>
|
1272
1313
|
<pre>
|
1273
1314
|
x = %Q{
|
@@ -1284,8 +1325,8 @@ CREDIT: Trans
|
|
1284
1325
|
</p>
|
1285
1326
|
</div>
|
1286
1327
|
<div class="sourcecode">
|
1287
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1288
|
-
<div id="
|
1328
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000292_source')" id="l_M000292_source">+</a> ]</p>
|
1329
|
+
<div id="M000292_source" class="dyn-source">
|
1289
1330
|
<pre>
|
1290
1331
|
<span class="ruby-comment cmt"># File lib/core/facets/string/margin.rb, line 16</span>
|
1291
1332
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">margin</span>(<span class="ruby-identifier">n</span>=<span class="ruby-value">0</span>)
|
@@ -1306,7 +1347,7 @@ CREDIT: Trans
|
|
1306
1347
|
</div>
|
1307
1348
|
<div class="method">
|
1308
1349
|
<div class="title">
|
1309
|
-
<a name="
|
1350
|
+
<a name="M000282"></a><b>methodize</b>()
|
1310
1351
|
</div>
|
1311
1352
|
<div class="description">
|
1312
1353
|
<p>
|
@@ -1317,8 +1358,8 @@ Translate a (class or module) name to a suitable method name.
|
|
1317
1358
|
</pre>
|
1318
1359
|
</div>
|
1319
1360
|
<div class="sourcecode">
|
1320
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1321
|
-
<div id="
|
1361
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000282_source')" id="l_M000282_source">+</a> ]</p>
|
1362
|
+
<div id="M000282_source" class="dyn-source">
|
1322
1363
|
<pre>
|
1323
1364
|
<span class="ruby-comment cmt"># File lib/core/facets/string/methodize.rb, line 7</span>
|
1324
1365
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">methodize</span>
|
@@ -1334,14 +1375,14 @@ Translate a (class or module) name to a suitable method name.
|
|
1334
1375
|
</div>
|
1335
1376
|
<div class="method">
|
1336
1377
|
<div class="title">
|
1337
|
-
<a name="
|
1378
|
+
<a name="M000274"></a><b>modulize</b>()
|
1338
1379
|
</div>
|
1339
1380
|
<div class="description">
|
1340
1381
|
<p>
|
1341
1382
|
Converts a string to module name representation.
|
1342
1383
|
</p>
|
1343
1384
|
<p>
|
1344
|
-
This is essentially <a href="String.html#
|
1385
|
+
This is essentially <a href="String.html#M000272">camelcase</a>. It also
|
1345
1386
|
converts ’/’ to ’::’ which is useful for converting
|
1346
1387
|
paths to namespaces.
|
1347
1388
|
</p>
|
@@ -1354,8 +1395,8 @@ Examples
|
|
1354
1395
|
</pre>
|
1355
1396
|
</div>
|
1356
1397
|
<div class="sourcecode">
|
1357
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1358
|
-
<div id="
|
1398
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000274_source')" id="l_M000274_source">+</a> ]</p>
|
1399
|
+
<div id="M000274_source" class="dyn-source">
|
1359
1400
|
<pre>
|
1360
1401
|
<span class="ruby-comment cmt"># File lib/core/facets/string/modulize.rb, line 13</span>
|
1361
1402
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">modulize</span>
|
@@ -1370,7 +1411,7 @@ Examples
|
|
1370
1411
|
</div>
|
1371
1412
|
<div class="method">
|
1372
1413
|
<div class="title">
|
1373
|
-
<a name="
|
1414
|
+
<a name="M000293"></a><b>mscan</b>(re) {|| ...}
|
1374
1415
|
</div>
|
1375
1416
|
<div class="description">
|
1376
1417
|
<p>
|
@@ -1382,8 +1423,8 @@ CREDIT: Trans
|
|
1382
1423
|
</p>
|
1383
1424
|
</div>
|
1384
1425
|
<div class="sourcecode">
|
1385
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1386
|
-
<div id="
|
1426
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000293_source')" id="l_M000293_source">+</a> ]</p>
|
1427
|
+
<div id="M000293_source" class="dyn-source">
|
1387
1428
|
<pre>
|
1388
1429
|
<span class="ruby-comment cmt"># File lib/core/facets/string/mscan.rb, line 8</span>
|
1389
1430
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mscan</span>(<span class="ruby-identifier">re</span>) <span class="ruby-comment cmt">#:yield:</span>
|
@@ -1401,7 +1442,7 @@ CREDIT: Trans
|
|
1401
1442
|
</div>
|
1402
1443
|
<div class="method">
|
1403
1444
|
<div class="title">
|
1404
|
-
<a name="
|
1445
|
+
<a name="M000299"></a><b>natcmp</b>(str2, caseInsensitive=false)
|
1405
1446
|
</div>
|
1406
1447
|
<div class="description">
|
1407
1448
|
<p>
|
@@ -1424,8 +1465,8 @@ CREDIT: Alan Davies, Martin Pool
|
|
1424
1465
|
</p>
|
1425
1466
|
</div>
|
1426
1467
|
<div class="sourcecode">
|
1427
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1428
|
-
<div id="
|
1468
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000299_source')" id="l_M000299_source">+</a> ]</p>
|
1469
|
+
<div id="M000299_source" class="dyn-source">
|
1429
1470
|
<pre>
|
1430
1471
|
<span class="ruby-comment cmt"># File lib/core/facets/string/natcmp.rb, line 46</span>
|
1431
1472
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">natcmp</span>(<span class="ruby-identifier">str2</span>, <span class="ruby-identifier">caseInsensitive</span>=<span class="ruby-keyword kw">false</span>)
|
@@ -1476,7 +1517,7 @@ CREDIT: Alan Davies, Martin Pool
|
|
1476
1517
|
</div>
|
1477
1518
|
<div class="method">
|
1478
1519
|
<div class="title">
|
1479
|
-
<a name="
|
1520
|
+
<a name="M000322"></a><b>nchar</b>(n, replacement=nil)
|
1480
1521
|
</div>
|
1481
1522
|
<div class="description">
|
1482
1523
|
<p>
|
@@ -1496,8 +1537,8 @@ Alternatively a replacement string can be given, which will replace the
|
|
1496
1537
|
</pre>
|
1497
1538
|
</div>
|
1498
1539
|
<div class="sourcecode">
|
1499
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1500
|
-
<div id="
|
1540
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000322_source')" id="l_M000322_source">+</a> ]</p>
|
1541
|
+
<div id="M000322_source" class="dyn-source">
|
1501
1542
|
<pre>
|
1502
1543
|
<span class="ruby-comment cmt"># File lib/core/facets/string/nchar.rb, line 15</span>
|
1503
1544
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">nchar</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">replacement</span>=<span class="ruby-keyword kw">nil</span>)
|
@@ -1515,7 +1556,7 @@ Alternatively a replacement string can be given, which will replace the
|
|
1515
1556
|
</div>
|
1516
1557
|
<div class="method">
|
1517
1558
|
<div class="title">
|
1518
|
-
<a name="
|
1559
|
+
<a name="M000304"></a><b>outdent</b>(n)
|
1519
1560
|
</div>
|
1520
1561
|
<div class="description">
|
1521
1562
|
<p>
|
@@ -1526,8 +1567,8 @@ CREDIT: Noah Gibbs
|
|
1526
1567
|
</p>
|
1527
1568
|
</div>
|
1528
1569
|
<div class="sourcecode">
|
1529
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1530
|
-
<div id="
|
1570
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000304_source')" id="l_M000304_source">+</a> ]</p>
|
1571
|
+
<div id="M000304_source" class="dyn-source">
|
1531
1572
|
<pre>
|
1532
1573
|
<span class="ruby-comment cmt"># File lib/core/facets/string/indent.rb, line 20</span>
|
1533
1574
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">outdent</span>(<span class="ruby-identifier">n</span>)
|
@@ -1539,7 +1580,7 @@ CREDIT: Noah Gibbs
|
|
1539
1580
|
</div>
|
1540
1581
|
<div class="method">
|
1541
1582
|
<div class="title">
|
1542
|
-
<a name="
|
1583
|
+
<a name="M000302"></a><b>pathize</b>()
|
1543
1584
|
</div>
|
1544
1585
|
<div class="description">
|
1545
1586
|
<p>
|
@@ -1550,8 +1591,8 @@ Converts a (class or module) name to a unix path.
|
|
1550
1591
|
</pre>
|
1551
1592
|
</div>
|
1552
1593
|
<div class="sourcecode">
|
1553
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1554
|
-
<div id="
|
1594
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000302_source')" id="l_M000302_source">+</a> ]</p>
|
1595
|
+
<div id="M000302_source" class="dyn-source">
|
1555
1596
|
<pre>
|
1556
1597
|
<span class="ruby-comment cmt"># File lib/core/facets/string/pathize.rb, line 7</span>
|
1557
1598
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pathize</span>
|
@@ -1567,7 +1608,7 @@ Converts a (class or module) name to a unix path.
|
|
1567
1608
|
</div>
|
1568
1609
|
<div class="method">
|
1569
1610
|
<div class="title">
|
1570
|
-
<a name="
|
1611
|
+
<a name="M000315"></a><b>quote</b>(type=:s)
|
1571
1612
|
</div>
|
1572
1613
|
<div class="description">
|
1573
1614
|
<p>
|
@@ -1583,8 +1624,8 @@ CREDIT: Trans
|
|
1583
1624
|
</p>
|
1584
1625
|
</div>
|
1585
1626
|
<div class="sourcecode">
|
1586
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1587
|
-
<div id="
|
1627
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000315_source')" id="l_M000315_source">+</a> ]</p>
|
1628
|
+
<div id="M000315_source" class="dyn-source">
|
1588
1629
|
<pre>
|
1589
1630
|
<span class="ruby-comment cmt"># File lib/core/facets/string/bracket.rb, line 69</span>
|
1590
1631
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">quote</span>(<span class="ruby-identifier">type</span>=<span class="ruby-identifier">:s</span>)
|
@@ -1605,7 +1646,7 @@ CREDIT: Trans
|
|
1605
1646
|
</div>
|
1606
1647
|
<div class="method">
|
1607
1648
|
<div class="title">
|
1608
|
-
<a name="
|
1649
|
+
<a name="M000285"></a><b>range</b>(s, offset=0)
|
1609
1650
|
</div>
|
1610
1651
|
<div class="description">
|
1611
1652
|
<p>
|
@@ -1619,8 +1660,8 @@ CREDIT: Trans
|
|
1619
1660
|
</p>
|
1620
1661
|
</div>
|
1621
1662
|
<div class="sourcecode">
|
1622
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1623
|
-
<div id="
|
1663
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000285_source')" id="l_M000285_source">+</a> ]</p>
|
1664
|
+
<div id="M000285_source" class="dyn-source">
|
1624
1665
|
<pre>
|
1625
1666
|
<span class="ruby-comment cmt"># File lib/core/facets/string/range.rb, line 9</span>
|
1626
1667
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">range</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">offset</span>=<span class="ruby-value">0</span>)
|
@@ -1635,11 +1676,11 @@ CREDIT: Trans
|
|
1635
1676
|
</div>
|
1636
1677
|
<div class="method">
|
1637
1678
|
<div class="title">
|
1638
|
-
<a name="
|
1679
|
+
<a name="M000286"></a><b>range_all</b>(s, reuse=false)
|
1639
1680
|
</div>
|
1640
1681
|
<div class="description">
|
1641
1682
|
<p>
|
1642
|
-
Like <a href="String.html#
|
1683
|
+
Like <a href="String.html#M000288">index_all</a> but returns an array of
|
1643
1684
|
Ranges.
|
1644
1685
|
</p>
|
1645
1686
|
<pre>
|
@@ -1652,8 +1693,8 @@ CREDIT: Trans
|
|
1652
1693
|
</p>
|
1653
1694
|
</div>
|
1654
1695
|
<div class="sourcecode">
|
1655
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1656
|
-
<div id="
|
1696
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000286_source')" id="l_M000286_source">+</a> ]</p>
|
1697
|
+
<div id="M000286_source" class="dyn-source">
|
1657
1698
|
<pre>
|
1658
1699
|
<span class="ruby-comment cmt"># File lib/core/facets/string/range.rb, line 24</span>
|
1659
1700
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">range_all</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">reuse</span>=<span class="ruby-keyword kw">false</span>)
|
@@ -1675,7 +1716,7 @@ CREDIT: Trans
|
|
1675
1716
|
</div>
|
1676
1717
|
<div class="method">
|
1677
1718
|
<div class="title">
|
1678
|
-
<a name="
|
1719
|
+
<a name="M000287"></a><b>range_of_line</b>()
|
1679
1720
|
</div>
|
1680
1721
|
<div class="description">
|
1681
1722
|
<p>
|
@@ -1690,8 +1731,8 @@ CREDIT: Trans
|
|
1690
1731
|
</p>
|
1691
1732
|
</div>
|
1692
1733
|
<div class="sourcecode">
|
1693
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1694
|
-
<div id="
|
1734
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000287_source')" id="l_M000287_source">+</a> ]</p>
|
1735
|
+
<div id="M000287_source" class="dyn-source">
|
1695
1736
|
<pre>
|
1696
1737
|
<span class="ruby-comment cmt"># File lib/core/facets/string/range.rb, line 46</span>
|
1697
1738
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">range_of_line</span>
|
@@ -1708,7 +1749,7 @@ CREDIT: Trans
|
|
1708
1749
|
</div>
|
1709
1750
|
<div class="method">
|
1710
1751
|
<div class="title">
|
1711
|
-
<a name="
|
1752
|
+
<a name="M000321"></a><b>rewrite</b>(rules)
|
1712
1753
|
</div>
|
1713
1754
|
<div class="description">
|
1714
1755
|
<p>
|
@@ -1732,8 +1773,8 @@ CREDIT: George Moschovitis
|
|
1732
1773
|
</p>
|
1733
1774
|
</div>
|
1734
1775
|
<div class="sourcecode">
|
1735
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1736
|
-
<div id="
|
1776
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000321_source')" id="l_M000321_source">+</a> ]</p>
|
1777
|
+
<div id="M000321_source" class="dyn-source">
|
1737
1778
|
<pre>
|
1738
1779
|
<span class="ruby-comment cmt"># File lib/core/facets/string/rewrite.rb, line 18</span>
|
1739
1780
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rewrite</span>(<span class="ruby-identifier">rules</span>)
|
@@ -1750,7 +1791,7 @@ CREDIT: George Moschovitis
|
|
1750
1791
|
</div>
|
1751
1792
|
<div class="method">
|
1752
1793
|
<div class="title">
|
1753
|
-
<a name="
|
1794
|
+
<a name="M000265"></a><b>shatter</b>( re )
|
1754
1795
|
</div>
|
1755
1796
|
<div class="description">
|
1756
1797
|
<p>
|
@@ -1772,8 +1813,8 @@ CREDIT: Trans
|
|
1772
1813
|
</p>
|
1773
1814
|
</div>
|
1774
1815
|
<div class="sourcecode">
|
1775
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1776
|
-
<div id="
|
1816
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000265_source')" id="l_M000265_source">+</a> ]</p>
|
1817
|
+
<div id="M000265_source" class="dyn-source">
|
1777
1818
|
<pre>
|
1778
1819
|
<span class="ruby-comment cmt"># File lib/core/facets/string/shatter.rb, line 15</span>
|
1779
1820
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">shatter</span>( <span class="ruby-identifier">re</span> )
|
@@ -1788,12 +1829,12 @@ CREDIT: Trans
|
|
1788
1829
|
</div>
|
1789
1830
|
<div class="method">
|
1790
1831
|
<div class="title">
|
1791
|
-
<a name="
|
1832
|
+
<a name="M000289"></a><b>snakecase</b>()
|
1792
1833
|
</div>
|
1793
1834
|
<div class="description">
|
1794
1835
|
<p>
|
1795
|
-
The reverse of <tt><a href="String.html#
|
1796
|
-
an underscored of a <a href="String.html#
|
1836
|
+
The reverse of <tt><a href="String.html#M000272">camelcase</a></tt>. Makes
|
1837
|
+
an underscored of a <a href="String.html#M000272">camelcase</a> string.
|
1797
1838
|
</p>
|
1798
1839
|
<p>
|
1799
1840
|
Changes ’::’ to ’/’ to convert namespaces to paths.
|
@@ -1808,8 +1849,8 @@ Examples
|
|
1808
1849
|
</pre>
|
1809
1850
|
</div>
|
1810
1851
|
<div class="sourcecode">
|
1811
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1812
|
-
<div id="
|
1852
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000289_source')" id="l_M000289_source">+</a> ]</p>
|
1853
|
+
<div id="M000289_source" class="dyn-source">
|
1813
1854
|
<pre>
|
1814
1855
|
<span class="ruby-comment cmt"># File lib/core/facets/string/snakecase.rb, line 12</span>
|
1815
1856
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">snakecase</span>
|
@@ -1825,7 +1866,7 @@ Examples
|
|
1825
1866
|
</div>
|
1826
1867
|
<div class="method">
|
1827
1868
|
<div class="title">
|
1828
|
-
<a name="
|
1869
|
+
<a name="M000320"></a><b>splice</b>(idx, sub=nil)
|
1829
1870
|
</div>
|
1830
1871
|
<div class="description">
|
1831
1872
|
<p>
|
@@ -1849,8 +1890,8 @@ CREDIT: Trans
|
|
1849
1890
|
</p>
|
1850
1891
|
</div>
|
1851
1892
|
<div class="sourcecode">
|
1852
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1853
|
-
<div id="
|
1893
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000320_source')" id="l_M000320_source">+</a> ]</p>
|
1894
|
+
<div id="M000320_source" class="dyn-source">
|
1854
1895
|
<pre>
|
1855
1896
|
<span class="ruby-comment cmt"># File lib/core/facets/string/splice.rb, line 20</span>
|
1856
1897
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">splice</span>(<span class="ruby-identifier">idx</span>, <span class="ruby-identifier">sub</span>=<span class="ruby-keyword kw">nil</span>)
|
@@ -1871,7 +1912,7 @@ CREDIT: Trans
|
|
1871
1912
|
</div>
|
1872
1913
|
<div class="method">
|
1873
1914
|
<div class="title">
|
1874
|
-
<a name="
|
1915
|
+
<a name="M000270"></a><b>start_with?</b>(prefix)
|
1875
1916
|
</div>
|
1876
1917
|
<div class="description">
|
1877
1918
|
<p>
|
@@ -1886,8 +1927,8 @@ CREDIT: Lucas Carlson, Blaine Cook
|
|
1886
1927
|
</p>
|
1887
1928
|
</div>
|
1888
1929
|
<div class="sourcecode">
|
1889
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1890
|
-
<div id="
|
1930
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000270_source')" id="l_M000270_source">+</a> ]</p>
|
1931
|
+
<div id="M000270_source" class="dyn-source">
|
1891
1932
|
<pre>
|
1892
1933
|
<span class="ruby-comment cmt"># File lib/core/facets/string/start_with.rb, line 12</span>
|
1893
1934
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">prefix</span>)
|
@@ -1899,7 +1940,7 @@ CREDIT: Lucas Carlson, Blaine Cook
|
|
1899
1940
|
</div>
|
1900
1941
|
<div class="method">
|
1901
1942
|
<div class="title">
|
1902
|
-
<a name="
|
1943
|
+
<a name="M000281"></a><b>tab</b>(n)
|
1903
1944
|
</div>
|
1904
1945
|
<div class="description">
|
1905
1946
|
<p>
|
@@ -1910,8 +1951,8 @@ CREDIT: Gavin Sinclair
|
|
1910
1951
|
</p>
|
1911
1952
|
</div>
|
1912
1953
|
<div class="sourcecode">
|
1913
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1914
|
-
<div id="
|
1954
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000281_source')" id="l_M000281_source">+</a> ]</p>
|
1955
|
+
<div id="M000281_source" class="dyn-source">
|
1915
1956
|
<pre>
|
1916
1957
|
<span class="ruby-comment cmt"># File lib/core/facets/string/tab.rb, line 12</span>
|
1917
1958
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tab</span>(<span class="ruby-identifier">n</span>)
|
@@ -1923,7 +1964,7 @@ CREDIT: Gavin Sinclair
|
|
1923
1964
|
</div>
|
1924
1965
|
<div class="method">
|
1925
1966
|
<div class="title">
|
1926
|
-
<a name="
|
1967
|
+
<a name="M000306"></a><b>tabto</b>(n)
|
1927
1968
|
</div>
|
1928
1969
|
<div class="description">
|
1929
1970
|
<p>
|
@@ -1935,8 +1976,8 @@ CREDIT: Gavin Sinclair
|
|
1935
1976
|
</p>
|
1936
1977
|
</div>
|
1937
1978
|
<div class="sourcecode">
|
1938
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1939
|
-
<div id="
|
1979
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000306_source')" id="l_M000306_source">+</a> ]</p>
|
1980
|
+
<div id="M000306_source" class="dyn-source">
|
1940
1981
|
<pre>
|
1941
1982
|
<span class="ruby-comment cmt"># File lib/core/facets/string/tabto.rb, line 10</span>
|
1942
1983
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tabto</span>(<span class="ruby-identifier">n</span>)
|
@@ -1952,7 +1993,7 @@ CREDIT: Gavin Sinclair
|
|
1952
1993
|
</div>
|
1953
1994
|
<div class="method">
|
1954
1995
|
<div class="title">
|
1955
|
-
<a name="
|
1996
|
+
<a name="M000305"></a><b>titlecase</b>()
|
1956
1997
|
</div>
|
1957
1998
|
<div class="description">
|
1958
1999
|
<p>
|
@@ -1967,8 +2008,8 @@ CREDIT: Eliazar Parra
|
|
1967
2008
|
</p>
|
1968
2009
|
</div>
|
1969
2010
|
<div class="sourcecode">
|
1970
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1971
|
-
<div id="
|
2011
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000305_source')" id="l_M000305_source">+</a> ]</p>
|
2012
|
+
<div id="M000305_source" class="dyn-source">
|
1972
2013
|
<pre>
|
1973
2014
|
<span class="ruby-comment cmt"># File lib/core/facets/string/titlecase.rb, line 10</span>
|
1974
2015
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">titlecase</span>
|
@@ -1980,7 +2021,7 @@ CREDIT: Eliazar Parra
|
|
1980
2021
|
</div>
|
1981
2022
|
<div class="method">
|
1982
2023
|
<div class="title">
|
1983
|
-
<a name="
|
2024
|
+
<a name="M000263"></a><b>to_b</b>()
|
1984
2025
|
</div>
|
1985
2026
|
<div class="description">
|
1986
2027
|
<p>
|
@@ -2002,8 +2043,8 @@ Examples:
|
|
2002
2043
|
</pre>
|
2003
2044
|
</div>
|
2004
2045
|
<div class="sourcecode">
|
2005
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2006
|
-
<div id="
|
2046
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000263_source')" id="l_M000263_source">+</a> ]</p>
|
2047
|
+
<div id="M000263_source" class="dyn-source">
|
2007
2048
|
<pre>
|
2008
2049
|
<span class="ruby-comment cmt"># File lib/core/facets/boolean.rb, line 43</span>
|
2009
2050
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_b</span>
|
@@ -2022,7 +2063,7 @@ Examples:
|
|
2022
2063
|
</div>
|
2023
2064
|
<div class="method">
|
2024
2065
|
<div class="title">
|
2025
|
-
<a name="
|
2066
|
+
<a name="M000267"></a><b>to_re</b>(esc=false)
|
2026
2067
|
</div>
|
2027
2068
|
<div class="description">
|
2028
2069
|
<p>
|
@@ -2036,8 +2077,8 @@ CREDIT: Trans
|
|
2036
2077
|
</p>
|
2037
2078
|
</div>
|
2038
2079
|
<div class="sourcecode">
|
2039
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2040
|
-
<div id="
|
2080
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000267_source')" id="l_M000267_source">+</a> ]</p>
|
2081
|
+
<div id="M000267_source" class="dyn-source">
|
2041
2082
|
<pre>
|
2042
2083
|
<span class="ruby-comment cmt"># File lib/core/facets/string/to_re.rb, line 9</span>
|
2043
2084
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_re</span>(<span class="ruby-identifier">esc</span>=<span class="ruby-keyword kw">false</span>)
|
@@ -2049,7 +2090,7 @@ CREDIT: Trans
|
|
2049
2090
|
</div>
|
2050
2091
|
<div class="method">
|
2051
2092
|
<div class="title">
|
2052
|
-
<a name="
|
2093
|
+
<a name="M000268"></a><b>to_rx</b>(esc=true)
|
2053
2094
|
</div>
|
2054
2095
|
<div class="description">
|
2055
2096
|
<p>
|
@@ -2064,8 +2105,8 @@ CREDIT: Trans
|
|
2064
2105
|
</p>
|
2065
2106
|
</div>
|
2066
2107
|
<div class="sourcecode">
|
2067
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2068
|
-
<div id="
|
2108
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000268_source')" id="l_M000268_source">+</a> ]</p>
|
2109
|
+
<div id="M000268_source" class="dyn-source">
|
2069
2110
|
<pre>
|
2070
2111
|
<span class="ruby-comment cmt"># File lib/core/facets/string/to_re.rb, line 21</span>
|
2071
2112
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_rx</span>(<span class="ruby-identifier">esc</span>=<span class="ruby-keyword kw">true</span>)
|
@@ -2077,12 +2118,12 @@ CREDIT: Trans
|
|
2077
2118
|
</div>
|
2078
2119
|
<div class="method">
|
2079
2120
|
<div class="title">
|
2080
|
-
<a name="
|
2121
|
+
<a name="M000313"></a><b>unbracket</b>(bra=nil, ket=nil)
|
2081
2122
|
</div>
|
2082
2123
|
<div class="description">
|
2083
2124
|
<p>
|
2084
2125
|
Return a new string embraced by given brakets. If only one <a
|
2085
|
-
href="String.html#
|
2126
|
+
href="String.html#M000311">bracket</a> char is given it will be placed on
|
2086
2127
|
either side.
|
2087
2128
|
</p>
|
2088
2129
|
<pre>
|
@@ -2094,8 +2135,8 @@ CREDIT: Trans
|
|
2094
2135
|
</p>
|
2095
2136
|
</div>
|
2096
2137
|
<div class="sourcecode">
|
2097
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2098
|
-
<div id="
|
2138
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000313_source')" id="l_M000313_source">+</a> ]</p>
|
2139
|
+
<div id="M000313_source" class="dyn-source">
|
2099
2140
|
<pre>
|
2100
2141
|
<span class="ruby-comment cmt"># File lib/core/facets/string/bracket.rb, line 37</span>
|
2101
2142
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unbracket</span>(<span class="ruby-identifier">bra</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">ket</span>=<span class="ruby-keyword kw">nil</span>)
|
@@ -2119,7 +2160,7 @@ CREDIT: Trans
|
|
2119
2160
|
</div>
|
2120
2161
|
<div class="method">
|
2121
2162
|
<div class="title">
|
2122
|
-
<a name="
|
2163
|
+
<a name="M000314"></a><b>unbracket!</b>(bra=nil, ket=nil)
|
2123
2164
|
</div>
|
2124
2165
|
<div class="description">
|
2125
2166
|
<p>
|
@@ -2130,8 +2171,8 @@ CREDIT: Trans
|
|
2130
2171
|
</p>
|
2131
2172
|
</div>
|
2132
2173
|
<div class="sourcecode">
|
2133
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2134
|
-
<div id="
|
2174
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000314_source')" id="l_M000314_source">+</a> ]</p>
|
2175
|
+
<div id="M000314_source" class="dyn-source">
|
2135
2176
|
<pre>
|
2136
2177
|
<span class="ruby-comment cmt"># File lib/core/facets/string/bracket.rb, line 57</span>
|
2137
2178
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unbracket!</span>(<span class="ruby-identifier">bra</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">ket</span>=<span class="ruby-keyword kw">nil</span>)
|
@@ -2143,7 +2184,7 @@ CREDIT: Trans
|
|
2143
2184
|
</div>
|
2144
2185
|
<div class="method">
|
2145
2186
|
<div class="title">
|
2146
|
-
<a name="
|
2187
|
+
<a name="M000296"></a><b>upcase?</b>()
|
2147
2188
|
</div>
|
2148
2189
|
<div class="description">
|
2149
2190
|
<p>
|
@@ -2159,8 +2200,8 @@ CREDIT: Phil Tomson
|
|
2159
2200
|
</p>
|
2160
2201
|
</div>
|
2161
2202
|
<div class="sourcecode">
|
2162
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2163
|
-
<div id="
|
2203
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000296_source')" id="l_M000296_source">+</a> ]</p>
|
2204
|
+
<div id="M000296_source" class="dyn-source">
|
2164
2205
|
<pre>
|
2165
2206
|
<span class="ruby-comment cmt"># File lib/core/facets/string/capitalized.rb, line 38</span>
|
2166
2207
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">upcase?</span>
|
@@ -2172,7 +2213,7 @@ CREDIT: Phil Tomson
|
|
2172
2213
|
</div>
|
2173
2214
|
<div class="method">
|
2174
2215
|
<div class="title">
|
2175
|
-
<a name="
|
2216
|
+
<a name="M000300"></a><b>variablize</b>()
|
2176
2217
|
</div>
|
2177
2218
|
<div class="description">
|
2178
2219
|
<p>
|
@@ -2181,8 +2222,8 @@ variable name. This also replaces non-valid characters with underscores.
|
|
2181
2222
|
</p>
|
2182
2223
|
</div>
|
2183
2224
|
<div class="sourcecode">
|
2184
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2185
|
-
<div id="
|
2225
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000300_source')" id="l_M000300_source">+</a> ]</p>
|
2226
|
+
<div id="M000300_source" class="dyn-source">
|
2186
2227
|
<pre>
|
2187
2228
|
<span class="ruby-comment cmt"># File lib/core/facets/string/variablize.rb, line 7</span>
|
2188
2229
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">variablize</span>
|
@@ -2195,7 +2236,7 @@ variable name. This also replaces non-valid characters with underscores.
|
|
2195
2236
|
</div>
|
2196
2237
|
<div class="method">
|
2197
2238
|
<div class="title">
|
2198
|
-
<a name="
|
2239
|
+
<a name="M000275"></a><b>word_wrap</b>( col_width=80 )
|
2199
2240
|
</div>
|
2200
2241
|
<div class="description">
|
2201
2242
|
<p>
|
@@ -2221,8 +2262,8 @@ CREDIT: Gavin Kistner, Dayne Broderson
|
|
2221
2262
|
</p>
|
2222
2263
|
</div>
|
2223
2264
|
<div class="sourcecode">
|
2224
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2225
|
-
<div id="
|
2265
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000275_source')" id="l_M000275_source">+</a> ]</p>
|
2266
|
+
<div id="M000275_source" class="dyn-source">
|
2226
2267
|
<pre>
|
2227
2268
|
<span class="ruby-comment cmt"># File lib/core/facets/string/word_wrap.rb, line 18</span>
|
2228
2269
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">word_wrap</span>( <span class="ruby-identifier">col_width</span>=<span class="ruby-value">80</span> )
|
@@ -2234,11 +2275,11 @@ CREDIT: Gavin Kistner, Dayne Broderson
|
|
2234
2275
|
</div>
|
2235
2276
|
<div class="method">
|
2236
2277
|
<div class="title">
|
2237
|
-
<a name="
|
2278
|
+
<a name="M000276"></a><b>word_wrap!</b>( col_width=80 )
|
2238
2279
|
</div>
|
2239
2280
|
<div class="description">
|
2240
2281
|
<p>
|
2241
|
-
As with <a href="String.html#
|
2282
|
+
As with <a href="String.html#M000275">word_wrap</a>, but modifies the
|
2242
2283
|
string in place.
|
2243
2284
|
</p>
|
2244
2285
|
<p>
|
@@ -2246,8 +2287,8 @@ CREDIT: Gavin Kistner, Dayne Broderson
|
|
2246
2287
|
</p>
|
2247
2288
|
</div>
|
2248
2289
|
<div class="sourcecode">
|
2249
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2250
|
-
<div id="
|
2290
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000276_source')" id="l_M000276_source">+</a> ]</p>
|
2291
|
+
<div id="M000276_source" class="dyn-source">
|
2251
2292
|
<pre>
|
2252
2293
|
<span class="ruby-comment cmt"># File lib/core/facets/string/word_wrap.rb, line 26</span>
|
2253
2294
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">word_wrap!</span>( <span class="ruby-identifier">col_width</span>=<span class="ruby-value">80</span> )
|
@@ -2261,7 +2302,7 @@ CREDIT: Gavin Kistner, Dayne Broderson
|
|
2261
2302
|
</div>
|
2262
2303
|
<div class="method">
|
2263
2304
|
<div class="title">
|
2264
|
-
<a name="
|
2305
|
+
<a name="M000307"></a><b>words</b>()
|
2265
2306
|
</div>
|
2266
2307
|
<div class="description">
|
2267
2308
|
<p>
|
@@ -2272,8 +2313,8 @@ Returns an array of characters.
|
|
2272
2313
|
</pre>
|
2273
2314
|
</div>
|
2274
2315
|
<div class="sourcecode">
|
2275
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2276
|
-
<div id="
|
2316
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000307_source')" id="l_M000307_source">+</a> ]</p>
|
2317
|
+
<div id="M000307_source" class="dyn-source">
|
2277
2318
|
<pre>
|
2278
2319
|
<span class="ruby-comment cmt"># File lib/core/facets/string/words.rb, line 7</span>
|
2279
2320
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">words</span>
|