doc/atomic-rdoc/classes/String.src/M000242.html in facets-0.7.1 vs doc/atomic-rdoc/classes/String.src/M000242.html in facets-0.7.2
- old
+ new
@@ -3,20 +3,26 @@
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
- <title>margin (String)</title>
+ <title>clump (String)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
- <pre><span class="ruby-comment cmt"># File lib/facet/string/margin.rb, line 15</span>
- <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>,<span class="ruby-identifier">d</span>=<span class="ruby-value str">'|'</span>)
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">n</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
- <span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\n\s*\Z/</span>,<span class="ruby-value str">''</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/^\s*[#{d}]/</span>, <span class="ruby-value str">''</span>)
- <span class="ruby-keyword kw">else</span>
- <span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\n\s*\Z/</span>,<span class="ruby-value str">''</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/^\s*[#{d}]/</span>, <span class="ruby-value str">' '</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">n</span>)
- <span class="ruby-keyword kw">end</span>
+ <pre><span class="ruby-comment cmt"># File lib/facet/string/clump.rb, line 19</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clump</span>
+ <span class="ruby-identifier">ns</span> = <span class="ruby-value str">''</span>
+ <span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
+ <span class="ruby-identifier">br</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/(\n\s*\n|\Z)/</span><span class="ruby-identifier">m</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">b</span> = <span class="ruby-identifier">$~</span>.<span class="ruby-identifier">begin</span>(<span class="ruby-value">1</span>)
+ <span class="ruby-identifier">e</span> = <span class="ruby-identifier">$~</span>.<span class="ruby-identifier">end</span>(<span class="ruby-value">1</span>)
+ <span class="ruby-identifier">nl</span> = <span class="ruby-identifier">$&</span>
+ <span class="ruby-identifier">ns</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">i</span><span class="ruby-operator">...</span><span class="ruby-identifier">b</span>].<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/[ ]*\n+/</span>,<span class="ruby-value str">' '</span>)
+ <span class="ruby-identifier">ns</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">nl</span>
+ <span class="ruby-identifier">i</span> = <span class="ruby-identifier">e</span>
+ }
+ <span class="ruby-identifier">ns</span>
<span class="ruby-keyword kw">end</span></pre>
</body>
</html>
\ No newline at end of file