syndication 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- data/{CHANGES → CHANGES.rdoc} +4 -0
- data/{DEVELOPER → DEVELOPER.rdoc} +0 -0
- data/{IMPLEMENTATION → IMPLEMENTATION.rdoc} +0 -0
- data/{README → README.rdoc} +28 -24
- data/lib/syndication/atom.rb +1 -1
- data/lib/syndication/common.rb +1 -3
- data/lib/syndication/content.rb +1 -3
- data/lib/syndication/dublincore.rb +1 -3
- data/lib/syndication/google.rb +1 -1
- data/lib/syndication/podcast.rb +1 -3
- data/lib/syndication/rss.rb +1 -1
- data/lib/syndication/syndication.rb +3 -3
- data/lib/syndication/tagsoup.rb +1 -1
- data/rakefile +7 -40
- metadata +35 -48
data/{CHANGES → CHANGES.rdoc}
RENAMED
File without changes
|
File without changes
|
data/{README → README.rdoc}
RENAMED
@@ -19,12 +19,12 @@ Syndication::RSS).
|
|
19
19
|
|
20
20
|
== License
|
21
21
|
|
22
|
-
Syndication is Copyright 2005-
|
22
|
+
Syndication is Copyright 2005-2011 mathew <meta@pobox.com>, and is licensed
|
23
23
|
under the same terms as Ruby.
|
24
24
|
|
25
25
|
== Requirements
|
26
26
|
|
27
|
-
Built and tested using Ruby 1.
|
27
|
+
Built and tested using Ruby 1.9.2. Needs only the standard library.
|
28
28
|
|
29
29
|
== Rationale
|
30
30
|
|
@@ -38,12 +38,12 @@ documentable via Rdoc.
|
|
38
38
|
Then I tried writing code to use the standard RSS library, and discovered
|
39
39
|
that it had a number of (what I consider to be) defects:
|
40
40
|
|
41
|
-
- It
|
42
|
-
and it wasn't clear to me how to extend it to do so.
|
41
|
+
- It didn't support RSS 2.0 with extensions (such as iTunes podcast feeds),
|
42
|
+
and it wasn't clear to me how to extend it to do so.
|
43
43
|
|
44
|
-
- It
|
44
|
+
- It didn't support RSS 0.9.
|
45
45
|
|
46
|
-
- It
|
46
|
+
- It didn't support Atom.
|
47
47
|
|
48
48
|
- The API is different depending on what kind of RSS feed you are parsing.
|
49
49
|
|
@@ -64,7 +64,7 @@ Ruby standard library:
|
|
64
64
|
- Supports all RSS versions, including RSS 0.9, as well as Atom.
|
65
65
|
|
66
66
|
- Provides a unified API/object model for accessing the decoded data,
|
67
|
-
with no need to know what format the feed is in.
|
67
|
+
with no need to know what format the feed is in.
|
68
68
|
|
69
69
|
- Allows use of extended RSS 2.0 feeds.
|
70
70
|
|
@@ -81,31 +81,31 @@ with no need to know what format the feed is in.
|
|
81
81
|
Other features:
|
82
82
|
|
83
83
|
- Optional support for RSS 1.0 Dublin Core, Syndication and Content modules,
|
84
|
-
Apple iTunes Podcast elements, and Google Calendar.
|
84
|
+
Apple iTunes Podcast elements, and Google Calendar.
|
85
85
|
|
86
86
|
- Content module decodes CDATA-escaped or encoded HTML content for you.
|
87
87
|
|
88
88
|
- Supports namespaces, and encoded XHTML/HTML in Atom feeds.
|
89
89
|
|
90
90
|
- Dates decoded to Ruby DateTime objects. Note, however, that this is slow,
|
91
|
-
so parsing is only performed if you ask for the value.
|
91
|
+
so parsing is only performed if you ask for the value.
|
92
92
|
|
93
93
|
- Simple to extend to support your own RSS extensions, uses reflection.
|
94
94
|
|
95
95
|
- Uses REXML fast stream parsing API for speed, or built-in TagSoup parser
|
96
|
-
for invalid feeds.
|
96
|
+
for invalid feeds.
|
97
97
|
|
98
98
|
- Non-validating, tries to be as forgiving as possible of structural errors.
|
99
99
|
|
100
100
|
- Remaps namespace prefixes to standard values if it recognizes the module's
|
101
|
-
URL.
|
101
|
+
URL.
|
102
102
|
|
103
103
|
In the interests of balance, here are some key disadvantages over the
|
104
104
|
standard library RSS support:
|
105
105
|
|
106
106
|
- No support for _generating_ RSS feeds, only for parsing them. If
|
107
|
-
you're using Rails, you can use RXML; if not, you can use rss/maker.
|
108
|
-
My feeling is that XML generation isn't a wheel that needs reinventing.
|
107
|
+
you're using Rails, you can use RXML; if not, you can use rss/maker.
|
108
|
+
My feeling is that XML generation isn't a wheel that needs reinventing.
|
109
109
|
|
110
110
|
- Different API, not a drop-in replacement.
|
111
111
|
|
@@ -207,19 +207,23 @@ hold Atom back by trying to force it into an RSS data model.
|
|
207
207
|
|
208
208
|
Here are some possible improvements:
|
209
209
|
|
210
|
-
- RSS and Atom generation.
|
211
|
-
to generate XML in various flavors. This probably won't happen until an XML
|
212
|
-
generator is picked for the Ruby standard library.
|
210
|
+
- RSS and Atom generation.
|
213
211
|
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
that down drastically.
|
212
|
+
Create objects, then call Syndication::FeedMaker to generate XML in various
|
213
|
+
flavors. This probably won't happen until an XML generator is picked for the
|
214
|
+
Ruby standard library.
|
218
215
|
|
219
|
-
-
|
220
|
-
|
221
|
-
|
222
|
-
|
216
|
+
- Faster date parsing.
|
217
|
+
|
218
|
+
It turns out that when I asked for parsed dates in my test code, the profiler
|
219
|
+
showed Date.parse chewing up 25% of the total CPU time used. A more specific
|
220
|
+
ISO8601 specific date parser could cut that down drastically.
|
221
|
+
|
222
|
+
- Additional Google Data support.
|
223
|
+
|
224
|
+
I just wanted to be able to display my upcoming calendar dates, but clearly
|
225
|
+
there is a lot more that could be implemented. Unfortunately, recurring events
|
226
|
+
don't seem to have a clean XML representation in Google's data feeds yet.
|
223
227
|
|
224
228
|
== Feedback
|
225
229
|
|
data/lib/syndication/atom.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Provides classes for parsing Atom web syndication feeds.
|
2
2
|
# See Syndication class for documentation.
|
3
3
|
#
|
4
|
-
# Copyright
|
4
|
+
# Copyright © mathew <meta@pobox.com> 2005-2006.
|
5
5
|
# Licensed under the same terms as Ruby.
|
6
6
|
|
7
7
|
require 'uri'
|
data/lib/syndication/common.rb
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
# The file common.rb contains code common to both Atom and RSS parsing.
|
2
2
|
#
|
3
|
-
# Copyright
|
3
|
+
# Copyright © mathew <meta@pobox.com> 2006.
|
4
4
|
# Licensed under the same terms as Ruby.
|
5
|
-
#
|
6
|
-
# $Header: /var/cvs/syndication/syndication/lib/syndication/common.rb,v 1.4 2005/10/23 22:51:17 meta Exp $
|
7
5
|
|
8
6
|
require 'uri'
|
9
7
|
require 'rexml/parsers/streamparser'
|
data/lib/syndication/content.rb
CHANGED
data/lib/syndication/google.rb
CHANGED
data/lib/syndication/podcast.rb
CHANGED
data/lib/syndication/rss.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright © mathew <meta@pobox.com> 2005.
|
2
2
|
# Licensed under the same terms as Ruby.
|
3
|
-
#
|
4
|
-
# $Header$
|
5
3
|
|
6
4
|
require 'date'
|
7
5
|
|
8
6
|
module Syndication
|
9
7
|
|
8
|
+
VERSION = "0.6.4"
|
9
|
+
|
10
10
|
# Mixin for RSS 1.0 syndication data (draft standard for RSS 1.0).
|
11
11
|
#
|
12
12
|
# If you require 'syndication/syndication' these methods are added to the
|
data/lib/syndication/tagsoup.rb
CHANGED
data/rakefile
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
#
|
3
|
+
lib = File.expand_path('../lib/', __FILE__)
|
4
|
+
$:.unshift lib unless $:.include?(lib)
|
1
5
|
|
2
6
|
require 'rake/rdoctask'
|
3
7
|
require 'rake/packagetask'
|
4
|
-
require 'rake/gempackagetask'
|
5
8
|
require 'rake/testtask'
|
6
|
-
require '
|
7
|
-
|
8
|
-
PKG_VERSION = "0.6.3"
|
9
|
+
require 'syndication/syndication'
|
9
10
|
|
10
11
|
desc "Create HTML documentation from RDOC"
|
11
12
|
Rake::RDocTask.new do |rd|
|
@@ -15,47 +16,12 @@ Rake::RDocTask.new do |rd|
|
|
15
16
|
end
|
16
17
|
|
17
18
|
desc "Make tar distribution"
|
18
|
-
Rake::PackageTask.new('syndication',
|
19
|
+
Rake::PackageTask.new('syndication', Syndication::VERSION) do |t|
|
19
20
|
t.need_tar_bz2 = true
|
20
21
|
t.package_files.include("README", "CHANGES", "IMPLEMENTATION", "DEVELOPER", "lib/**/*.rb", "test/**/*.rb", "examples/**/*.rb", "rakefile", "setup.rb")
|
21
22
|
t.package_dir = "pkg"
|
22
23
|
end
|
23
24
|
|
24
|
-
spec = Gem::Specification.new do |s|
|
25
|
-
s.name = "syndication"
|
26
|
-
s.version = PKG_VERSION
|
27
|
-
s.author = "mathew"
|
28
|
-
s.email = "meta@pobox.com"
|
29
|
-
s.homepage = "http://www.pobox.com/~meta/"
|
30
|
-
s.platform = Gem::Platform::RUBY
|
31
|
-
s.description = <<-EOF
|
32
|
-
Syndication is a parser for RSS and Atom feeds. It uses either REXML or
|
33
|
-
its built-in "tag soup" parser for feed parsing. It supports extensions
|
34
|
-
to web feeds including Dublin Core metadata, Apple iTunes podcasts, and
|
35
|
-
extensions from Google and Feedburner. It is written in pure Ruby, and
|
36
|
-
designed to be easy to understand and extend. It is compatible with Ruby
|
37
|
-
1.8.x and 1.9.x.
|
38
|
-
EOF
|
39
|
-
s.rubyforge_project = 'syndication'
|
40
|
-
s.summary = "A web syndication parser for Atom and RSS with a uniform API"
|
41
|
-
candidates = Dir.glob("{bin,docs,lib,test,examples}/**/*")
|
42
|
-
candidates << "rakefile"
|
43
|
-
s.files = candidates.delete_if do |item|
|
44
|
-
item.include?("CVS") || item.include?("html")
|
45
|
-
end
|
46
|
-
s.require_path = "lib"
|
47
|
-
s.test_files = ["test/atomtest.rb", "test/rsstest.rb", "test/google.rb",
|
48
|
-
"test/tagsouptest.rb", "test/feedburntest.rb"]
|
49
|
-
s.has_rdoc = true
|
50
|
-
s.extra_rdoc_files = ["README", "IMPLEMENTATION", "CHANGES", "DEVELOPER"]
|
51
|
-
end
|
52
|
-
|
53
|
-
desc "Make RubyGems gem distribution"
|
54
|
-
Rake::GemPackageTask.new(spec) do |pkg|
|
55
|
-
pkg.need_zip = true
|
56
|
-
pkg.need_tar = true
|
57
|
-
end
|
58
|
-
|
59
25
|
desc "Run unit tests"
|
60
26
|
Rake::TestTask.new("test") { |t|
|
61
27
|
t.pattern = 'test/*.rb'
|
@@ -66,4 +32,5 @@ Rake::TestTask.new("test") { |t|
|
|
66
32
|
task :default do
|
67
33
|
puts "This is a pure Ruby library, no compilation is required."
|
68
34
|
puts "Try rake --tasks"
|
35
|
+
puts "To build the gem, use gem build syndication.gemspec"
|
69
36
|
end
|
metadata
CHANGED
@@ -1,35 +1,30 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: syndication
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 6
|
8
|
-
- 3
|
9
|
-
version: 0.6.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.4
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- mathew
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
date: 2010-11-17 00:00:00 -06:00
|
18
|
-
default_executable:
|
12
|
+
date: 2011-10-22 00:00:00.000000000Z
|
19
13
|
dependencies: []
|
20
|
-
|
21
|
-
|
14
|
+
description: ! " Syndication is a parser for RSS and Atom feeds. It uses either REXML
|
15
|
+
or\n its built-in \"tag soup\" parser for feed parsing. It supports extensions\n
|
16
|
+
\ to web feeds including Dublin Core metadata, Apple iTunes podcasts, and \n extensions
|
17
|
+
from Google and Feedburner. It is written in pure Ruby, and\n designed to be easy
|
18
|
+
to understand and extend. It is compatible with Ruby \n 1.8.x and 1.9.x.\n"
|
22
19
|
email: meta@pobox.com
|
23
20
|
executables: []
|
24
|
-
|
25
21
|
extensions: []
|
26
|
-
|
27
|
-
|
28
|
-
-
|
29
|
-
-
|
30
|
-
-
|
31
|
-
|
32
|
-
files:
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README.rdoc
|
24
|
+
- IMPLEMENTATION.rdoc
|
25
|
+
- CHANGES.rdoc
|
26
|
+
- DEVELOPER.rdoc
|
27
|
+
files:
|
33
28
|
- lib/syndication/google.rb
|
34
29
|
- lib/syndication/dublincore.rb
|
35
30
|
- lib/syndication/content.rb
|
@@ -53,43 +48,35 @@ files:
|
|
53
48
|
- examples/podcast.rb
|
54
49
|
- examples/apple.rb
|
55
50
|
- rakefile
|
56
|
-
- README
|
57
|
-
- IMPLEMENTATION
|
58
|
-
- CHANGES
|
59
|
-
- DEVELOPER
|
60
|
-
|
61
|
-
homepage: http://www.pobox.com/~meta/
|
51
|
+
- README.rdoc
|
52
|
+
- IMPLEMENTATION.rdoc
|
53
|
+
- CHANGES.rdoc
|
54
|
+
- DEVELOPER.rdoc
|
55
|
+
homepage: https://github.com/lpar/syndication
|
62
56
|
licenses: []
|
63
|
-
|
64
57
|
post_install_message:
|
65
58
|
rdoc_options: []
|
66
|
-
|
67
|
-
require_paths:
|
59
|
+
require_paths:
|
68
60
|
- lib
|
69
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
61
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
62
|
none: false
|
71
|
-
requirements:
|
72
|
-
- -
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
|
75
|
-
|
76
|
-
version: "0"
|
77
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ! '>='
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
68
|
none: false
|
79
|
-
requirements:
|
80
|
-
- -
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
|
83
|
-
- 0
|
84
|
-
version: "0"
|
69
|
+
requirements:
|
70
|
+
- - ! '>='
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
85
73
|
requirements: []
|
86
|
-
|
87
74
|
rubyforge_project: syndication
|
88
|
-
rubygems_version: 1.
|
75
|
+
rubygems_version: 1.8.11
|
89
76
|
signing_key:
|
90
77
|
specification_version: 3
|
91
78
|
summary: A web syndication parser for Atom and RSS with a uniform API
|
92
|
-
test_files:
|
79
|
+
test_files:
|
93
80
|
- test/atomtest.rb
|
94
81
|
- test/rsstest.rb
|
95
82
|
- test/google.rb
|