hashutils 0.1
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/README +93 -0
- data/Rakefile +51 -0
- data/doc/classes/Array.html +131 -0
- data/doc/classes/Hash.html +137 -0
- data/doc/classes/HashUtils.html +131 -0
- data/doc/classes/HashUtils.src/M000018.html +20 -0
- data/doc/classes/HashUtilsNamedAttributes.html +131 -0
- data/doc/classes/HashUtilsNamedAttributes.src/M000019.html +29 -0
- data/doc/classes/HashUtilsXML.html +164 -0
- data/doc/classes/HashUtilsXML.src/M000015.html +56 -0
- data/doc/classes/HashUtilsXML.src/M000016.html +44 -0
- data/doc/classes/HashUtilsXML.src/M000017.html +29 -0
- data/doc/classes/TC_HashUtilsFromXML.html +170 -0
- data/doc/classes/TC_HashUtilsFromXML.src/M000012.html +25 -0
- data/doc/classes/TC_HashUtilsFromXML.src/M000013.html +37 -0
- data/doc/classes/TC_HashUtilsFromXML.src/M000014.html +18 -0
- data/doc/classes/TC_HashUtilsHashAsAttributes.html +170 -0
- data/doc/classes/TC_HashUtilsHashAsAttributes.src/M000008.html +18 -0
- data/doc/classes/TC_HashUtilsHashAsAttributes.src/M000009.html +19 -0
- data/doc/classes/TC_HashUtilsHashAsAttributes.src/M000010.html +20 -0
- data/doc/classes/TC_HashUtilsToXML.html +237 -0
- data/doc/classes/TC_HashUtilsToXML.src/M000001.html +34 -0
- data/doc/classes/TC_HashUtilsToXML.src/M000002.html +22 -0
- data/doc/classes/TC_HashUtilsToXML.src/M000003.html +24 -0
- data/doc/classes/TC_HashUtilsToXML.src/M000004.html +30 -0
- data/doc/classes/TC_HashUtilsToXML.src/M000005.html +22 -0
- data/doc/classes/TC_HashUtilsToXML.src/M000006.html +26 -0
- data/doc/classes/TC_HashUtilsToXML.src/M000007.html +31 -0
- data/doc/classes/TS_HashUtils.html +137 -0
- data/doc/classes/TS_HashUtils.src/M000011.html +22 -0
- data/doc/created.rid +1 -0
- data/doc/files/lib/hashutils_rb.html +108 -0
- data/doc/files/rakefile_rb.html +101 -0
- data/doc/files/test/tc_hash_utils_from_xml_rb.html +109 -0
- data/doc/files/test/tc_hash_utils_hash_as_attributes_rb.html +109 -0
- data/doc/files/test/tc_hash_utils_to_xml_rb.html +110 -0
- data/doc/files/test/ts_hash_utils_rb.html +112 -0
- data/doc/fr_class_index.html +35 -0
- data/doc/fr_file_index.html +32 -0
- data/doc/fr_method_index.html +45 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/hashutils.rb +178 -0
- data/test/tc_hash_utils_from_xml.rb +47 -0
- data/test/tc_hash_utils_hash_as_attributes.rb +24 -0
- data/test/tc_hash_utils_to_xml.rb +103 -0
- data/test/ts_hash_utils.rb +18 -0
- metadata +101 -0
@@ -0,0 +1,18 @@
|
|
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>setup (TC_HashUtilsHashAsAttributes)</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 test/tc_hash_utils_hash_as_attributes.rb, line 6</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
|
15
|
+
<span class="ruby-ivar">@hash</span> = {<span class="ruby-identifier">:a</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>, <span class="ruby-identifier">:b</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"5"</span>}
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,19 @@
|
|
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>test_should_read_as_attribute (TC_HashUtilsHashAsAttributes)</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 test/tc_hash_utils_hash_as_attributes.rb, line 13</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_should_read_as_attribute</span>
|
15
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value">1</span>, <span class="ruby-ivar">@hash</span>.<span class="ruby-identifier">a</span>)
|
16
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"5"</span>, <span class="ruby-ivar">@hash</span>.<span class="ruby-identifier">b</span>)
|
17
|
+
<span class="ruby-keyword kw">end</span></pre>
|
18
|
+
</body>
|
19
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
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>test_should_create_new_attributes (TC_HashUtilsHashAsAttributes)</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 test/tc_hash_utils_hash_as_attributes.rb, line 18</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_should_create_new_attributes</span>
|
15
|
+
<span class="ruby-identifier">ret</span> = <span class="ruby-ivar">@hash</span>.<span class="ruby-identifier">c</span> = <span class="ruby-value">1.423</span>
|
16
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value">1.423</span>, <span class="ruby-ivar">@hash</span>.<span class="ruby-identifier">c</span>)
|
17
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value">1.423</span>, <span class="ruby-identifier">ret</span>)
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,237 @@
|
|
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>Class: TC_HashUtilsToXML</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>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">TC_HashUtilsToXML</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/test/tc_hash_utils_to_xml_rb.html">
|
59
|
+
test/tc_hash_utils_to_xml.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Test::Unit::TestCase
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000001">setup</a>
|
90
|
+
<a href="#M000003">test_should_have_attributes</a>
|
91
|
+
<a href="#M000002">test_should_have_basic_elements</a>
|
92
|
+
<a href="#M000006">test_should_have_complex_inner_structures</a>
|
93
|
+
<a href="#M000004">test_should_have_named_arrays</a>
|
94
|
+
<a href="#M000005">test_should_have_unamed_arrays</a>
|
95
|
+
<a href="#M000007">test_should_look_pretty</a>
|
96
|
+
</div>
|
97
|
+
</div>
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
101
|
+
|
102
|
+
<!-- if includes -->
|
103
|
+
<div id="includes">
|
104
|
+
<h3 class="section-bar">Included Modules</h3>
|
105
|
+
|
106
|
+
<div id="includes-list">
|
107
|
+
<span class="include-name">REXML</span>
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
<div id="section">
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
<!-- if method_list -->
|
121
|
+
<div id="methods">
|
122
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
123
|
+
|
124
|
+
<div id="method-M000001" class="method-detail">
|
125
|
+
<a name="M000001"></a>
|
126
|
+
|
127
|
+
<div class="method-heading">
|
128
|
+
<a href="TC_HashUtilsToXML.src/M000001.html" target="Code" class="method-signature"
|
129
|
+
onclick="popupCode('TC_HashUtilsToXML.src/M000001.html');return false;">
|
130
|
+
<span class="method-name">setup</span><span class="method-args">()</span>
|
131
|
+
</a>
|
132
|
+
</div>
|
133
|
+
|
134
|
+
<div class="method-description">
|
135
|
+
</div>
|
136
|
+
</div>
|
137
|
+
|
138
|
+
<div id="method-M000003" class="method-detail">
|
139
|
+
<a name="M000003"></a>
|
140
|
+
|
141
|
+
<div class="method-heading">
|
142
|
+
<a href="TC_HashUtilsToXML.src/M000003.html" target="Code" class="method-signature"
|
143
|
+
onclick="popupCode('TC_HashUtilsToXML.src/M000003.html');return false;">
|
144
|
+
<span class="method-name">test_should_have_attributes</span><span class="method-args">()</span>
|
145
|
+
</a>
|
146
|
+
</div>
|
147
|
+
|
148
|
+
<div class="method-description">
|
149
|
+
</div>
|
150
|
+
</div>
|
151
|
+
|
152
|
+
<div id="method-M000002" class="method-detail">
|
153
|
+
<a name="M000002"></a>
|
154
|
+
|
155
|
+
<div class="method-heading">
|
156
|
+
<a href="TC_HashUtilsToXML.src/M000002.html" target="Code" class="method-signature"
|
157
|
+
onclick="popupCode('TC_HashUtilsToXML.src/M000002.html');return false;">
|
158
|
+
<span class="method-name">test_should_have_basic_elements</span><span class="method-args">()</span>
|
159
|
+
</a>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
<div class="method-description">
|
163
|
+
<p>
|
164
|
+
def teardown end
|
165
|
+
</p>
|
166
|
+
</div>
|
167
|
+
</div>
|
168
|
+
|
169
|
+
<div id="method-M000006" class="method-detail">
|
170
|
+
<a name="M000006"></a>
|
171
|
+
|
172
|
+
<div class="method-heading">
|
173
|
+
<a href="TC_HashUtilsToXML.src/M000006.html" target="Code" class="method-signature"
|
174
|
+
onclick="popupCode('TC_HashUtilsToXML.src/M000006.html');return false;">
|
175
|
+
<span class="method-name">test_should_have_complex_inner_structures</span><span class="method-args">()</span>
|
176
|
+
</a>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
<div class="method-description">
|
180
|
+
</div>
|
181
|
+
</div>
|
182
|
+
|
183
|
+
<div id="method-M000004" class="method-detail">
|
184
|
+
<a name="M000004"></a>
|
185
|
+
|
186
|
+
<div class="method-heading">
|
187
|
+
<a href="TC_HashUtilsToXML.src/M000004.html" target="Code" class="method-signature"
|
188
|
+
onclick="popupCode('TC_HashUtilsToXML.src/M000004.html');return false;">
|
189
|
+
<span class="method-name">test_should_have_named_arrays</span><span class="method-args">()</span>
|
190
|
+
</a>
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<div class="method-description">
|
194
|
+
</div>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
<div id="method-M000005" class="method-detail">
|
198
|
+
<a name="M000005"></a>
|
199
|
+
|
200
|
+
<div class="method-heading">
|
201
|
+
<a href="TC_HashUtilsToXML.src/M000005.html" target="Code" class="method-signature"
|
202
|
+
onclick="popupCode('TC_HashUtilsToXML.src/M000005.html');return false;">
|
203
|
+
<span class="method-name">test_should_have_unamed_arrays</span><span class="method-args">()</span>
|
204
|
+
</a>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
<div class="method-description">
|
208
|
+
</div>
|
209
|
+
</div>
|
210
|
+
|
211
|
+
<div id="method-M000007" class="method-detail">
|
212
|
+
<a name="M000007"></a>
|
213
|
+
|
214
|
+
<div class="method-heading">
|
215
|
+
<a href="TC_HashUtilsToXML.src/M000007.html" target="Code" class="method-signature"
|
216
|
+
onclick="popupCode('TC_HashUtilsToXML.src/M000007.html');return false;">
|
217
|
+
<span class="method-name">test_should_look_pretty</span><span class="method-args">()</span>
|
218
|
+
</a>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
<div class="method-description">
|
222
|
+
</div>
|
223
|
+
</div>
|
224
|
+
|
225
|
+
|
226
|
+
</div>
|
227
|
+
|
228
|
+
|
229
|
+
</div>
|
230
|
+
|
231
|
+
|
232
|
+
<div id="validator-badges">
|
233
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
234
|
+
</div>
|
235
|
+
|
236
|
+
</body>
|
237
|
+
</html>
|
@@ -0,0 +1,34 @@
|
|
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>setup (TC_HashUtilsToXML)</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 test/tc_hash_utils_to_xml.rb, line 8</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
|
15
|
+
<span class="ruby-ivar">@hash</span> = { <span class="ruby-identifier">:name_elem</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"Document name"</span>, <span class="ruby-comment cmt">#element</span>
|
16
|
+
<span class="ruby-identifier">:attr1</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"Attribute 1"</span>, <span class="ruby-comment cmt">#attr</span>
|
17
|
+
<span class="ruby-identifier">:attr2</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"Attribute 2"</span>, <span class="ruby-comment cmt">#attr</span>
|
18
|
+
<span class="ruby-identifier">:numeric_array</span> =<span class="ruby-operator">></span> [<span class="ruby-value">1</span>, <span class="ruby-value">2</span>, <span class="ruby-value">3</span>, <span class="ruby-value">4</span>], <span class="ruby-comment cmt">#element - array named as "numeric_item"</span>
|
19
|
+
<span class="ruby-identifier">:float_array</span> =<span class="ruby-operator">></span> [<span class="ruby-value">0</span><span class="ruby-value">.4</span>, <span class="ruby-value">0</span><span class="ruby-value">.5</span>], <span class="ruby-comment cmt">#element - array named as "float_item"</span>
|
20
|
+
<span class="ruby-identifier">:non_named_array</span> =<span class="ruby-operator">></span> [<span class="ruby-value str">"asd"</span>, <span class="ruby-value str">"qwe"</span>], <span class="ruby-comment cmt">#element - array not named</span>
|
21
|
+
<span class="ruby-identifier">:inner_hash</span> =<span class="ruby-operator">></span> { <span class="ruby-identifier">:name_elem</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"Inner hash name"</span>, <span class="ruby-comment cmt">#element</span>
|
22
|
+
<span class="ruby-identifier">:attr_id</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"Inner hash attribute"</span>, <span class="ruby-comment cmt">#attribute</span>
|
23
|
+
<span class="ruby-identifier">:inner_hash_array</span> =<span class="ruby-operator">></span> [{<span class="ruby-identifier">:a</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>, <span class="ruby-identifier">:b</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>},{<span class="ruby-identifier">:a</span> =<span class="ruby-operator">></span> <span class="ruby-value">4</span>, <span class="ruby-identifier">:b</span> =<span class="ruby-operator">></span> <span class="ruby-value">6</span>}]}} <span class="ruby-comment cmt"># non-named array of hashes</span>
|
24
|
+
|
25
|
+
<span class="ruby-ivar">@hash</span>.<span class="ruby-identifier">xml_attributes</span> = [<span class="ruby-identifier">:attr1</span>, <span class="ruby-identifier">:attr2</span>]
|
26
|
+
<span class="ruby-ivar">@hash</span>[<span class="ruby-identifier">:numeric_array</span>].<span class="ruby-identifier">xml_name</span> = <span class="ruby-identifier">:numeric_item</span>
|
27
|
+
<span class="ruby-ivar">@hash</span>[<span class="ruby-identifier">:float_array</span>].<span class="ruby-identifier">xml_name</span> = <span class="ruby-identifier">:float_item</span>
|
28
|
+
<span class="ruby-ivar">@hash</span>[<span class="ruby-identifier">:inner_hash</span>].<span class="ruby-identifier">xml_attributes</span> = [<span class="ruby-identifier">:attr_id</span>]
|
29
|
+
|
30
|
+
<span class="ruby-ivar">@doc</span> = <span class="ruby-constant">Document</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@hash</span>.<span class="ruby-identifier">to_xml</span> <span class="ruby-identifier">:name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">:doc</span>)
|
31
|
+
<span class="ruby-ivar">@doc_pretty</span> = <span class="ruby-constant">Document</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@hash</span>.<span class="ruby-identifier">to_xml</span> <span class="ruby-identifier">:name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">:doc</span>)
|
32
|
+
<span class="ruby-keyword kw">end</span></pre>
|
33
|
+
</body>
|
34
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
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>test_should_have_basic_elements (TC_HashUtilsToXML)</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 test/tc_hash_utils_to_xml.rb, line 31</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_should_have_basic_elements</span>
|
15
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"Document name"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/name_elem"</span>].<span class="ruby-identifier">text</span>)
|
16
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"Inner hash name"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/inner_hash/name_elem"</span>].<span class="ruby-identifier">text</span>)
|
17
|
+
|
18
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"Document name"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/name_elem"</span>].<span class="ruby-identifier">text</span>)
|
19
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"Inner hash name"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/inner_hash/name_elem"</span>].<span class="ruby-identifier">text</span>)
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,24 @@
|
|
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>test_should_have_attributes (TC_HashUtilsToXML)</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 test/tc_hash_utils_to_xml.rb, line 39</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_should_have_attributes</span>
|
15
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"Attribute 1"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">"attr1"</span>])
|
16
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"Attribute 2"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">"attr2"</span>])
|
17
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"Inner hash attribute"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/inner_hash"</span>].<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">"attr_id"</span>])
|
18
|
+
|
19
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"Attribute 1"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">"attr1"</span>])
|
20
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"Attribute 2"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">"attr2"</span>])
|
21
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"Inner hash attribute"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/inner_hash"</span>].<span class="ruby-identifier">attributes</span>[<span class="ruby-value str">"attr_id"</span>])
|
22
|
+
<span class="ruby-keyword kw">end</span></pre>
|
23
|
+
</body>
|
24
|
+
</html>
|
@@ -0,0 +1,30 @@
|
|
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>test_should_have_named_arrays (TC_HashUtilsToXML)</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 test/tc_hash_utils_to_xml.rb, line 49</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_should_have_named_arrays</span>
|
15
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"1"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/numeric_array/numeric_item[1]"</span>].<span class="ruby-identifier">text</span>)
|
16
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"2"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/numeric_array/numeric_item[2]"</span>].<span class="ruby-identifier">text</span>)
|
17
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"3"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/numeric_array/numeric_item[3]"</span>].<span class="ruby-identifier">text</span>)
|
18
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"4"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/numeric_array/numeric_item[4]"</span>].<span class="ruby-identifier">text</span>)
|
19
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"0.4"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/float_array/float_item[1]"</span>].<span class="ruby-identifier">text</span>)
|
20
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"0.5"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/float_array/float_item[2]"</span>].<span class="ruby-identifier">text</span>)
|
21
|
+
|
22
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"1"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/numeric_array/numeric_item[1]"</span>].<span class="ruby-identifier">text</span>)
|
23
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"2"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/numeric_array/numeric_item[2]"</span>].<span class="ruby-identifier">text</span>)
|
24
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"3"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/numeric_array/numeric_item[3]"</span>].<span class="ruby-identifier">text</span>)
|
25
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"4"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/numeric_array/numeric_item[4]"</span>].<span class="ruby-identifier">text</span>)
|
26
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"0.4"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/float_array/float_item[1]"</span>].<span class="ruby-identifier">text</span>)
|
27
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"0.5"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/float_array/float_item[2]"</span>].<span class="ruby-identifier">text</span>)
|
28
|
+
<span class="ruby-keyword kw">end</span></pre>
|
29
|
+
</body>
|
30
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
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>test_should_have_unamed_arrays (TC_HashUtilsToXML)</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 test/tc_hash_utils_to_xml.rb, line 65</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_should_have_unamed_arrays</span>
|
15
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"asd"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/non_named_array/item[1]"</span>].<span class="ruby-identifier">text</span>)
|
16
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"qwe"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/non_named_array/item[2]"</span>].<span class="ruby-identifier">text</span>)
|
17
|
+
|
18
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"asd"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/non_named_array/item[1]"</span>].<span class="ruby-identifier">text</span>)
|
19
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"qwe"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/non_named_array/item[2]"</span>].<span class="ruby-identifier">text</span>)
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
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>test_should_have_complex_inner_structures (TC_HashUtilsToXML)</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 test/tc_hash_utils_to_xml.rb, line 73</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_should_have_complex_inner_structures</span>
|
15
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"1"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/inner_hash/inner_hash_array/item[1]/a"</span>].<span class="ruby-identifier">text</span>)
|
16
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"2"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/inner_hash/inner_hash_array/item[1]/b"</span>].<span class="ruby-identifier">text</span>)
|
17
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"4"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/inner_hash/inner_hash_array/item[2]/a"</span>].<span class="ruby-identifier">text</span>)
|
18
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"6"</span>, <span class="ruby-ivar">@doc</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/inner_hash/inner_hash_array/item[2]/b"</span>].<span class="ruby-identifier">text</span>)
|
19
|
+
|
20
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"1"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/inner_hash/inner_hash_array/item[1]/a"</span>].<span class="ruby-identifier">text</span>)
|
21
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"2"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/inner_hash/inner_hash_array/item[1]/b"</span>].<span class="ruby-identifier">text</span>)
|
22
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"4"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/inner_hash/inner_hash_array/item[2]/a"</span>].<span class="ruby-identifier">text</span>)
|
23
|
+
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value str">"6"</span>, <span class="ruby-ivar">@doc_pretty</span>.<span class="ruby-identifier">elements</span>[<span class="ruby-value str">"doc/inner_hash/inner_hash_array/item[2]/b"</span>].<span class="ruby-identifier">text</span>)
|
24
|
+
<span class="ruby-keyword kw">end</span></pre>
|
25
|
+
</body>
|
26
|
+
</html>
|