formattedstring 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/doc/classes/Enumerable.html +10 -10
- data/doc/classes/Enumerable.src/M000026.html +6 -19
- data/doc/classes/Enumerable.src/M000027.html +34 -0
- data/doc/classes/FormattedString/Formats/Xml.html +16 -1
- data/doc/classes/FormattedString/Formats/Xml.src/M000004.html +3 -34
- data/doc/classes/FormattedString/Formats/Xml.src/M000005.html +49 -0
- data/doc/classes/Inflector/Inflections.html +40 -40
- data/doc/classes/Inflector/Inflections.src/M000020.html +4 -4
- data/doc/classes/Inflector/Inflections.src/M000021.html +4 -4
- data/doc/classes/Inflector/Inflections.src/M000022.html +4 -12
- data/doc/classes/Inflector/Inflections.src/M000023.html +12 -4
- data/doc/classes/Inflector/Inflections.src/M000024.html +4 -9
- data/doc/classes/Inflector/Inflections.src/M000025.html +23 -0
- data/doc/classes/Inflector.html +82 -82
- data/doc/classes/Inflector.src/M000006.html +6 -9
- data/doc/classes/Inflector.src/M000007.html +5 -5
- data/doc/classes/Inflector.src/M000008.html +9 -6
- data/doc/classes/Inflector.src/M000009.html +8 -4
- data/doc/classes/Inflector.src/M000010.html +4 -8
- data/doc/classes/Inflector.src/M000011.html +8 -4
- data/doc/classes/Inflector.src/M000012.html +4 -4
- data/doc/classes/Inflector.src/M000013.html +4 -4
- data/doc/classes/Inflector.src/M000014.html +4 -4
- data/doc/classes/Inflector.src/M000015.html +4 -5
- data/doc/classes/Inflector.src/M000016.html +5 -4
- data/doc/classes/Inflector.src/M000017.html +4 -8
- data/doc/classes/Inflector.src/M000018.html +7 -12
- data/doc/classes/Inflector.src/M000019.html +27 -0
- data/doc/created.rid +1 -1
- data/doc/files/lib/formatted_string/formats/xml_rb.html +1 -1
- data/doc/fr_method_index.html +24 -23
- data/lib/formatted_string/formats/xml.rb +4 -0
- metadata +6 -5
- data/doc/classes/Enumerable.src/M000025.html +0 -21
- data/doc/classes/Inflector/Inflections.src/M000019.html +0 -18
- data/doc/classes/Inflector.src/M000005.html +0 -22
@@ -5,20 +5,17 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>inflections (Inflector)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
16
|
-
|
17
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">word</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">inflections</span>.<span class="ruby-identifier">uncountables</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">result</span>.<span class="ruby-identifier">downcase</span>)
|
18
|
-
<span class="ruby-identifier">result</span>
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line 89</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inflections</span>
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
16
|
+
<span class="ruby-keyword kw">yield</span> <span class="ruby-constant">Inflections</span>.<span class="ruby-identifier">instance</span>
|
19
17
|
<span class="ruby-keyword kw">else</span>
|
20
|
-
<span class="ruby-
|
21
|
-
<span class="ruby-identifier">result</span>
|
18
|
+
<span class="ruby-constant">Inflections</span>.<span class="ruby-identifier">instance</span>
|
22
19
|
<span class="ruby-keyword kw">end</span>
|
23
20
|
<span class="ruby-keyword kw">end</span></pre>
|
24
21
|
</body>
|
@@ -5,19 +5,19 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>pluralize (Inflector)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line 106</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pluralize</span>(<span class="ruby-identifier">word</span>)
|
15
15
|
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">word</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">dup</span>
|
16
16
|
|
17
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">inflections</span>.<span class="ruby-identifier">uncountables</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">result</span>.<span class="ruby-identifier">downcase</span>)
|
17
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">word</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">inflections</span>.<span class="ruby-identifier">uncountables</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">result</span>.<span class="ruby-identifier">downcase</span>)
|
18
18
|
<span class="ruby-identifier">result</span>
|
19
19
|
<span class="ruby-keyword kw">else</span>
|
20
|
-
<span class="ruby-identifier">inflections</span>.<span class="ruby-identifier">
|
20
|
+
<span class="ruby-identifier">inflections</span>.<span class="ruby-identifier">plurals</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>)<span class="ruby-operator">|</span> <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>) }
|
21
21
|
<span class="ruby-identifier">result</span>
|
22
22
|
<span class="ruby-keyword kw">end</span>
|
23
23
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -5,17 +5,20 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>singularize (Inflector)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
16
|
-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line 126</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">singularize</span>(<span class="ruby-identifier">word</span>)
|
15
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">word</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">dup</span>
|
16
|
+
|
17
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">inflections</span>.<span class="ruby-identifier">uncountables</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">result</span>.<span class="ruby-identifier">downcase</span>)
|
18
|
+
<span class="ruby-identifier">result</span>
|
17
19
|
<span class="ruby-keyword kw">else</span>
|
18
|
-
<span class="ruby-identifier">
|
20
|
+
<span class="ruby-identifier">inflections</span>.<span class="ruby-identifier">singulars</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>)<span class="ruby-operator">|</span> <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-identifier">replacement</span>) }
|
21
|
+
<span class="ruby-identifier">result</span>
|
19
22
|
<span class="ruby-keyword kw">end</span>
|
20
23
|
<span class="ruby-keyword kw">end</span></pre>
|
21
24
|
</body>
|
@@ -5,14 +5,18 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>camelize (Inflector)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line 147</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">camelize</span>(<span class="ruby-identifier">lower_case_and_underscored_word</span>, <span class="ruby-identifier">first_letter_in_uppercase</span> = <span class="ruby-keyword kw">true</span>)
|
15
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">first_letter_in_uppercase</span>
|
16
|
+
<span class="ruby-identifier">lower_case_and_underscored_word</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-operator">+</span> <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">upcase</span> }.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/(^|_)(.)/</span>) { <span class="ruby-identifier">$2</span>.<span class="ruby-identifier">upcase</span> }
|
17
|
+
<span class="ruby-keyword kw">else</span>
|
18
|
+
<span class="ruby-identifier">lower_case_and_underscored_word</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">camelize</span>(<span class="ruby-identifier">lower_case_and_underscored_word</span>)[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
|
19
|
+
<span class="ruby-keyword kw">end</span>
|
16
20
|
<span class="ruby-keyword kw">end</span></pre>
|
17
21
|
</body>
|
18
22
|
</html>
|
@@ -5,18 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>titleize (Inflector)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-identifier">
|
16
|
-
<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/([A-Z]+)([A-Z][a-z])/</span>,<span class="ruby-value str">'\1_\2'</span>).
|
17
|
-
<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/([a-z\d])([A-Z])/</span>,<span class="ruby-value str">'\1_\2'</span>).
|
18
|
-
<span class="ruby-identifier">tr</span>(<span class="ruby-value str">"-"</span>, <span class="ruby-value str">"_"</span>).
|
19
|
-
<span class="ruby-identifier">downcase</span>
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line 164</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">titleize</span>(<span class="ruby-identifier">word</span>)
|
15
|
+
<span class="ruby-identifier">humanize</span>(<span class="ruby-identifier">underscore</span>(<span class="ruby-identifier">word</span>)).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\b([a-z])/</span>) { <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">capitalize</span> }
|
20
16
|
<span class="ruby-keyword kw">end</span></pre>
|
21
17
|
</body>
|
22
18
|
</html>
|
@@ -5,14 +5,18 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>underscore (Inflector)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-identifier">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line 175</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">underscore</span>(<span class="ruby-identifier">camel_cased_word</span>)
|
15
|
+
<span class="ruby-identifier">camel_cased_word</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>).
|
16
|
+
<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/([A-Z]+)([A-Z][a-z])/</span>,<span class="ruby-value str">'\1_\2'</span>).
|
17
|
+
<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/([a-z\d])([A-Z])/</span>,<span class="ruby-value str">'\1_\2'</span>).
|
18
|
+
<span class="ruby-identifier">tr</span>(<span class="ruby-value str">"-"</span>, <span class="ruby-value str">"_"</span>).
|
19
|
+
<span class="ruby-identifier">downcase</span>
|
16
20
|
<span class="ruby-keyword kw">end</span></pre>
|
17
21
|
</body>
|
18
22
|
</html>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>dasherize (Inflector)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-identifier">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line 187</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dasherize</span>(<span class="ruby-identifier">underscored_word</span>)
|
15
|
+
<span class="ruby-identifier">underscored_word</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/_/</span>, <span class="ruby-value str">'-'</span>)
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>humanize (Inflector)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-identifier">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line 197</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">humanize</span>(<span class="ruby-identifier">lower_case_and_underscored_word</span>)
|
15
|
+
<span class="ruby-identifier">lower_case_and_underscored_word</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/_id$/</span>, <span class="ruby-value str">""</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>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>demodulize (Inflector)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-identifier">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line 206</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">demodulize</span>(<span class="ruby-identifier">class_name_in_module</span>)
|
15
|
+
<span class="ruby-identifier">class_name_in_module</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>)
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -5,15 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>tableize (Inflector)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
16
|
-
<span class="ruby-identifier">camelize</span>(<span class="ruby-identifier">singularize</span>(<span class="ruby-identifier">table_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/.*\./</span>, <span class="ruby-value str">''</span>)))
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line 217</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tableize</span>(<span class="ruby-identifier">class_name</span>)
|
15
|
+
<span class="ruby-identifier">pluralize</span>(<span class="ruby-identifier">underscore</span>(<span class="ruby-identifier">class_name</span>))
|
17
16
|
<span class="ruby-keyword kw">end</span></pre>
|
18
17
|
</body>
|
19
18
|
</html>
|
@@ -5,14 +5,15 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>classify (Inflector)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line 228</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">classify</span>(<span class="ruby-identifier">table_name</span>)
|
15
|
+
<span class="ruby-comment cmt"># strip out any leading schema name</span>
|
16
|
+
<span class="ruby-identifier">camelize</span>(<span class="ruby-identifier">singularize</span>(<span class="ruby-identifier">table_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/.*\./</span>, <span class="ruby-value str">''</span>)))
|
16
17
|
<span class="ruby-keyword kw">end</span></pre>
|
17
18
|
</body>
|
18
19
|
</html>
|
@@ -5,18 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>foreign_key (Inflector)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
16
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">NameError</span>, <span class="ruby-node">"#{camel_cased_word.inspect} is not a valid constant name!"</span>
|
17
|
-
<span class="ruby-keyword kw">end</span>
|
18
|
-
|
19
|
-
<span class="ruby-constant">Object</span>.<span class="ruby-identifier">module_eval</span>(<span class="ruby-node">"::#{$1}"</span>, <span class="ruby-keyword kw">__FILE__</span>, <span class="ruby-keyword kw">__LINE__</span>)
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line 241</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">foreign_key</span>(<span class="ruby-identifier">class_name</span>, <span class="ruby-identifier">separate_class_name_and_id_with_underscore</span> = <span class="ruby-keyword kw">true</span>)
|
15
|
+
<span class="ruby-identifier">underscore</span>(<span class="ruby-identifier">demodulize</span>(<span class="ruby-identifier">class_name</span>)) <span class="ruby-operator">+</span> (<span class="ruby-identifier">separate_class_name_and_id_with_underscore</span> <span class="ruby-value">? </span><span class="ruby-value str">"_id"</span> <span class="ruby-operator">:</span> <span class="ruby-value str">"id"</span>)
|
20
16
|
<span class="ruby-keyword kw">end</span></pre>
|
21
17
|
</body>
|
22
18
|
</html>
|
@@ -5,23 +5,18 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>constantize (Inflector)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-keyword kw">
|
16
|
-
<span class="ruby-node">"#{
|
17
|
-
<span class="ruby-keyword kw">else</span>
|
18
|
-
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">number</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">%</span> <span class="ruby-value">10</span>
|
19
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>; <span class="ruby-node">"#{number}st"</span>
|
20
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span>; <span class="ruby-node">"#{number}nd"</span>
|
21
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-value">3</span>; <span class="ruby-node">"#{number}rd"</span>
|
22
|
-
<span class="ruby-keyword kw">else</span> <span class="ruby-node">"#{number}th"</span>
|
23
|
-
<span class="ruby-keyword kw">end</span>
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line 252</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">constantize</span>(<span class="ruby-identifier">camel_cased_word</span>)
|
15
|
+
<span class="ruby-keyword kw">unless</span> <span class="ruby-regexp re">/\A(?:::)?([A-Z]\w*(?:::[A-Z]\w*)*)\z/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">camel_cased_word</span>
|
16
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">NameError</span>, <span class="ruby-node">"#{camel_cased_word.inspect} is not a valid constant name!"</span>
|
24
17
|
<span class="ruby-keyword kw">end</span>
|
18
|
+
|
19
|
+
<span class="ruby-constant">Object</span>.<span class="ruby-identifier">module_eval</span>(<span class="ruby-node">"::#{$1}"</span>, <span class="ruby-keyword kw">__FILE__</span>, <span class="ruby-keyword kw">__LINE__</span>)
|
25
20
|
<span class="ruby-keyword kw">end</span></pre>
|
26
21
|
</body>
|
27
22
|
</html>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>ordinalize (Inflector)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/inflector.rb, line 268</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ordinalize</span>(<span class="ruby-identifier">number</span>)
|
15
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-value">11</span><span class="ruby-operator">..</span><span class="ruby-value">13</span>).<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">number</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">%</span> <span class="ruby-value">100</span>)
|
16
|
+
<span class="ruby-node">"#{number}th"</span>
|
17
|
+
<span class="ruby-keyword kw">else</span>
|
18
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">number</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">%</span> <span class="ruby-value">10</span>
|
19
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>; <span class="ruby-node">"#{number}st"</span>
|
20
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span>; <span class="ruby-node">"#{number}nd"</span>
|
21
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value">3</span>; <span class="ruby-node">"#{number}rd"</span>
|
22
|
+
<span class="ruby-keyword kw">else</span> <span class="ruby-node">"#{number}th"</span>
|
23
|
+
<span class="ruby-keyword kw">end</span>
|
24
|
+
<span class="ruby-keyword kw">end</span>
|
25
|
+
<span class="ruby-keyword kw">end</span></pre>
|
26
|
+
</body>
|
27
|
+
</html>
|
data/doc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Thu, 20 Mar 2008 16:58:06 -0400
|
data/doc/fr_method_index.html
CHANGED
@@ -20,32 +20,33 @@
|
|
20
20
|
<div id="index">
|
21
21
|
<h1 class="section-bar">Methods</h1>
|
22
22
|
<div id="index-entries">
|
23
|
-
<a href="classes/
|
24
|
-
<a href="classes/Inflector.html#
|
25
|
-
<a href="classes/Inflector
|
26
|
-
<a href="classes/Inflector.html#
|
27
|
-
<a href="classes/
|
28
|
-
<a href="classes/
|
29
|
-
<a href="classes/Inflector.html#
|
30
|
-
<a href="classes/Inflector.html#
|
23
|
+
<a href="classes/FormattedString/Formats/Xml.html#M000004">=== (FormattedString::Formats::Xml)</a><br />
|
24
|
+
<a href="classes/Inflector.html#M000009">camelize (Inflector)</a><br />
|
25
|
+
<a href="classes/Inflector.html#M000016">classify (Inflector)</a><br />
|
26
|
+
<a href="classes/Inflector/Inflections.html#M000025">clear (Inflector::Inflections)</a><br />
|
27
|
+
<a href="classes/Inflector.html#M000018">constantize (Inflector)</a><br />
|
28
|
+
<a href="classes/Enumerable.html#M000027">crawl (Enumerable)</a><br />
|
29
|
+
<a href="classes/Inflector.html#M000012">dasherize (Inflector)</a><br />
|
30
|
+
<a href="classes/Inflector.html#M000014">demodulize (Inflector)</a><br />
|
31
|
+
<a href="classes/Inflector.html#M000017">foreign_key (Inflector)</a><br />
|
31
32
|
<a href="classes/String.html#M000001">format (String)</a><br />
|
32
33
|
<a href="classes/String.html#M000002">format= (String)</a><br />
|
33
34
|
<a href="classes/String.html#M000003">formatted (String)</a><br />
|
34
|
-
<a href="classes/Enumerable.html#
|
35
|
-
<a href="classes/Inflector.html#
|
36
|
-
<a href="classes/Inflector.html#
|
37
|
-
<a href="classes/Inflector/Inflections.html#
|
38
|
-
<a href="classes/Inflector/Inflections.html#
|
39
|
-
<a href="classes/Inflector.html#
|
40
|
-
<a href="classes/Inflector/Inflections.html#
|
41
|
-
<a href="classes/Inflector.html#
|
42
|
-
<a href="classes/Inflector/Inflections.html#
|
43
|
-
<a href="classes/Inflector.html#
|
44
|
-
<a href="classes/Inflector.html#
|
45
|
-
<a href="classes/Inflector.html#
|
46
|
-
<a href="classes/FormattedString/Formats/Xml.html#
|
47
|
-
<a href="classes/Inflector/Inflections.html#
|
48
|
-
<a href="classes/Inflector.html#
|
35
|
+
<a href="classes/Enumerable.html#M000026">group_by (Enumerable)</a><br />
|
36
|
+
<a href="classes/Inflector.html#M000013">humanize (Inflector)</a><br />
|
37
|
+
<a href="classes/Inflector.html#M000006">inflections (Inflector)</a><br />
|
38
|
+
<a href="classes/Inflector/Inflections.html#M000023">irregular (Inflector::Inflections)</a><br />
|
39
|
+
<a href="classes/Inflector/Inflections.html#M000020">new (Inflector::Inflections)</a><br />
|
40
|
+
<a href="classes/Inflector.html#M000019">ordinalize (Inflector)</a><br />
|
41
|
+
<a href="classes/Inflector/Inflections.html#M000021">plural (Inflector::Inflections)</a><br />
|
42
|
+
<a href="classes/Inflector.html#M000007">pluralize (Inflector)</a><br />
|
43
|
+
<a href="classes/Inflector/Inflections.html#M000022">singular (Inflector::Inflections)</a><br />
|
44
|
+
<a href="classes/Inflector.html#M000008">singularize (Inflector)</a><br />
|
45
|
+
<a href="classes/Inflector.html#M000015">tableize (Inflector)</a><br />
|
46
|
+
<a href="classes/Inflector.html#M000010">titleize (Inflector)</a><br />
|
47
|
+
<a href="classes/FormattedString/Formats/Xml.html#M000005">to_hash (FormattedString::Formats::Xml)</a><br />
|
48
|
+
<a href="classes/Inflector/Inflections.html#M000024">uncountable (Inflector::Inflections)</a><br />
|
49
|
+
<a href="classes/Inflector.html#M000011">underscore (Inflector)</a><br />
|
49
50
|
</div>
|
50
51
|
</div>
|
51
52
|
</body>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: formattedstring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Parker
|
@@ -9,7 +9,7 @@ autorequire: formatted_string
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-03-
|
12
|
+
date: 2008-03-20 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -35,27 +35,27 @@ files:
|
|
35
35
|
- doc/classes
|
36
36
|
- doc/classes/Enumerable.html
|
37
37
|
- doc/classes/Enumerable.src
|
38
|
-
- doc/classes/Enumerable.src/M000025.html
|
39
38
|
- doc/classes/Enumerable.src/M000026.html
|
39
|
+
- doc/classes/Enumerable.src/M000027.html
|
40
40
|
- doc/classes/FormattedString
|
41
41
|
- doc/classes/FormattedString/Formats
|
42
42
|
- doc/classes/FormattedString/Formats/Xml.html
|
43
43
|
- doc/classes/FormattedString/Formats/Xml.src
|
44
44
|
- doc/classes/FormattedString/Formats/Xml.src/M000004.html
|
45
|
+
- doc/classes/FormattedString/Formats/Xml.src/M000005.html
|
45
46
|
- doc/classes/FormattedString/Formats.html
|
46
47
|
- doc/classes/FormattedString.html
|
47
48
|
- doc/classes/Inflector
|
48
49
|
- doc/classes/Inflector/Inflections.html
|
49
50
|
- doc/classes/Inflector/Inflections.src
|
50
|
-
- doc/classes/Inflector/Inflections.src/M000019.html
|
51
51
|
- doc/classes/Inflector/Inflections.src/M000020.html
|
52
52
|
- doc/classes/Inflector/Inflections.src/M000021.html
|
53
53
|
- doc/classes/Inflector/Inflections.src/M000022.html
|
54
54
|
- doc/classes/Inflector/Inflections.src/M000023.html
|
55
55
|
- doc/classes/Inflector/Inflections.src/M000024.html
|
56
|
+
- doc/classes/Inflector/Inflections.src/M000025.html
|
56
57
|
- doc/classes/Inflector.html
|
57
58
|
- doc/classes/Inflector.src
|
58
|
-
- doc/classes/Inflector.src/M000005.html
|
59
59
|
- doc/classes/Inflector.src/M000006.html
|
60
60
|
- doc/classes/Inflector.src/M000007.html
|
61
61
|
- doc/classes/Inflector.src/M000008.html
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- doc/classes/Inflector.src/M000016.html
|
70
70
|
- doc/classes/Inflector.src/M000017.html
|
71
71
|
- doc/classes/Inflector.src/M000018.html
|
72
|
+
- doc/classes/Inflector.src/M000019.html
|
72
73
|
- doc/classes/String.html
|
73
74
|
- doc/classes/String.src
|
74
75
|
- doc/classes/String.src/M000001.html
|