simple-rss 1.0.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/LICENSE +429 -0
- data/README +40 -0
- data/Rakefile +90 -0
- data/doc/classes/SimpleRSS.html +279 -0
- data/doc/classes/SimpleRSS.src/M000001.html +21 -0
- data/doc/classes/SimpleRSS.src/M000002.html +16 -0
- data/doc/classes/SimpleRSS.src/M000004.html +18 -0
- data/doc/classes/SimpleRSS.src/M000005.html +18 -0
- data/doc/classes/SimpleRSS.src/M000006.html +18 -0
- data/doc/classes/SimpleRSS.src/M000007.html +18 -0
- data/doc/classes/SimpleRSS.src/M000008.html +18 -0
- data/doc/classes/SimpleRSSError.html +111 -0
- data/doc/created.rid +1 -0
- data/doc/files/README.html +170 -0
- data/doc/files/lib/simple-rss_rb.html +109 -0
- data/doc/fr_class_index.html +28 -0
- data/doc/fr_file_index.html +28 -0
- data/doc/fr_method_index.html +34 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/simple-rss.rb +127 -0
- data/test/base/base_test.rb +48 -0
- data/test/data/atom.xml +45 -0
- data/test/data/not-rss.xml +8 -0
- data/test/data/rss09.rdf +76 -0
- data/test/data/rss20.xml +818 -0
- data/test/test_helper.rb +4 -0
- metadata +73 -0
data/Rakefile
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'rake/testtask'
|
4
|
+
require 'rake/rdoctask'
|
5
|
+
require 'rake/gempackagetask'
|
6
|
+
require 'rake/contrib/rubyforgepublisher'
|
7
|
+
|
8
|
+
PKG_VERSION = "1.0.0"
|
9
|
+
|
10
|
+
PKG_FILES = FileList[
|
11
|
+
"lib/*", "bin/*", "test/**/*", "[A-Z]*", "Rakefile", "doc/**/*"
|
12
|
+
]
|
13
|
+
|
14
|
+
desc "Default Task"
|
15
|
+
task :default => [ :test ]
|
16
|
+
|
17
|
+
# Run the unit tests
|
18
|
+
desc "Run all unit tests"
|
19
|
+
Rake::TestTask.new("test") { |t|
|
20
|
+
t.libs << "lib"
|
21
|
+
t.pattern = 'test/*/*_test.rb'
|
22
|
+
t.verbose = true
|
23
|
+
}
|
24
|
+
|
25
|
+
# Make a console, useful when working on tests
|
26
|
+
desc "Generate a test console"
|
27
|
+
task :console do
|
28
|
+
verbose( false ) { sh "irb -I lib/ -r 'simple-rss'" }
|
29
|
+
end
|
30
|
+
|
31
|
+
# Genereate the RDoc documentation
|
32
|
+
desc "Create documentation"
|
33
|
+
Rake::RDocTask.new("doc") { |rdoc|
|
34
|
+
rdoc.title = "Simple RSS - A Flexible RSS and Atom reader for Ruby"
|
35
|
+
rdoc.rdoc_dir = 'doc'
|
36
|
+
rdoc.rdoc_files.include('README')
|
37
|
+
rdoc.rdoc_files.include('lib/*.rb')
|
38
|
+
}
|
39
|
+
|
40
|
+
# Genereate the package
|
41
|
+
spec = Gem::Specification.new do |s|
|
42
|
+
|
43
|
+
#### Basic information.
|
44
|
+
|
45
|
+
s.name = 'simple-rss'
|
46
|
+
s.version = PKG_VERSION
|
47
|
+
s.summary = <<-EOF
|
48
|
+
A simple, flexible, extensible, and liberal RSS and Atom reader for Ruby. It is designed to be backwards compatible with the standard RSS parser, but will never do RSS generation.
|
49
|
+
EOF
|
50
|
+
s.description = <<-EOF
|
51
|
+
A simple, flexible, extensible, and liberal RSS and Atom reader for Ruby. It is designed to be backwards compatible with the standard RSS parser, but will never do RSS generation.
|
52
|
+
EOF
|
53
|
+
|
54
|
+
#### Which files are to be included in this gem? Everything! (Except CVS directories.)
|
55
|
+
|
56
|
+
s.files = PKG_FILES
|
57
|
+
|
58
|
+
#### Load-time details: library and application (you will need one or both).
|
59
|
+
|
60
|
+
s.require_path = 'lib'
|
61
|
+
|
62
|
+
#### Documentation and testing.
|
63
|
+
|
64
|
+
s.has_rdoc = true
|
65
|
+
|
66
|
+
#### Author and project details.
|
67
|
+
|
68
|
+
s.author = "Lucas Carlson"
|
69
|
+
s.email = "lucas@rufy.com"
|
70
|
+
s.homepage = "http://simple-rss.rubyforge.org/"
|
71
|
+
end
|
72
|
+
|
73
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
74
|
+
pkg.need_zip = true
|
75
|
+
pkg.need_tar = true
|
76
|
+
end
|
77
|
+
|
78
|
+
desc "Report code statistics (KLOCs, etc) from the application"
|
79
|
+
task :stats do
|
80
|
+
require 'code_statistics'
|
81
|
+
CodeStatistics.new(
|
82
|
+
["Library", "lib"],
|
83
|
+
["Units", "test"]
|
84
|
+
).to_s
|
85
|
+
end
|
86
|
+
|
87
|
+
desc "Publish new documentation"
|
88
|
+
task :publish do
|
89
|
+
Rake::RubyForgePublisher.new('simple-rss', 'cardmagic').upload
|
90
|
+
end
|
@@ -0,0 +1,279 @@
|
|
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: SimpleRSS</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">SimpleRSS</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/simple-rss_rb.html">
|
59
|
+
lib/simple-rss.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
|
+
Object
|
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="#M000002">channel</a>
|
90
|
+
<a href="#M000003">feed</a>
|
91
|
+
<a href="#M000004">feed_tags</a>
|
92
|
+
<a href="#M000005">feed_tags=</a>
|
93
|
+
<a href="#M000006">item_tags</a>
|
94
|
+
<a href="#M000007">item_tags=</a>
|
95
|
+
<a href="#M000001">new</a>
|
96
|
+
<a href="#M000008">parse</a>
|
97
|
+
</div>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
<!-- if includes -->
|
104
|
+
|
105
|
+
<div id="section">
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<div id="aliases-list">
|
110
|
+
<h3 class="section-bar">External Aliases</h3>
|
111
|
+
|
112
|
+
<div class="name-list">
|
113
|
+
<table summary="aliases">
|
114
|
+
<tr class="top-aligned-row context-row">
|
115
|
+
<td class="context-item-name">items</td>
|
116
|
+
<td>-></td>
|
117
|
+
<td class="context-item-value">entries</td>
|
118
|
+
</tr>
|
119
|
+
</table>
|
120
|
+
</div>
|
121
|
+
</div>
|
122
|
+
|
123
|
+
|
124
|
+
<div id="attribute-list">
|
125
|
+
<h3 class="section-bar">Attributes</h3>
|
126
|
+
|
127
|
+
<div class="name-list">
|
128
|
+
<table>
|
129
|
+
<tr class="top-aligned-row context-row">
|
130
|
+
<td class="context-item-name">items</td>
|
131
|
+
<td class="context-item-value"> [R] </td>
|
132
|
+
<td class="context-item-desc"></td>
|
133
|
+
</tr>
|
134
|
+
<tr class="top-aligned-row context-row">
|
135
|
+
<td class="context-item-name">source</td>
|
136
|
+
<td class="context-item-value"> [R] </td>
|
137
|
+
<td class="context-item-desc"></td>
|
138
|
+
</tr>
|
139
|
+
</table>
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<!-- if method_list -->
|
146
|
+
<div id="methods">
|
147
|
+
<h3 class="section-bar">Public Class methods</h3>
|
148
|
+
|
149
|
+
<div id="method-M000004" class="method-detail">
|
150
|
+
<a name="M000004"></a>
|
151
|
+
|
152
|
+
<div class="method-heading">
|
153
|
+
<a href="SimpleRSS.src/M000004.html" target="Code" class="method-signature"
|
154
|
+
onclick="popupCode('SimpleRSS.src/M000004.html');return false;">
|
155
|
+
<span class="method-name">feed_tags</span><span class="method-args">()</span>
|
156
|
+
</a>
|
157
|
+
</div>
|
158
|
+
|
159
|
+
<div class="method-description">
|
160
|
+
</div>
|
161
|
+
</div>
|
162
|
+
|
163
|
+
<div id="method-M000005" class="method-detail">
|
164
|
+
<a name="M000005"></a>
|
165
|
+
|
166
|
+
<div class="method-heading">
|
167
|
+
<a href="SimpleRSS.src/M000005.html" target="Code" class="method-signature"
|
168
|
+
onclick="popupCode('SimpleRSS.src/M000005.html');return false;">
|
169
|
+
<span class="method-name">feed_tags=</span><span class="method-args">(ft)</span>
|
170
|
+
</a>
|
171
|
+
</div>
|
172
|
+
|
173
|
+
<div class="method-description">
|
174
|
+
</div>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
<div id="method-M000006" class="method-detail">
|
178
|
+
<a name="M000006"></a>
|
179
|
+
|
180
|
+
<div class="method-heading">
|
181
|
+
<a href="SimpleRSS.src/M000006.html" target="Code" class="method-signature"
|
182
|
+
onclick="popupCode('SimpleRSS.src/M000006.html');return false;">
|
183
|
+
<span class="method-name">item_tags</span><span class="method-args">()</span>
|
184
|
+
</a>
|
185
|
+
</div>
|
186
|
+
|
187
|
+
<div class="method-description">
|
188
|
+
</div>
|
189
|
+
</div>
|
190
|
+
|
191
|
+
<div id="method-M000007" class="method-detail">
|
192
|
+
<a name="M000007"></a>
|
193
|
+
|
194
|
+
<div class="method-heading">
|
195
|
+
<a href="SimpleRSS.src/M000007.html" target="Code" class="method-signature"
|
196
|
+
onclick="popupCode('SimpleRSS.src/M000007.html');return false;">
|
197
|
+
<span class="method-name">item_tags=</span><span class="method-args">(it)</span>
|
198
|
+
</a>
|
199
|
+
</div>
|
200
|
+
|
201
|
+
<div class="method-description">
|
202
|
+
</div>
|
203
|
+
</div>
|
204
|
+
|
205
|
+
<div id="method-M000001" class="method-detail">
|
206
|
+
<a name="M000001"></a>
|
207
|
+
|
208
|
+
<div class="method-heading">
|
209
|
+
<a href="SimpleRSS.src/M000001.html" target="Code" class="method-signature"
|
210
|
+
onclick="popupCode('SimpleRSS.src/M000001.html');return false;">
|
211
|
+
<span class="method-name">new</span><span class="method-args">(source)</span>
|
212
|
+
</a>
|
213
|
+
</div>
|
214
|
+
|
215
|
+
<div class="method-description">
|
216
|
+
</div>
|
217
|
+
</div>
|
218
|
+
|
219
|
+
<div id="method-M000008" class="method-detail">
|
220
|
+
<a name="M000008"></a>
|
221
|
+
|
222
|
+
<div class="method-heading">
|
223
|
+
<a href="SimpleRSS.src/M000008.html" target="Code" class="method-signature"
|
224
|
+
onclick="popupCode('SimpleRSS.src/M000008.html');return false;">
|
225
|
+
<span class="method-name">parse</span><span class="method-args">(source, strict=false)</span>
|
226
|
+
</a>
|
227
|
+
</div>
|
228
|
+
|
229
|
+
<div class="method-description">
|
230
|
+
<p>
|
231
|
+
The strict attribute is for compatibility with Ruby’s standard RSS
|
232
|
+
parser
|
233
|
+
</p>
|
234
|
+
</div>
|
235
|
+
</div>
|
236
|
+
|
237
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
238
|
+
|
239
|
+
<div id="method-M000002" class="method-detail">
|
240
|
+
<a name="M000002"></a>
|
241
|
+
|
242
|
+
<div class="method-heading">
|
243
|
+
<a href="SimpleRSS.src/M000002.html" target="Code" class="method-signature"
|
244
|
+
onclick="popupCode('SimpleRSS.src/M000002.html');return false;">
|
245
|
+
<span class="method-name">channel</span><span class="method-args">()</span>
|
246
|
+
</a>
|
247
|
+
</div>
|
248
|
+
|
249
|
+
<div class="method-description">
|
250
|
+
</div>
|
251
|
+
</div>
|
252
|
+
|
253
|
+
<div id="method-M000003" class="method-detail">
|
254
|
+
<a name="M000003"></a>
|
255
|
+
|
256
|
+
<div class="method-heading">
|
257
|
+
<span class="method-name">feed</span><span class="method-args">()</span>
|
258
|
+
</div>
|
259
|
+
|
260
|
+
<div class="method-description">
|
261
|
+
<p>
|
262
|
+
Alias for <a href="SimpleRSS.html#M000002">channel</a>
|
263
|
+
</p>
|
264
|
+
</div>
|
265
|
+
</div>
|
266
|
+
|
267
|
+
|
268
|
+
</div>
|
269
|
+
|
270
|
+
|
271
|
+
</div>
|
272
|
+
|
273
|
+
|
274
|
+
<div id="validator-badges">
|
275
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
276
|
+
</div>
|
277
|
+
|
278
|
+
</body>
|
279
|
+
</html>
|
@@ -0,0 +1,21 @@
|
|
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>new (SimpleRSS)</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/simple-rss.rb, line 32</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">source</span>)
|
15
|
+
<span class="ruby-ivar">@source</span> = <span class="ruby-identifier">source</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:read</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">source</span>.<span class="ruby-identifier">read</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">source</span>.<span class="ruby-identifier">to_s</span>
|
16
|
+
<span class="ruby-ivar">@items</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
17
|
+
|
18
|
+
<span class="ruby-identifier">parse</span>
|
19
|
+
<span class="ruby-keyword kw">end</span></pre>
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -0,0 +1,16 @@
|
|
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>channel (SimpleRSS)</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/simple-rss.rb, line 39</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">channel</span>() <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">end</span></pre>
|
15
|
+
</body>
|
16
|
+
</html>
|
@@ -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>feed_tags (SimpleRSS)</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/simple-rss.rb, line 43</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">feed_tags</span>
|
15
|
+
<span class="ruby-ivar">@@feed_tags</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -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>feed_tags= (SimpleRSS)</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/simple-rss.rb, line 46</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">feed_tags=</span>(<span class="ruby-identifier">ft</span>)
|
15
|
+
<span class="ruby-ivar">@@feed_tags</span> = <span class="ruby-identifier">ft</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|