formattedstring 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -2
- metadata +3 -62
- data/doc/classes/Enumerable.html +0 -146
- data/doc/classes/Enumerable.src/M000026.html +0 -21
- data/doc/classes/Enumerable.src/M000027.html +0 -34
- data/doc/classes/FormattedString/Formats/Xml.html +0 -159
- data/doc/classes/FormattedString/Formats/Xml.src/M000004.html +0 -18
- data/doc/classes/FormattedString/Formats/Xml.src/M000005.html +0 -49
- data/doc/classes/FormattedString/Formats.html +0 -111
- data/doc/classes/FormattedString.html +0 -111
- data/doc/classes/Inflector/Inflections.html +0 -321
- data/doc/classes/Inflector/Inflections.src/M000020.html +0 -18
- data/doc/classes/Inflector/Inflections.src/M000021.html +0 -18
- data/doc/classes/Inflector/Inflections.src/M000022.html +0 -18
- data/doc/classes/Inflector/Inflections.src/M000023.html +0 -26
- data/doc/classes/Inflector/Inflections.src/M000024.html +0 -18
- data/doc/classes/Inflector/Inflections.src/M000025.html +0 -23
- data/doc/classes/Inflector.html +0 -516
- data/doc/classes/Inflector.src/M000006.html +0 -22
- data/doc/classes/Inflector.src/M000007.html +0 -25
- data/doc/classes/Inflector.src/M000008.html +0 -25
- data/doc/classes/Inflector.src/M000009.html +0 -22
- data/doc/classes/Inflector.src/M000010.html +0 -18
- data/doc/classes/Inflector.src/M000011.html +0 -22
- data/doc/classes/Inflector.src/M000012.html +0 -18
- data/doc/classes/Inflector.src/M000013.html +0 -18
- data/doc/classes/Inflector.src/M000014.html +0 -18
- data/doc/classes/Inflector.src/M000015.html +0 -18
- data/doc/classes/Inflector.src/M000016.html +0 -19
- data/doc/classes/Inflector.src/M000017.html +0 -18
- data/doc/classes/Inflector.src/M000018.html +0 -22
- data/doc/classes/Inflector.src/M000019.html +0 -27
- data/doc/classes/String.html +0 -191
- data/doc/classes/String.src/M000001.html +0 -18
- data/doc/classes/String.src/M000002.html +0 -20
- data/doc/classes/String.src/M000003.html +0 -19
- data/doc/created.rid +0 -1
- data/doc/files/LICENSE.html +0 -129
- data/doc/files/README.html +0 -196
- data/doc/files/lib/formatted_string/formats/xml_rb.html +0 -119
- data/doc/files/lib/formatted_string_rb.html +0 -108
- data/doc/files/lib/inflections_rb.html +0 -101
- data/doc/files/lib/inflector_rb.html +0 -108
- data/doc/fr_class_index.html +0 -33
- data/doc/fr_file_index.html +0 -32
- data/doc/fr_method_index.html +0 -53
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
data/Rakefile
CHANGED
@@ -6,7 +6,7 @@ require 'rake/gempackagetask'
|
|
6
6
|
require 'rake/contrib/rubyforgepublisher'
|
7
7
|
|
8
8
|
PKG_NAME = 'formattedstring'
|
9
|
-
PKG_VERSION = "0.0
|
9
|
+
PKG_VERSION = "0.1.0"
|
10
10
|
|
11
11
|
PKG_FILES = FileList[
|
12
12
|
"lib/**/*", "rspec/**/*", "[A-Z]*", "Rakefile", "doc/**/*"
|
@@ -47,7 +47,6 @@ spec = Gem::Specification.new do |s|
|
|
47
47
|
|
48
48
|
#### Load-time details: library and application (you will need one or both).
|
49
49
|
s.require_path = 'lib'
|
50
|
-
s.autorequire = %q{formatted_string}
|
51
50
|
|
52
51
|
#### Documentation and testing.
|
53
52
|
s.has_rdoc = true
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: formattedstring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Parker
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-04-15 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -32,65 +32,6 @@ files:
|
|
32
32
|
- LICENSE
|
33
33
|
- Rakefile
|
34
34
|
- README
|
35
|
-
- doc/classes
|
36
|
-
- doc/classes/Enumerable.html
|
37
|
-
- doc/classes/Enumerable.src
|
38
|
-
- doc/classes/Enumerable.src/M000026.html
|
39
|
-
- doc/classes/Enumerable.src/M000027.html
|
40
|
-
- doc/classes/FormattedString
|
41
|
-
- doc/classes/FormattedString/Formats
|
42
|
-
- doc/classes/FormattedString/Formats/Xml.html
|
43
|
-
- doc/classes/FormattedString/Formats/Xml.src
|
44
|
-
- doc/classes/FormattedString/Formats/Xml.src/M000004.html
|
45
|
-
- doc/classes/FormattedString/Formats/Xml.src/M000005.html
|
46
|
-
- doc/classes/FormattedString/Formats.html
|
47
|
-
- doc/classes/FormattedString.html
|
48
|
-
- doc/classes/Inflector
|
49
|
-
- doc/classes/Inflector/Inflections.html
|
50
|
-
- doc/classes/Inflector/Inflections.src
|
51
|
-
- doc/classes/Inflector/Inflections.src/M000020.html
|
52
|
-
- doc/classes/Inflector/Inflections.src/M000021.html
|
53
|
-
- doc/classes/Inflector/Inflections.src/M000022.html
|
54
|
-
- doc/classes/Inflector/Inflections.src/M000023.html
|
55
|
-
- doc/classes/Inflector/Inflections.src/M000024.html
|
56
|
-
- doc/classes/Inflector/Inflections.src/M000025.html
|
57
|
-
- doc/classes/Inflector.html
|
58
|
-
- doc/classes/Inflector.src
|
59
|
-
- doc/classes/Inflector.src/M000006.html
|
60
|
-
- doc/classes/Inflector.src/M000007.html
|
61
|
-
- doc/classes/Inflector.src/M000008.html
|
62
|
-
- doc/classes/Inflector.src/M000009.html
|
63
|
-
- doc/classes/Inflector.src/M000010.html
|
64
|
-
- doc/classes/Inflector.src/M000011.html
|
65
|
-
- doc/classes/Inflector.src/M000012.html
|
66
|
-
- doc/classes/Inflector.src/M000013.html
|
67
|
-
- doc/classes/Inflector.src/M000014.html
|
68
|
-
- doc/classes/Inflector.src/M000015.html
|
69
|
-
- doc/classes/Inflector.src/M000016.html
|
70
|
-
- doc/classes/Inflector.src/M000017.html
|
71
|
-
- doc/classes/Inflector.src/M000018.html
|
72
|
-
- doc/classes/Inflector.src/M000019.html
|
73
|
-
- doc/classes/String.html
|
74
|
-
- doc/classes/String.src
|
75
|
-
- doc/classes/String.src/M000001.html
|
76
|
-
- doc/classes/String.src/M000002.html
|
77
|
-
- doc/classes/String.src/M000003.html
|
78
|
-
- doc/created.rid
|
79
|
-
- doc/files
|
80
|
-
- doc/files/lib
|
81
|
-
- doc/files/lib/formatted_string
|
82
|
-
- doc/files/lib/formatted_string/formats
|
83
|
-
- doc/files/lib/formatted_string/formats/xml_rb.html
|
84
|
-
- doc/files/lib/formatted_string_rb.html
|
85
|
-
- doc/files/lib/inflections_rb.html
|
86
|
-
- doc/files/lib/inflector_rb.html
|
87
|
-
- doc/files/LICENSE.html
|
88
|
-
- doc/files/README.html
|
89
|
-
- doc/fr_class_index.html
|
90
|
-
- doc/fr_file_index.html
|
91
|
-
- doc/fr_method_index.html
|
92
|
-
- doc/index.html
|
93
|
-
- doc/rdoc-style.css
|
94
35
|
has_rdoc: true
|
95
36
|
homepage: http://formattedstring.rubyforge.org
|
96
37
|
post_install_message:
|
data/doc/classes/Enumerable.html
DELETED
@@ -1,146 +0,0 @@
|
|
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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Module: Enumerable</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Module</strong></td>
|
53
|
-
<td class="class-name-in-header">Enumerable</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../files/lib/formatted_string/formats/xml_rb.html">
|
59
|
-
lib/formatted_string/formats/xml.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
</table>
|
66
|
-
</div>
|
67
|
-
<!-- banner header -->
|
68
|
-
|
69
|
-
<div id="bodyContent">
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
<div id="contextContent">
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
</div>
|
78
|
-
|
79
|
-
<div id="method-list">
|
80
|
-
<h3 class="section-bar">Methods</h3>
|
81
|
-
|
82
|
-
<div class="name-list">
|
83
|
-
<a href="#M000027">crawl</a>
|
84
|
-
<a href="#M000026">group_by</a>
|
85
|
-
</div>
|
86
|
-
</div>
|
87
|
-
|
88
|
-
</div>
|
89
|
-
|
90
|
-
|
91
|
-
<!-- if includes -->
|
92
|
-
|
93
|
-
<div id="section">
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
<!-- if method_list -->
|
103
|
-
<div id="methods">
|
104
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
105
|
-
|
106
|
-
<div id="method-M000027" class="method-detail">
|
107
|
-
<a name="M000027"></a>
|
108
|
-
|
109
|
-
<div class="method-heading">
|
110
|
-
<a href="Enumerable.src/M000027.html" target="Code" class="method-signature"
|
111
|
-
onclick="popupCode('Enumerable.src/M000027.html');return false;">
|
112
|
-
<span class="method-name">crawl</span><span class="method-args">() {|v| ...}</span>
|
113
|
-
</a>
|
114
|
-
</div>
|
115
|
-
|
116
|
-
<div class="method-description">
|
117
|
-
</div>
|
118
|
-
</div>
|
119
|
-
|
120
|
-
<div id="method-M000026" class="method-detail">
|
121
|
-
<a name="M000026"></a>
|
122
|
-
|
123
|
-
<div class="method-heading">
|
124
|
-
<a href="Enumerable.src/M000026.html" target="Code" class="method-signature"
|
125
|
-
onclick="popupCode('Enumerable.src/M000026.html');return false;">
|
126
|
-
<span class="method-name">group_by</span><span class="method-args">() {|element| ...}</span>
|
127
|
-
</a>
|
128
|
-
</div>
|
129
|
-
|
130
|
-
<div class="method-description">
|
131
|
-
</div>
|
132
|
-
</div>
|
133
|
-
|
134
|
-
|
135
|
-
</div>
|
136
|
-
|
137
|
-
|
138
|
-
</div>
|
139
|
-
|
140
|
-
|
141
|
-
<div id="validator-badges">
|
142
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
143
|
-
</div>
|
144
|
-
|
145
|
-
</body>
|
146
|
-
</html>
|
@@ -1,21 +0,0 @@
|
|
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>group_by (Enumerable)</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/formatted_string/formats/xml.rb, line 11</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">group_by</span>
|
15
|
-
<span class="ruby-identifier">inject</span>({}) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">groups</span>, <span class="ruby-identifier">element</span><span class="ruby-operator">|</span>
|
16
|
-
(<span class="ruby-identifier">groups</span>[<span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">element</span>)] <span class="ruby-operator">||=</span> []) <span class="ruby-operator"><<</span> <span class="ruby-identifier">element</span>
|
17
|
-
<span class="ruby-identifier">groups</span>
|
18
|
-
<span class="ruby-keyword kw">end</span>
|
19
|
-
<span class="ruby-keyword kw">end</span></pre>
|
20
|
-
</body>
|
21
|
-
</html>
|
@@ -1,34 +0,0 @@
|
|
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>crawl (Enumerable)</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/formatted_string/formats/xml.rb, line 18</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">crawl</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
15
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"no block given"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block_given?</span>
|
16
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
17
|
-
<span class="ruby-identifier">k</span> = <span class="ruby-keyword kw">self</span>
|
18
|
-
<span class="ruby-identifier">v</span> = <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">arity</span>
|
19
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
|
20
|
-
<span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">v</span>)
|
21
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span>
|
22
|
-
<span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>)
|
23
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-value">3</span>
|
24
|
-
<span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>,<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>)
|
25
|
-
<span class="ruby-keyword kw">end</span>
|
26
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
|
27
|
-
<span class="ruby-identifier">v</span>.<span class="ruby-identifier">crawl</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
28
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
|
29
|
-
<span class="ruby-identifier">v</span>.<span class="ruby-identifier">crawl</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
30
|
-
<span class="ruby-keyword kw">end</span>
|
31
|
-
<span class="ruby-keyword kw">end</span>
|
32
|
-
<span class="ruby-keyword kw">end</span></pre>
|
33
|
-
</body>
|
34
|
-
</html>
|
@@ -1,159 +0,0 @@
|
|
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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Module: FormattedString::Formats::Xml</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Module</strong></td>
|
53
|
-
<td class="class-name-in-header">FormattedString::Formats::Xml</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../../files/lib/formatted_string/formats/xml_rb.html">
|
59
|
-
lib/formatted_string/formats/xml.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
</table>
|
66
|
-
</div>
|
67
|
-
<!-- banner header -->
|
68
|
-
|
69
|
-
<div id="bodyContent">
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
<div id="contextContent">
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
</div>
|
78
|
-
|
79
|
-
<div id="method-list">
|
80
|
-
<h3 class="section-bar">Methods</h3>
|
81
|
-
|
82
|
-
<div class="name-list">
|
83
|
-
<a href="#M000004">===</a>
|
84
|
-
<a href="#M000005">to_hash</a>
|
85
|
-
</div>
|
86
|
-
</div>
|
87
|
-
|
88
|
-
</div>
|
89
|
-
|
90
|
-
|
91
|
-
<!-- if includes -->
|
92
|
-
|
93
|
-
<div id="section">
|
94
|
-
|
95
|
-
|
96
|
-
<div id="constants-list">
|
97
|
-
<h3 class="section-bar">Constants</h3>
|
98
|
-
|
99
|
-
<div class="name-list">
|
100
|
-
<table summary="Constants">
|
101
|
-
<tr class="top-aligned-row context-row">
|
102
|
-
<td class="context-item-name">XML_OPTIONS</td>
|
103
|
-
<td>=</td>
|
104
|
-
<td class="context-item-value">{ :include_key => :attribute, # Can be false, :element, or :attribute :report_nil => true, # Sets an attribute nil="true" on elements that are nil, so that the reader doesn't read as an empty string :key_name => 'id', # Default key name }</td>
|
105
|
-
</tr>
|
106
|
-
</table>
|
107
|
-
</div>
|
108
|
-
</div>
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
<!-- if method_list -->
|
116
|
-
<div id="methods">
|
117
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
118
|
-
|
119
|
-
<div id="method-M000004" class="method-detail">
|
120
|
-
<a name="M000004"></a>
|
121
|
-
|
122
|
-
<div class="method-heading">
|
123
|
-
<a href="Xml.src/M000004.html" target="Code" class="method-signature"
|
124
|
-
onclick="popupCode('Xml.src/M000004.html');return false;">
|
125
|
-
<span class="method-name">===</span><span class="method-args">(other)</span>
|
126
|
-
</a>
|
127
|
-
</div>
|
128
|
-
|
129
|
-
<div class="method-description">
|
130
|
-
</div>
|
131
|
-
</div>
|
132
|
-
|
133
|
-
<div id="method-M000005" class="method-detail">
|
134
|
-
<a name="M000005"></a>
|
135
|
-
|
136
|
-
<div class="method-heading">
|
137
|
-
<a href="Xml.src/M000005.html" target="Code" class="method-signature"
|
138
|
-
onclick="popupCode('Xml.src/M000005.html');return false;">
|
139
|
-
<span class="method-name">to_hash</span><span class="method-args">(options={})</span>
|
140
|
-
</a>
|
141
|
-
</div>
|
142
|
-
|
143
|
-
<div class="method-description">
|
144
|
-
</div>
|
145
|
-
</div>
|
146
|
-
|
147
|
-
|
148
|
-
</div>
|
149
|
-
|
150
|
-
|
151
|
-
</div>
|
152
|
-
|
153
|
-
|
154
|
-
<div id="validator-badges">
|
155
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
156
|
-
</div>
|
157
|
-
|
158
|
-
</body>
|
159
|
-
</html>
|
@@ -1,18 +0,0 @@
|
|
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>=== (FormattedString::Formats::Xml)</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/formatted_string/formats/xml.rb, line 127</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">===</span>(<span class="ruby-identifier">other</span>)
|
15
|
-
<span class="ruby-identifier">to_hash</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">to_hash</span>
|
16
|
-
<span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
@@ -1,49 +0,0 @@
|
|
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>to_hash (FormattedString::Formats::Xml)</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/formatted_string/formats/xml.rb, line 131</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_hash</span>(<span class="ruby-identifier">options</span>={})
|
15
|
-
<span class="ruby-identifier">options</span> = <span class="ruby-constant">XML_OPTIONS</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
|
16
|
-
|
17
|
-
<span class="ruby-identifier">stack</span> = []
|
18
|
-
<span class="ruby-identifier">parser</span> = <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">Parsers</span><span class="ruby-operator">::</span><span class="ruby-constant">BaseParser</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>)
|
19
|
-
|
20
|
-
<span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
|
21
|
-
<span class="ruby-identifier">event</span> = <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">pull</span>
|
22
|
-
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">event</span>[<span class="ruby-value">0</span>]
|
23
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:end_document</span>
|
24
|
-
<span class="ruby-keyword kw">break</span>
|
25
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:end_doctype</span>, <span class="ruby-identifier">:start_doctype</span>
|
26
|
-
<span class="ruby-comment cmt"># do nothing</span>
|
27
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:start_element</span>
|
28
|
-
<span class="ruby-identifier">stack</span>.<span class="ruby-identifier">push</span> <span class="ruby-constant">REXMLUtilityNode</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">event</span>[<span class="ruby-value">1</span>], <span class="ruby-identifier">event</span>[<span class="ruby-value">2</span>])
|
29
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:end_element</span>
|
30
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">stack</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-value">1</span>
|
31
|
-
<span class="ruby-identifier">temp</span> = <span class="ruby-identifier">stack</span>.<span class="ruby-identifier">pop</span>
|
32
|
-
<span class="ruby-identifier">stack</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">add_node</span>(<span class="ruby-identifier">temp</span>)
|
33
|
-
<span class="ruby-keyword kw">end</span>
|
34
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:text</span>, <span class="ruby-identifier">:cdata</span>
|
35
|
-
<span class="ruby-identifier">stack</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">add_node</span>(<span class="ruby-identifier">event</span>[<span class="ruby-value">1</span>]) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">event</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
36
|
-
<span class="ruby-keyword kw">end</span>
|
37
|
-
<span class="ruby-keyword kw">end</span>
|
38
|
-
<span class="ruby-identifier">data</span> = <span class="ruby-identifier">stack</span>.<span class="ruby-identifier">pop</span>.<span class="ruby-identifier">to_hash</span>
|
39
|
-
|
40
|
-
<span class="ruby-comment cmt"># Turn any {} || {"nil" => "true"} into just nil</span>
|
41
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:report_nil</span>]
|
42
|
-
<span class="ruby-identifier">data</span>.<span class="ruby-identifier">crawl</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> {} <span class="ruby-operator">||</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> {<span class="ruby-value str">'nil'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'true'</span>}; <span class="ruby-identifier">v</span>}
|
43
|
-
<span class="ruby-keyword kw">else</span>
|
44
|
-
<span class="ruby-identifier">data</span>.<span class="ruby-identifier">crawl</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> {}; <span class="ruby-identifier">v</span>}
|
45
|
-
<span class="ruby-keyword kw">end</span>
|
46
|
-
<span class="ruby-identifier">data</span>
|
47
|
-
<span class="ruby-keyword kw">end</span></pre>
|
48
|
-
</body>
|
49
|
-
</html>
|
@@ -1,111 +0,0 @@
|
|
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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Module: FormattedString::Formats</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Module</strong></td>
|
53
|
-
<td class="class-name-in-header">FormattedString::Formats</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/formatted_string/formats/xml_rb.html">
|
59
|
-
lib/formatted_string/formats/xml.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
</table>
|
66
|
-
</div>
|
67
|
-
<!-- banner header -->
|
68
|
-
|
69
|
-
<div id="bodyContent">
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
<div id="contextContent">
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
</div>
|
78
|
-
|
79
|
-
|
80
|
-
</div>
|
81
|
-
|
82
|
-
|
83
|
-
<!-- if includes -->
|
84
|
-
|
85
|
-
<div id="section">
|
86
|
-
|
87
|
-
<div id="class-list">
|
88
|
-
<h3 class="section-bar">Classes and Modules</h3>
|
89
|
-
|
90
|
-
Module <a href="Formats/Xml.html" class="link">FormattedString::Formats::Xml</a><br />
|
91
|
-
|
92
|
-
</div>
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
<!-- if method_list -->
|
101
|
-
|
102
|
-
|
103
|
-
</div>
|
104
|
-
|
105
|
-
|
106
|
-
<div id="validator-badges">
|
107
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
108
|
-
</div>
|
109
|
-
|
110
|
-
</body>
|
111
|
-
</html>
|