rss 0.2.9 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +38 -0
- data/README.md +11 -11
- data/lib/rss/itunes.rb +10 -1
- data/lib/rss/maker/itunes.rb +2 -0
- data/lib/rss/rss.rb +43 -15
- data/lib/rss/utils.rb +0 -18
- data/lib/rss/version.rb +1 -1
- data/lib/rss/xml-stylesheet.rb +3 -4
- data/lib/rss/xml.rb +3 -2
- data/lib/rss.rb +11 -11
- metadata +7 -101
- data/Gemfile +0 -6
- data/Rakefile +0 -15
- data/rss.gemspec +0 -30
- data/test/dot.png +0 -0
- data/test/rss-assertions.rb +0 -2116
- data/test/rss-testcase.rb +0 -479
- data/test/run-test.rb +0 -15
- data/test/test_1.0.rb +0 -308
- data/test/test_2.0.rb +0 -412
- data/test/test_accessor.rb +0 -104
- data/test/test_atom.rb +0 -684
- data/test/test_content.rb +0 -105
- data/test/test_dublincore.rb +0 -270
- data/test/test_image.rb +0 -215
- data/test/test_inherit.rb +0 -41
- data/test/test_itunes.rb +0 -360
- data/test/test_maker_0.9.rb +0 -477
- data/test/test_maker_1.0.rb +0 -519
- data/test/test_maker_2.0.rb +0 -758
- data/test/test_maker_atom_entry.rb +0 -394
- data/test/test_maker_atom_feed.rb +0 -455
- data/test/test_maker_content.rb +0 -48
- data/test/test_maker_dc.rb +0 -150
- data/test/test_maker_image.rb +0 -63
- data/test/test_maker_itunes.rb +0 -488
- data/test/test_maker_slash.rb +0 -38
- data/test/test_maker_sy.rb +0 -45
- data/test/test_maker_taxo.rb +0 -82
- data/test/test_maker_trackback.rb +0 -42
- data/test/test_maker_xml-stylesheet.rb +0 -84
- data/test/test_parser.rb +0 -122
- data/test/test_parser_1.0.rb +0 -529
- data/test/test_parser_2.0.rb +0 -123
- data/test/test_parser_atom_entry.rb +0 -164
- data/test/test_parser_atom_feed.rb +0 -277
- data/test/test_setup_maker_0.9.rb +0 -247
- data/test/test_setup_maker_1.0.rb +0 -551
- data/test/test_setup_maker_2.0.rb +0 -309
- data/test/test_setup_maker_atom_entry.rb +0 -410
- data/test/test_setup_maker_atom_feed.rb +0 -446
- data/test/test_setup_maker_itunes.rb +0 -146
- data/test/test_setup_maker_slash.rb +0 -39
- data/test/test_slash.rb +0 -65
- data/test/test_syndication.rb +0 -126
- data/test/test_taxonomy.rb +0 -173
- data/test/test_to_s.rb +0 -701
- data/test/test_trackback.rb +0 -136
- data/test/test_xml-stylesheet.rb +0 -109
data/test/rss-testcase.rb
DELETED
@@ -1,479 +0,0 @@
|
|
1
|
-
# frozen_string_literal: false
|
2
|
-
require "erb"
|
3
|
-
|
4
|
-
require "test/unit"
|
5
|
-
require_relative 'rss-assertions'
|
6
|
-
|
7
|
-
require "rss"
|
8
|
-
|
9
|
-
module RSS
|
10
|
-
class TestCase < Test::Unit::TestCase
|
11
|
-
include ERB::Util
|
12
|
-
|
13
|
-
include RSS
|
14
|
-
include Assertions
|
15
|
-
|
16
|
-
XMLDECL_VERSION = "1.0"
|
17
|
-
XMLDECL_ENCODING = "UTF-8"
|
18
|
-
XMLDECL_STANDALONE = "no"
|
19
|
-
|
20
|
-
RDF_ABOUT = "http://www.xml.com/xml/news.rss"
|
21
|
-
RDF_RESOURCE = "http://xml.com/universal/images/xml_tiny.gif"
|
22
|
-
TITLE_VALUE = "XML.com"
|
23
|
-
LINK_VALUE = "http://xml.com/pub"
|
24
|
-
URL_VALUE = "http://xml.com/universal/images/xml_tiny.gif"
|
25
|
-
NAME_VALUE = "hogehoge"
|
26
|
-
LANGUAGE_VALUE = "ja"
|
27
|
-
DESCRIPTION_VALUE = "
|
28
|
-
XML.com features a rich mix of information and services
|
29
|
-
for the XML community.
|
30
|
-
"
|
31
|
-
RESOURCES = [
|
32
|
-
"http://xml.com/pub/2000/08/09/xslt/xslt.html",
|
33
|
-
"http://xml.com/pub/2000/08/09/rdfdb/index.html",
|
34
|
-
]
|
35
|
-
|
36
|
-
CLOUD_DOMAIN = "data.ourfavoritesongs.com"
|
37
|
-
CLOUD_PORT = "80"
|
38
|
-
CLOUD_PATH = "/RPC2"
|
39
|
-
CLOUD_REGISTER_PROCEDURE = "ourFavoriteSongs.rssPleaseNotify"
|
40
|
-
CLOUD_PROTOCOL = "xml-rpc"
|
41
|
-
|
42
|
-
ENCLOSURE_URL = "http://www.scripting.com/mp3s/weatherReportSuite.mp3"
|
43
|
-
ENCLOSURE_LENGTH = "12216320"
|
44
|
-
ENCLOSURE_TYPE = "audio/mpeg"
|
45
|
-
|
46
|
-
CATEGORY_DOMAIN = "http://www.superopendirectory.com/"
|
47
|
-
|
48
|
-
FEED_TITLE = "dive into mark"
|
49
|
-
FEED_UPDATED = "2003-12-13T18:30:02Z"
|
50
|
-
FEED_AUTHOR_NAME = "John Doe"
|
51
|
-
FEED_ID = "urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6"
|
52
|
-
|
53
|
-
ENTRY_TITLE = "Atom-Powered Robots Run Amok"
|
54
|
-
ENTRY_LINK = "http://example.org/2003/12/13/atom03"
|
55
|
-
ENTRY_ID = "urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a"
|
56
|
-
ENTRY_UPDATED = "2003-12-13T18:30:02Z"
|
57
|
-
ENTRY_SUMMARY = "Some text."
|
58
|
-
|
59
|
-
t = Time.iso8601("2000-01-01T12:00:05+00:00")
|
60
|
-
class << t
|
61
|
-
alias_method(:to_s, :iso8601)
|
62
|
-
end
|
63
|
-
|
64
|
-
DC_ELEMENTS = {
|
65
|
-
:title => "hoge",
|
66
|
-
:description =>
|
67
|
-
" XML is placing increasingly heavy loads on
|
68
|
-
the existing technical infrastructure of the Internet.",
|
69
|
-
:creator => "Rael Dornfest (mailto:rael@oreilly.com)",
|
70
|
-
:subject => "XML",
|
71
|
-
:publisher => "The O'Reilly Network",
|
72
|
-
:contributor => "hogehoge",
|
73
|
-
:type => "fugafuga",
|
74
|
-
:format => "hohoho",
|
75
|
-
:identifier => "fufufu",
|
76
|
-
:source => "barbar",
|
77
|
-
:language => "ja",
|
78
|
-
:relation => "cococo",
|
79
|
-
:rights => "Copyright (c) 2000 O'Reilly & Associates, Inc.",
|
80
|
-
:date => t,
|
81
|
-
}
|
82
|
-
|
83
|
-
DC_NODES = DC_ELEMENTS.collect do |name, value|
|
84
|
-
"<#{DC_PREFIX}:#{name}>#{value}</#{DC_PREFIX}:#{name}>"
|
85
|
-
end.join("\n")
|
86
|
-
|
87
|
-
def default_test
|
88
|
-
# This class isn't tested
|
89
|
-
end
|
90
|
-
|
91
|
-
private
|
92
|
-
def make_xmldecl(v=XMLDECL_VERSION, e=XMLDECL_ENCODING, s=XMLDECL_STANDALONE)
|
93
|
-
rv = "<?xml version='#{v}'"
|
94
|
-
rv << " encoding='#{e}'" if e
|
95
|
-
rv << " standalone='#{s}'" if s
|
96
|
-
rv << "?>"
|
97
|
-
rv
|
98
|
-
end
|
99
|
-
|
100
|
-
def make_RDF(content=nil, xmlns=[])
|
101
|
-
<<-EORSS
|
102
|
-
#{make_xmldecl}
|
103
|
-
<rdf:RDF xmlns="#{URI}" xmlns:rdf="#{RDF::URI}"
|
104
|
-
#{xmlns.collect {|pre, uri| "xmlns:#{pre}='#{uri}'"}.join(' ')}>
|
105
|
-
#{block_given? ? yield : content}
|
106
|
-
</rdf:RDF>
|
107
|
-
EORSS
|
108
|
-
end
|
109
|
-
|
110
|
-
def make_channel(content=nil)
|
111
|
-
<<-EOC
|
112
|
-
<channel rdf:about="#{RDF_ABOUT}">
|
113
|
-
<title>#{TITLE_VALUE}</title>
|
114
|
-
<link>#{LINK_VALUE}</link>
|
115
|
-
<description>#{DESCRIPTION_VALUE}</description>
|
116
|
-
|
117
|
-
<image rdf:resource="#{RDF_RESOURCE}" />
|
118
|
-
|
119
|
-
<items>
|
120
|
-
<rdf:Seq>
|
121
|
-
#{RESOURCES.collect do |res| '<rdf:li resource="' + res + '" />' end.join("\n")}
|
122
|
-
</rdf:Seq>
|
123
|
-
</items>
|
124
|
-
|
125
|
-
<textinput rdf:resource="#{RDF_RESOURCE}" />
|
126
|
-
|
127
|
-
#{block_given? ? yield : content}
|
128
|
-
</channel>
|
129
|
-
EOC
|
130
|
-
end
|
131
|
-
|
132
|
-
def make_image(content=nil)
|
133
|
-
<<-EOI
|
134
|
-
<image rdf:about="#{RDF_ABOUT}">
|
135
|
-
<title>#{TITLE_VALUE}</title>
|
136
|
-
<url>#{URL_VALUE}</url>
|
137
|
-
<link>#{LINK_VALUE}</link>
|
138
|
-
#{block_given? ? yield : content}
|
139
|
-
</image>
|
140
|
-
EOI
|
141
|
-
end
|
142
|
-
|
143
|
-
def make_item(content=nil)
|
144
|
-
<<-EOI
|
145
|
-
<item rdf:about="#{RDF_ABOUT}">
|
146
|
-
<title>#{TITLE_VALUE}</title>
|
147
|
-
<link>#{LINK_VALUE}</link>
|
148
|
-
<description>#{DESCRIPTION_VALUE}</description>
|
149
|
-
#{block_given? ? yield : content}
|
150
|
-
</item>
|
151
|
-
EOI
|
152
|
-
end
|
153
|
-
|
154
|
-
def make_textinput(content=nil)
|
155
|
-
<<-EOT
|
156
|
-
<textinput rdf:about="#{RDF_ABOUT}">
|
157
|
-
<title>#{TITLE_VALUE}</title>
|
158
|
-
<description>#{DESCRIPTION_VALUE}</description>
|
159
|
-
<name>#{NAME_VALUE}</name>
|
160
|
-
<link>#{LINK_VALUE}</link>
|
161
|
-
#{block_given? ? yield : content}
|
162
|
-
</textinput>
|
163
|
-
EOT
|
164
|
-
end
|
165
|
-
|
166
|
-
def make_sample_RDF
|
167
|
-
make_RDF(<<-EOR)
|
168
|
-
#{make_channel}
|
169
|
-
#{make_image}
|
170
|
-
#{make_item}
|
171
|
-
#{make_textinput}
|
172
|
-
EOR
|
173
|
-
end
|
174
|
-
|
175
|
-
def make_rss20(content=nil, xmlns=[])
|
176
|
-
<<-EORSS
|
177
|
-
#{make_xmldecl}
|
178
|
-
<rss version="2.0"
|
179
|
-
#{xmlns.collect {|pre, uri| "xmlns:#{pre}='#{uri}'"}.join(' ')}>
|
180
|
-
#{block_given? ? yield : content}
|
181
|
-
</rss>
|
182
|
-
EORSS
|
183
|
-
end
|
184
|
-
|
185
|
-
def make_sample_items20
|
186
|
-
RESOURCES.collect do |res|
|
187
|
-
elems = ["<link>#{res}</link>"]
|
188
|
-
elems << "<title>title of #{res}</title>"
|
189
|
-
elems = elems.join("\n")
|
190
|
-
"<item>\n#{elems}\n</item>"
|
191
|
-
end.join("\n")
|
192
|
-
end
|
193
|
-
|
194
|
-
def make_channel20(content=nil)
|
195
|
-
<<-EOC
|
196
|
-
<channel>
|
197
|
-
<title>#{TITLE_VALUE}</title>
|
198
|
-
<link>#{LINK_VALUE}</link>
|
199
|
-
<description>#{DESCRIPTION_VALUE}</description>
|
200
|
-
<language>#{LANGUAGE_VALUE}</language>
|
201
|
-
|
202
|
-
<image>
|
203
|
-
<url>#{RDF_RESOURCE}</url>
|
204
|
-
<title>#{TITLE_VALUE}</title>
|
205
|
-
<link>#{LINK_VALUE}</link>
|
206
|
-
</image>
|
207
|
-
|
208
|
-
#{make_sample_items20}
|
209
|
-
|
210
|
-
<textInput>
|
211
|
-
<title>#{TITLE_VALUE}</title>
|
212
|
-
<description>#{DESCRIPTION_VALUE}</description>
|
213
|
-
<name>#{NAME_VALUE}</name>
|
214
|
-
<link>#{RDF_RESOURCE}</link>
|
215
|
-
</textInput>
|
216
|
-
|
217
|
-
#{block_given? ? yield : content}
|
218
|
-
</channel>
|
219
|
-
EOC
|
220
|
-
end
|
221
|
-
|
222
|
-
def make_item20(content=nil)
|
223
|
-
<<-EOI
|
224
|
-
<item>
|
225
|
-
<title>#{TITLE_VALUE}</title>
|
226
|
-
<link>#{LINK_VALUE}</link>
|
227
|
-
<description>#{DESCRIPTION_VALUE}</description>
|
228
|
-
#{block_given? ? yield : content}
|
229
|
-
</item>
|
230
|
-
EOI
|
231
|
-
end
|
232
|
-
|
233
|
-
def make_cloud20
|
234
|
-
<<-EOC
|
235
|
-
<cloud
|
236
|
-
domain="#{CLOUD_DOMAIN}"
|
237
|
-
port="#{CLOUD_PORT}"
|
238
|
-
path="#{CLOUD_PATH}"
|
239
|
-
registerProcedure="#{CLOUD_REGISTER_PROCEDURE}"
|
240
|
-
protocol="#{CLOUD_PROTOCOL}" />
|
241
|
-
EOC
|
242
|
-
end
|
243
|
-
|
244
|
-
def make_sample_rss20
|
245
|
-
make_rss20(<<-EOR)
|
246
|
-
#{make_channel20}
|
247
|
-
EOR
|
248
|
-
end
|
249
|
-
|
250
|
-
def make_feed_without_entry(content=nil, xmlns=[])
|
251
|
-
<<-EOA
|
252
|
-
<feed xmlns="#{Atom::URI}"
|
253
|
-
#{xmlns.collect {|pre, uri| "xmlns:#{pre}='#{uri}'"}.join(' ')}>
|
254
|
-
<id>#{FEED_ID}</id>
|
255
|
-
<title>#{FEED_TITLE}</title>
|
256
|
-
<updated>#{FEED_UPDATED}</updated>
|
257
|
-
<author>
|
258
|
-
<name>#{FEED_AUTHOR_NAME}</name>
|
259
|
-
</author>
|
260
|
-
#{block_given? ? yield : content}
|
261
|
-
</feed>
|
262
|
-
EOA
|
263
|
-
end
|
264
|
-
|
265
|
-
def make_entry(content=nil)
|
266
|
-
<<-EOA
|
267
|
-
<entry>
|
268
|
-
<title>#{ENTRY_TITLE}</title>
|
269
|
-
<id>#{ENTRY_ID}</id>
|
270
|
-
<updated>#{ENTRY_UPDATED}</updated>
|
271
|
-
#{block_given? ? yield : content}
|
272
|
-
</entry>
|
273
|
-
EOA
|
274
|
-
end
|
275
|
-
|
276
|
-
def make_feed_with_open_entry(content=nil, xmlns=[], &block)
|
277
|
-
make_feed_without_entry(<<-EOA, xmlns)
|
278
|
-
#{make_entry(content, &block)}
|
279
|
-
EOA
|
280
|
-
end
|
281
|
-
|
282
|
-
def make_feed_with_open_entry_source(content=nil, xmlns=[])
|
283
|
-
make_feed_with_open_entry(<<-EOA, xmlns)
|
284
|
-
<source>
|
285
|
-
#{block_given? ? yield : content}
|
286
|
-
</source>
|
287
|
-
EOA
|
288
|
-
end
|
289
|
-
|
290
|
-
def make_feed(content=nil, xmlns=[])
|
291
|
-
make_feed_without_entry(<<-EOA, xmlns)
|
292
|
-
<entry>
|
293
|
-
<title>#{ENTRY_TITLE}</title>
|
294
|
-
<link href="#{ENTRY_LINK}"/>
|
295
|
-
<id>#{ENTRY_ID}</id>
|
296
|
-
<updated>#{ENTRY_UPDATED}</updated>
|
297
|
-
<summary>#{ENTRY_SUMMARY}</summary>
|
298
|
-
</entry>
|
299
|
-
#{block_given? ? yield : content}
|
300
|
-
EOA
|
301
|
-
end
|
302
|
-
|
303
|
-
def make_entry_document(content=nil, xmlns=[])
|
304
|
-
<<-EOA
|
305
|
-
<entry xmlns="#{Atom::URI}"
|
306
|
-
#{xmlns.collect {|pre, uri| "xmlns:#{pre}='#{uri}'"}.join(' ')}>
|
307
|
-
<id>#{ENTRY_ID}</id>
|
308
|
-
<title>#{ENTRY_TITLE}</title>
|
309
|
-
<updated>#{ENTRY_UPDATED}</updated>
|
310
|
-
<author>
|
311
|
-
<name>#{FEED_AUTHOR_NAME}</name>
|
312
|
-
</author>
|
313
|
-
#{block_given? ? yield : content}
|
314
|
-
</entry>
|
315
|
-
EOA
|
316
|
-
end
|
317
|
-
|
318
|
-
def make_entry_document_with_open_source(content=nil, xmlns=[])
|
319
|
-
make_entry_document(<<-EOA, xmlns)
|
320
|
-
<source>
|
321
|
-
#{block_given? ? yield : content}
|
322
|
-
</source>
|
323
|
-
EOA
|
324
|
-
end
|
325
|
-
|
326
|
-
def make_element(elem_name, attrs, contents)
|
327
|
-
attrs_str = attrs.collect do |name, value|
|
328
|
-
"#{h name}='#{h value}'"
|
329
|
-
end.join(" ")
|
330
|
-
attrs_str = " #{attrs_str}" unless attrs_str.empty?
|
331
|
-
|
332
|
-
if contents.is_a?(String)
|
333
|
-
contents_str = h(contents)
|
334
|
-
else
|
335
|
-
contents_str = contents.collect do |name, value|
|
336
|
-
"#{Element::INDENT}<#{h name}>#{h value}</#{h name}>"
|
337
|
-
end.join("\n")
|
338
|
-
contents_str = "\n#{contents_str}\n"
|
339
|
-
end
|
340
|
-
|
341
|
-
"<#{h elem_name}#{attrs_str}>#{contents_str}</#{h elem_name}>"
|
342
|
-
end
|
343
|
-
|
344
|
-
def xmlns_container(xmlns_decls, content)
|
345
|
-
attributes = xmlns_decls.collect do |prefix, uri|
|
346
|
-
"xmlns:#{h prefix}=\"#{h uri}\""
|
347
|
-
end.join(" ")
|
348
|
-
"<dummy #{attributes}>#{content}</dummy>"
|
349
|
-
end
|
350
|
-
|
351
|
-
private
|
352
|
-
def setup_rss10(rdf)
|
353
|
-
assert_equal("", rdf.to_s)
|
354
|
-
|
355
|
-
channel = RDF::Channel.new
|
356
|
-
assert_equal("", channel.to_s)
|
357
|
-
channel.about = "http://example.com/index.rdf"
|
358
|
-
channel.title = "title"
|
359
|
-
channel.link = "http://example.com/"
|
360
|
-
channel.description = "description"
|
361
|
-
assert_equal("", channel.to_s)
|
362
|
-
|
363
|
-
item_title = "item title"
|
364
|
-
item_link = "http://example.com/item"
|
365
|
-
channel.items = RDF::Channel::Items.new
|
366
|
-
channel.items.Seq.lis << RDF::Channel::Items::Seq::Li.new(item_link)
|
367
|
-
assert_not_equal("", channel.to_s)
|
368
|
-
|
369
|
-
rdf.channel = channel
|
370
|
-
assert_equal("", rdf.to_s)
|
371
|
-
|
372
|
-
item = RDF::Item.new
|
373
|
-
item.title = item_title
|
374
|
-
item.link = item_link
|
375
|
-
item.about = item_link
|
376
|
-
rdf.items << item
|
377
|
-
assert_not_equal("", rdf.to_s)
|
378
|
-
end
|
379
|
-
|
380
|
-
def setup_rss20(rss)
|
381
|
-
assert_equal("", rss.to_s)
|
382
|
-
|
383
|
-
channel = Rss::Channel.new
|
384
|
-
assert_equal("", channel.to_s)
|
385
|
-
channel.title = "title"
|
386
|
-
channel.link = "http://example.com/"
|
387
|
-
channel.description = "description"
|
388
|
-
assert_not_equal("", channel.to_s)
|
389
|
-
|
390
|
-
rss.channel = channel
|
391
|
-
assert_not_equal("", rss.to_s)
|
392
|
-
end
|
393
|
-
|
394
|
-
def setup_dummy_channel(maker)
|
395
|
-
about = "http://hoge.com"
|
396
|
-
title = "fugafuga"
|
397
|
-
link = "http://hoge.com/feed.xml"
|
398
|
-
description = "fugafugafugafuga"
|
399
|
-
language = "ja"
|
400
|
-
|
401
|
-
maker.channel.about = about
|
402
|
-
maker.channel.title = title
|
403
|
-
maker.channel.link = link
|
404
|
-
maker.channel.description = description
|
405
|
-
maker.channel.language = language
|
406
|
-
end
|
407
|
-
|
408
|
-
def setup_dummy_channel_atom(maker)
|
409
|
-
updated = Time.now
|
410
|
-
author = "Foo"
|
411
|
-
|
412
|
-
setup_dummy_channel(maker)
|
413
|
-
maker.channel.links.first.rel = "self"
|
414
|
-
maker.channel.links.first.type = "application/atom+xml"
|
415
|
-
maker.channel.updated = updated
|
416
|
-
maker.channel.author = author
|
417
|
-
end
|
418
|
-
|
419
|
-
def setup_dummy_image(maker)
|
420
|
-
title = "fugafuga"
|
421
|
-
link = "http://hoge.com"
|
422
|
-
url = "http://hoge.com/hoge.png"
|
423
|
-
|
424
|
-
maker.channel.link = link if maker.channel.link.nil?
|
425
|
-
|
426
|
-
maker.image.title = title
|
427
|
-
maker.image.url = url
|
428
|
-
end
|
429
|
-
|
430
|
-
def setup_dummy_textinput(maker)
|
431
|
-
title = "fugafuga"
|
432
|
-
description = "text hoge fuga"
|
433
|
-
name = "hoge"
|
434
|
-
link = "http://hoge.com/search.cgi"
|
435
|
-
|
436
|
-
maker.textinput.title = title
|
437
|
-
maker.textinput.description = description
|
438
|
-
maker.textinput.name = name
|
439
|
-
maker.textinput.link = link
|
440
|
-
end
|
441
|
-
|
442
|
-
def setup_dummy_item(maker)
|
443
|
-
title = "TITLE"
|
444
|
-
link = "http://hoge.com/"
|
445
|
-
|
446
|
-
item = maker.items.new_item
|
447
|
-
item.title = title
|
448
|
-
item.link = link
|
449
|
-
end
|
450
|
-
|
451
|
-
def setup_dummy_item_atom(maker)
|
452
|
-
setup_dummy_item(maker)
|
453
|
-
|
454
|
-
item = maker.items.first
|
455
|
-
item.id = "http://example.net/xxx"
|
456
|
-
item.updated = Time.now
|
457
|
-
end
|
458
|
-
|
459
|
-
def setup_taxo_topic(target, topics)
|
460
|
-
topics.each do |topic|
|
461
|
-
taxo_topic = target.taxo_topics.new_taxo_topic
|
462
|
-
topic.each do |name, value|
|
463
|
-
case name
|
464
|
-
when :link
|
465
|
-
taxo_topic.taxo_link = value
|
466
|
-
when :topics
|
467
|
-
value.each do |t|
|
468
|
-
taxo_topic.taxo_topics << t
|
469
|
-
end
|
470
|
-
else
|
471
|
-
dc_elems = taxo_topic.__send__("dc_#{name}s")
|
472
|
-
dc_elem = dc_elems.__send__("new_#{name}")
|
473
|
-
dc_elem.value = value
|
474
|
-
end
|
475
|
-
end
|
476
|
-
end
|
477
|
-
end
|
478
|
-
end
|
479
|
-
end
|
data/test/run-test.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
$VERBOSE = true
|
4
|
-
|
5
|
-
base_dir = File.expand_path("..", __dir__)
|
6
|
-
lib_dir = File.join(base_dir, "lib")
|
7
|
-
test_dir = File.join(base_dir, "test")
|
8
|
-
|
9
|
-
require "test-unit"
|
10
|
-
|
11
|
-
$LOAD_PATH.unshift(lib_dir)
|
12
|
-
|
13
|
-
require_relative "rss-testcase"
|
14
|
-
|
15
|
-
exit(Test::Unit::AutoRunner.run(true, test_dir))
|