atom-tools 0.9.0 → 2.0.5
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/COPYING +3 -3
- data/README +9 -49
- data/Rakefile +65 -62
- data/bin/atom-cp +159 -0
- data/bin/atom-grep +78 -0
- data/bin/atom-post +73 -0
- data/bin/atom-purge +82 -0
- data/doc/classes/Atom/AttrEl.html +163 -0
- data/doc/classes/Atom/Author.html +2 -19
- data/doc/classes/Atom/AutodiscoveryFailure.html +111 -0
- data/doc/classes/Atom/Categories.html +168 -0
- data/doc/classes/Atom/Category.html +10 -1
- data/doc/classes/Atom/Collection.html +194 -91
- data/doc/classes/Atom/Content.html +42 -1
- data/doc/classes/Atom/Contributor.html +2 -8
- data/doc/classes/Atom/Control.html +126 -0
- data/doc/classes/Atom/Converters.html +571 -0
- data/doc/classes/Atom/DigestAuth.html +285 -0
- data/doc/classes/Atom/Element.html +673 -106
- data/doc/classes/Atom/FileCache.html +287 -0
- data/doc/classes/Atom/HTTP.html +211 -95
- data/doc/classes/Atom/HTTPResponse.html +190 -0
- data/doc/classes/Atom/HasCategories.html +187 -0
- data/doc/classes/Atom/HasLinks.html +168 -0
- data/doc/classes/Atom/Link.html +80 -3
- data/doc/classes/Atom/NilCache.html +202 -0
- data/doc/classes/Atom/ParseError.html +111 -0
- data/doc/classes/Atom/Parsers.html +311 -0
- data/doc/classes/Atom/Person.html +130 -0
- data/doc/classes/Atom/Rights.html +113 -0
- data/doc/classes/Atom/Service.html +298 -0
- data/doc/{files/lib/atom/yaml_rb.html → classes/Atom/Source.html} +26 -24
- data/doc/classes/Atom/Subtitle.html +113 -0
- data/doc/classes/Atom/Summary.html +113 -0
- data/doc/classes/Atom/Text.html +196 -53
- data/doc/classes/Atom/Title.html +113 -0
- data/doc/classes/Atom/Tools.html +525 -0
- data/doc/classes/Atom/Workspace.html +121 -0
- data/doc/classes/Object.html +204 -0
- data/doc/created.rid +1 -1
- data/doc/files/README.html +9 -49
- data/doc/files/lib/atom/cache_rb.html +302 -0
- data/doc/files/lib/atom/collection_rb.html +1 -2
- data/doc/files/lib/atom/element_rb.html +2 -1
- data/doc/files/lib/atom/entry_rb.html +2 -2
- data/doc/files/lib/atom/feed_rb.html +1 -2
- data/doc/files/lib/atom/http_rb.html +6 -1
- data/doc/files/lib/atom/{xml_rb.html → service_rb.html} +8 -6
- data/doc/files/lib/atom/text_rb.html +2 -1
- data/doc/files/lib/atom/{app_rb.html → tools_rb.html} +4 -6
- data/doc/fr_class_index.html +23 -3
- data/doc/fr_file_index.html +3 -3
- data/doc/fr_method_index.html +111 -36
- data/lib/atom/cache.rb +178 -0
- data/lib/atom/collection.rb +90 -40
- data/lib/atom/element.rb +569 -161
- data/lib/atom/entry.rb +63 -89
- data/lib/atom/feed.rb +65 -67
- data/lib/atom/http.rb +421 -49
- data/lib/atom/service.rb +106 -0
- data/lib/atom/text.rb +138 -61
- data/lib/atom/tools.rb +163 -0
- data/spec/entry_spec.rb +364 -0
- data/spec/ext_spec.rb +42 -0
- data/spec/feed_spec.rb +39 -0
- data/spec/fixtures/contacts-feed.xml +34 -0
- data/spec/fixtures/entry-w-ext.xml +15 -0
- data/spec/fixtures/entry-w-xml.xml +24 -0
- data/spec/fixtures/entry.xml +42 -0
- data/spec/fixtures/feed-w-ext.xml +33 -0
- data/spec/fixtures/service-w-xhtml-ns.xml +21 -0
- data/spec/fixtures/service.xml +36 -0
- data/spec/service_spec.rb +108 -0
- data/spec/spec_helper.rb +9 -0
- data/test/conformance/order.rb +11 -10
- data/test/conformance/title.rb +9 -9
- data/test/conformance/updated.rb +2 -1
- data/test/runtests.rb +0 -0
- data/test/test_constructs.rb +78 -8
- data/test/test_feed.rb +35 -29
- data/test/test_general.rb +3 -30
- data/test/test_http.rb +248 -34
- data/test/test_protocol.rb +143 -24
- data/test/test_xml.rb +145 -53
- metadata +116 -62
- data/bin/atom-client.rb +0 -246
- data/bin/atom-server.rb~ +0 -71
- data/doc/classes/Atom/App.html +0 -217
- data/doc/classes/Atom/Entry.html +0 -365
- data/doc/classes/Atom/Feed.html +0 -585
- data/lib/atom/app.rb +0 -87
- data/lib/atom/xml.rb +0 -200
- data/lib/atom/yaml.rb +0 -101
|
@@ -0,0 +1,190 @@
|
|
|
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: Atom::HTTPResponse</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">Atom::HTTPResponse</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../files/lib/atom/http_rb.html">
|
|
59
|
+
lib/atom/http.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="#M000009">end2end_headers</a>
|
|
84
|
+
<a href="#M000008">validate_content_type</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">HOP_BY_HOP</td>
|
|
103
|
+
<td>=</td>
|
|
104
|
+
<td class="context-item-value">['connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'te', 'trailers', 'transfer-encoding', 'upgrade']</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-M000009" class="method-detail">
|
|
120
|
+
<a name="M000009"></a>
|
|
121
|
+
|
|
122
|
+
<div class="method-heading">
|
|
123
|
+
<a href="#M000009" class="method-signature">
|
|
124
|
+
<span class="method-name">end2end_headers</span><span class="method-args">()</span>
|
|
125
|
+
</a>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
<div class="method-description">
|
|
129
|
+
<p><a class="source-toggle" href="#"
|
|
130
|
+
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
|
131
|
+
<div class="method-source-code" id="M000009-source">
|
|
132
|
+
<pre>
|
|
133
|
+
<span class="ruby-comment cmt"># File lib/atom/http.rb, line 496</span>
|
|
134
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">end2end_headers</span>
|
|
135
|
+
<span class="ruby-identifier">hopbyhop</span> = <span class="ruby-constant">HOP_BY_HOP</span>
|
|
136
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-value str">'connection'</span>]
|
|
137
|
+
<span class="ruby-identifier">hopbyhop</span> <span class="ruby-operator">+=</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-value str">'connection'</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">','</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">strip</span> }
|
|
138
|
+
<span class="ruby-keyword kw">end</span>
|
|
139
|
+
<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">hopbyhop</span>.<span class="ruby-identifier">member?</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">downcase</span> }
|
|
140
|
+
<span class="ruby-keyword kw">end</span>
|
|
141
|
+
</pre>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<div id="method-M000008" class="method-detail">
|
|
147
|
+
<a name="M000008"></a>
|
|
148
|
+
|
|
149
|
+
<div class="method-heading">
|
|
150
|
+
<a href="#M000008" class="method-signature">
|
|
151
|
+
<span class="method-name">validate_content_type</span><span class="method-args">( valid )</span>
|
|
152
|
+
</a>
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
<div class="method-description">
|
|
156
|
+
<p>
|
|
157
|
+
this should probably support ranges (eg. text/*)
|
|
158
|
+
</p>
|
|
159
|
+
<p><a class="source-toggle" href="#"
|
|
160
|
+
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
|
161
|
+
<div class="method-source-code" id="M000008-source">
|
|
162
|
+
<pre>
|
|
163
|
+
<span class="ruby-comment cmt"># File lib/atom/http.rb, line 486</span>
|
|
164
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_content_type</span>( <span class="ruby-identifier">valid</span> )
|
|
165
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTPException</span>, <span class="ruby-value str">"HTTP response contains no Content-Type!"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">content_type</span> <span class="ruby-keyword kw">or</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">content_type</span>.<span class="ruby-identifier">empty?</span>
|
|
166
|
+
|
|
167
|
+
<span class="ruby-identifier">media_type</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">content_type</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">";"</span>).<span class="ruby-identifier">first</span>
|
|
168
|
+
|
|
169
|
+
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid</span>.<span class="ruby-identifier">member?</span> <span class="ruby-identifier">media_type</span>.<span class="ruby-identifier">downcase</span>
|
|
170
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">WrongMimetype</span>, <span class="ruby-node">"unexpected response Content-Type: #{media_type.inspect}. should be one of: #{valid.inspect}"</span>
|
|
171
|
+
<span class="ruby-keyword kw">end</span>
|
|
172
|
+
<span class="ruby-keyword kw">end</span>
|
|
173
|
+
</pre>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
</div>
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
<div id="validator-badges">
|
|
186
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
</body>
|
|
190
|
+
</html>
|
|
@@ -0,0 +1,187 @@
|
|
|
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: Atom::HasCategories</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">Atom::HasCategories</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../files/lib/atom/element_rb.html">
|
|
59
|
+
lib/atom/element.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="#M000017">included</a>
|
|
84
|
+
<a href="#M000018">tag_with</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 Class methods</h3>
|
|
105
|
+
|
|
106
|
+
<div id="method-M000017" class="method-detail">
|
|
107
|
+
<a name="M000017"></a>
|
|
108
|
+
|
|
109
|
+
<div class="method-heading">
|
|
110
|
+
<a href="#M000017" class="method-signature">
|
|
111
|
+
<span class="method-name">included</span><span class="method-args">(klass)</span>
|
|
112
|
+
</a>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<div class="method-description">
|
|
116
|
+
<p><a class="source-toggle" href="#"
|
|
117
|
+
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
|
118
|
+
<div class="method-source-code" id="M000017-source">
|
|
119
|
+
<pre>
|
|
120
|
+
<span class="ruby-comment cmt"># File lib/atom/element.rb, line 660</span>
|
|
121
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">HasCategories</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">klass</span>)
|
|
122
|
+
<span class="ruby-identifier">klass</span>.<span class="ruby-identifier">atom_elements</span> <span class="ruby-identifier">:category</span>, <span class="ruby-identifier">:categories</span>, <span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">Category</span>
|
|
123
|
+
<span class="ruby-keyword kw">end</span>
|
|
124
|
+
</pre>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
130
|
+
|
|
131
|
+
<div id="method-M000018" class="method-detail">
|
|
132
|
+
<a name="M000018"></a>
|
|
133
|
+
|
|
134
|
+
<div class="method-heading">
|
|
135
|
+
<a href="#M000018" class="method-signature">
|
|
136
|
+
<span class="method-name">tag_with</span><span class="method-args">(tags, delimiter = ' ')</span>
|
|
137
|
+
</a>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<div class="method-description">
|
|
141
|
+
<p>
|
|
142
|
+
categorize the entry with each of an array or a space-separated
|
|
143
|
+
</p>
|
|
144
|
+
<pre>
|
|
145
|
+
string
|
|
146
|
+
</pre>
|
|
147
|
+
<p><a class="source-toggle" href="#"
|
|
148
|
+
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
|
149
|
+
<div class="method-source-code" id="M000018-source">
|
|
150
|
+
<pre>
|
|
151
|
+
<span class="ruby-comment cmt"># File lib/atom/element.rb, line 666</span>
|
|
152
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tag_with</span>(<span class="ruby-identifier">tags</span>, <span class="ruby-identifier">delimiter</span> = <span class="ruby-value str">' '</span>)
|
|
153
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">tags</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">tags</span>.<span class="ruby-identifier">empty?</span>
|
|
154
|
+
|
|
155
|
+
<span class="ruby-identifier">tag_list</span> = <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">tags</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
|
|
156
|
+
<span class="ruby-identifier">tags</span>
|
|
157
|
+
<span class="ruby-keyword kw">else</span>
|
|
158
|
+
<span class="ruby-identifier">tags</span> = <span class="ruby-identifier">tags</span>.<span class="ruby-identifier">split</span>(<span class="ruby-identifier">delimiter</span>)
|
|
159
|
+
<span class="ruby-identifier">tags</span>.<span class="ruby-identifier">map!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">strip</span> }
|
|
160
|
+
<span class="ruby-identifier">tags</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">empty?</span> }
|
|
161
|
+
<span class="ruby-identifier">tags</span>.<span class="ruby-identifier">uniq</span>
|
|
162
|
+
<span class="ruby-keyword kw">end</span>
|
|
163
|
+
|
|
164
|
+
<span class="ruby-identifier">tag_list</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tag</span><span class="ruby-operator">|</span>
|
|
165
|
+
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">categories</span>.<span class="ruby-identifier">any?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">term</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">tag</span> }
|
|
166
|
+
<span class="ruby-identifier">categories</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">:term</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">tag</span>
|
|
167
|
+
<span class="ruby-keyword kw">end</span>
|
|
168
|
+
<span class="ruby-keyword kw">end</span>
|
|
169
|
+
<span class="ruby-keyword kw">end</span>
|
|
170
|
+
</pre>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
<div id="validator-badges">
|
|
183
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
</body>
|
|
187
|
+
</html>
|
|
@@ -0,0 +1,168 @@
|
|
|
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: Atom::HasLinks</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">Atom::HasLinks</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../files/lib/atom/element_rb.html">
|
|
59
|
+
lib/atom/element.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="#M000011">find_link</a>
|
|
84
|
+
<a href="#M000010">included</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 Class methods</h3>
|
|
105
|
+
|
|
106
|
+
<div id="method-M000010" class="method-detail">
|
|
107
|
+
<a name="M000010"></a>
|
|
108
|
+
|
|
109
|
+
<div class="method-heading">
|
|
110
|
+
<a href="#M000010" class="method-signature">
|
|
111
|
+
<span class="method-name">included</span><span class="method-args">(klass)</span>
|
|
112
|
+
</a>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<div class="method-description">
|
|
116
|
+
<p><a class="source-toggle" href="#"
|
|
117
|
+
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
|
118
|
+
<div class="method-source-code" id="M000010-source">
|
|
119
|
+
<pre>
|
|
120
|
+
<span class="ruby-comment cmt"># File lib/atom/element.rb, line 648</span>
|
|
121
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">HasLinks</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">klass</span>)
|
|
122
|
+
<span class="ruby-identifier">klass</span>.<span class="ruby-identifier">atom_elements</span> <span class="ruby-identifier">:link</span>, <span class="ruby-identifier">:links</span>, <span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">Link</span>
|
|
123
|
+
<span class="ruby-keyword kw">end</span>
|
|
124
|
+
</pre>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
130
|
+
|
|
131
|
+
<div id="method-M000011" class="method-detail">
|
|
132
|
+
<a name="M000011"></a>
|
|
133
|
+
|
|
134
|
+
<div class="method-heading">
|
|
135
|
+
<a href="#M000011" class="method-signature">
|
|
136
|
+
<span class="method-name">find_link</span><span class="method-args">(criteria)</span>
|
|
137
|
+
</a>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<div class="method-description">
|
|
141
|
+
<p><a class="source-toggle" href="#"
|
|
142
|
+
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
|
143
|
+
<div class="method-source-code" id="M000011-source">
|
|
144
|
+
<pre>
|
|
145
|
+
<span class="ruby-comment cmt"># File lib/atom/element.rb, line 652</span>
|
|
146
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_link</span>(<span class="ruby-identifier">criteria</span>)
|
|
147
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">links</span>.<span class="ruby-identifier">find</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span>
|
|
148
|
+
<span class="ruby-identifier">criteria</span>.<span class="ruby-identifier">all?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">k</span>) <span class="ruby-operator">==</span> <span class="ruby-identifier">v</span> }
|
|
149
|
+
<span class="ruby-keyword kw">end</span>
|
|
150
|
+
<span class="ruby-keyword kw">end</span>
|
|
151
|
+
</pre>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
<div id="validator-badges">
|
|
164
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
</body>
|
|
168
|
+
</html>
|
data/doc/classes/Atom/Link.html
CHANGED
|
@@ -65,7 +65,9 @@
|
|
|
65
65
|
<tr class="top-aligned-row">
|
|
66
66
|
<td><strong>Parent:</strong></td>
|
|
67
67
|
<td>
|
|
68
|
-
|
|
68
|
+
<a href="Element.html">
|
|
69
|
+
Atom::Element
|
|
70
|
+
</a>
|
|
69
71
|
</td>
|
|
70
72
|
</tr>
|
|
71
73
|
</table>
|
|
@@ -83,10 +85,10 @@
|
|
|
83
85
|
A link has the following attributes:
|
|
84
86
|
</p>
|
|
85
87
|
<table>
|
|
86
|
-
<tr><td valign="top">href (required):</td><td>the link&#
|
|
88
|
+
<tr><td valign="top">href (required):</td><td>the link‘s IRI
|
|
87
89
|
|
|
88
90
|
</td></tr>
|
|
89
|
-
<tr><td valign="top">rel
|
|
91
|
+
<tr><td valign="top"><a href="Link.html#M000049">rel</a>:</td><td>the relationship of the linked item to the current item
|
|
90
92
|
|
|
91
93
|
</td></tr>
|
|
92
94
|
<tr><td valign="top">type:</td><td>a hint about the media type of the linked item
|
|
@@ -108,11 +110,26 @@ A link has the following attributes:
|
|
|
108
110
|
|
|
109
111
|
</div>
|
|
110
112
|
|
|
113
|
+
<div id="method-list">
|
|
114
|
+
<h3 class="section-bar">Methods</h3>
|
|
115
|
+
|
|
116
|
+
<div class="name-list">
|
|
117
|
+
<a href="#M000050">parse</a>
|
|
118
|
+
<a href="#M000049">rel</a>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
111
121
|
|
|
112
122
|
</div>
|
|
113
123
|
|
|
114
124
|
|
|
115
125
|
<!-- if includes -->
|
|
126
|
+
<div id="includes">
|
|
127
|
+
<h3 class="section-bar">Included Modules</h3>
|
|
128
|
+
|
|
129
|
+
<div id="includes-list">
|
|
130
|
+
<span class="include-name"><a href="AttrEl.html">AttrEl</a></span>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
116
133
|
|
|
117
134
|
<div id="section">
|
|
118
135
|
|
|
@@ -124,6 +141,66 @@ A link has the following attributes:
|
|
|
124
141
|
|
|
125
142
|
|
|
126
143
|
<!-- if method_list -->
|
|
144
|
+
<div id="methods">
|
|
145
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
146
|
+
|
|
147
|
+
<div id="method-M000050" class="method-detail">
|
|
148
|
+
<a name="M000050"></a>
|
|
149
|
+
|
|
150
|
+
<div class="method-heading">
|
|
151
|
+
<a href="#M000050" class="method-signature">
|
|
152
|
+
<span class="method-name">parse</span><span class="method-args">(xml, base = '')</span>
|
|
153
|
+
</a>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
<div class="method-description">
|
|
157
|
+
<p><a class="source-toggle" href="#"
|
|
158
|
+
onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
|
|
159
|
+
<div class="method-source-code" id="M000050-source">
|
|
160
|
+
<pre>
|
|
161
|
+
<span class="ruby-comment cmt"># File lib/atom/element.rb, line 601</span>
|
|
162
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span> <span class="ruby-identifier">xml</span>, <span class="ruby-identifier">base</span> = <span class="ruby-value str">''</span>
|
|
163
|
+
<span class="ruby-identifier">e</span> = <span class="ruby-keyword kw">super</span>
|
|
164
|
+
|
|
165
|
+
<span class="ruby-comment cmt"># URL absolutization</span>
|
|
166
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">e</span>.<span class="ruby-identifier">base</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">href</span>
|
|
167
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">href</span> = (<span class="ruby-identifier">e</span>.<span class="ruby-identifier">base</span>.<span class="ruby-identifier">to_uri</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">href</span>).<span class="ruby-identifier">to_s</span>
|
|
168
|
+
<span class="ruby-keyword kw">end</span>
|
|
169
|
+
|
|
170
|
+
<span class="ruby-identifier">e</span>
|
|
171
|
+
<span class="ruby-keyword kw">end</span>
|
|
172
|
+
</pre>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
178
|
+
|
|
179
|
+
<div id="method-M000049" class="method-detail">
|
|
180
|
+
<a name="M000049"></a>
|
|
181
|
+
|
|
182
|
+
<div class="method-heading">
|
|
183
|
+
<a href="#M000049" class="method-signature">
|
|
184
|
+
<span class="method-name">rel</span><span class="method-args">()</span>
|
|
185
|
+
</a>
|
|
186
|
+
</div>
|
|
187
|
+
|
|
188
|
+
<div class="method-description">
|
|
189
|
+
<p><a class="source-toggle" href="#"
|
|
190
|
+
onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
|
|
191
|
+
<div class="method-source-code" id="M000049-source">
|
|
192
|
+
<pre>
|
|
193
|
+
<span class="ruby-comment cmt"># File lib/atom/element.rb, line 597</span>
|
|
194
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rel</span>
|
|
195
|
+
<span class="ruby-ivar">@rel</span> <span class="ruby-keyword kw">or</span> <span class="ruby-value str">'alternate'</span>
|
|
196
|
+
<span class="ruby-keyword kw">end</span>
|
|
197
|
+
</pre>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
</div>
|
|
127
204
|
|
|
128
205
|
|
|
129
206
|
</div>
|