doc/atomic-rdoc/classes/String.src/M000239.html in facets-0.7.1 vs doc/atomic-rdoc/classes/String.src/M000239.html in facets-0.7.2
- old
+ new
@@ -3,16 +3,20 @@
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
- <title>humanize (String)</title>
+ <title>camelcase (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/humanize.rb, line 2</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">humanize</span> <span class="ruby-comment cmt">#(lower_case_and_underscored_word)</span>
- <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/_/</span>, <span class="ruby-value str">" "</span>).<span class="ruby-identifier">capitalize</span>
+ <pre><span class="ruby-comment cmt"># File lib/facet/string/camelcase.rb, line 16</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">camelcase</span>(<span class="ruby-identifier">first</span>=<span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">on</span>=<span class="ruby-value str">'_\s'</span>)
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">first</span>
+ <span class="ruby-identifier">gsub</span>(<span class="ruby-node">/(^|[#{on}]+)([A-Za-z])/</span>){ <span class="ruby-identifier">$2</span>.<span class="ruby-identifier">upcase</span> }
+ <span class="ruby-keyword kw">else</span>
+ <span class="ruby-identifier">gsub</span>(<span class="ruby-node">/([#{on}]+)([A-Za-z])/</span>){ <span class="ruby-identifier">$2</span>.<span class="ruby-identifier">upcase</span> }
+ <span class="ruby-keyword kw">end</span>
<span class="ruby-keyword kw">end</span></pre>
</body>
</html>
\ No newline at end of file