aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rss/atom.rb
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-05 03:03:05 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-05 03:03:05 +0000
commit71976790ec02f88d9fb51fab151312124f6df223 (patch)
tree0a70c0031e53d40f05e846486b25f91070274d66 /lib/rss/atom.rb
parent43009063c70fe62028eb035e67a06863b98dc540 (diff)
downloadruby-71976790ec02f88d9fb51fab151312124f6df223.tar.gz
* lib/rss, sample/rss, test/rss:
- 0.1.7 -> 0.1.8. - supported <itunes:XXX>. - reverted backward incompatibility API changes introduced 0.1.7. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rss/atom.rb')
-rw-r--r--lib/rss/atom.rb42
1 files changed, 21 insertions, 21 deletions
diff --git a/lib/rss/atom.rb b/lib/rss/atom.rb
index 901e69a4b0..7cba934feb 100644
--- a/lib/rss/atom.rb
+++ b/lib/rss/atom.rb
@@ -131,7 +131,7 @@ module RSS
private
def maker_target(target)
- target.__send__(self.class.name.split(/::/).last.downcase)
+ target.__send__(self.class.name.split(/::/).last.downcase) {|x| x}
end
def setup_maker_attributes(target)
@@ -239,6 +239,11 @@ module RSS
alias_method :items, :entries
+ def have_author?
+ authors.any? {|author| !author.to_s.empty?} or
+ entries.any? {|entry| entry.have_author?(false)}
+ end
+
private
def atom_validate(ignore_unknown_element, tags, uri)
unless have_author?
@@ -251,11 +256,6 @@ module RSS
super and have_author?
end
- def have_author?
- authors.any? {|author| !author.to_s.empty?} or
- entries.any? {|entry| entry.__send!(:have_author?, false)}
- end
-
def maker_target(maker)
maker.channel
end
@@ -315,9 +315,10 @@ module RSS
private
def setup_maker_attributes(target)
- generator = target.generator
- generator.uri = uri if uri
- generator.version = version if version
+ target.generator do |generator|
+ generator.uri = uri if uri
+ generator.version = version if version
+ end
end
end
@@ -408,6 +409,12 @@ module RSS
tag, URI, occurs, tag, *args)
end
+ def have_author?(check_parent=true)
+ authors.any? {|author| !author.to_s.empty?} or
+ (check_parent and @parent and @parent.have_author?) or
+ (source and source.have_author?)
+ end
+
private
def atom_validate(ignore_unknown_element, tags, uri)
unless have_author?
@@ -420,12 +427,6 @@ module RSS
super and have_author?
end
- def have_author?(check_parent=true)
- authors.any? {|author| !author.to_s.empty?} or
- (check_parent and @parent and @parent.__send!(:have_author?)) or
- (source and source.__send!(:have_author?))
- end
-
def maker_target(items)
if items.respond_to?("items")
# For backward compatibility
@@ -606,7 +607,6 @@ module RSS
tag, URI, occurs, tag, *args)
end
- private
def have_author?
!author.to_s.empty?
end
@@ -674,6 +674,11 @@ module RSS
super(maker)
end
+ def have_author?
+ authors.any? {|author| !author.to_s.empty?} or
+ (source and source.have_author?)
+ end
+
private
def atom_validate(ignore_unknown_element, tags, uri)
unless have_author?
@@ -686,11 +691,6 @@ module RSS
super and have_author?
end
- def have_author?
- authors.any? {|author| !author.to_s.empty?} or
- (source and source.__send!(:have_author?))
- end
-
def maker_target(maker)
maker.items.new_item
end