diff options
author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-08-11 04:08:05 +0000 |
---|---|---|
committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-08-11 04:08:05 +0000 |
commit | 2bafec23f0197ac4d8c89ddc028d632cf8add438 (patch) | |
tree | 76c5235f2050b4d9bc8c2052e7fc7960fc15f90a /lib/rss | |
parent | 29c1d980173e97cee9fa6235e819a21c20002224 (diff) | |
download | ruby-2bafec23f0197ac4d8c89ddc028d632cf8add438.tar.gz |
* lib/rss/1.0.rb (RSS::RDF::Channel#setup_maker_attributes):
removed self.
* lib/rss/maker/base.rb (RSS::Maker::ItemsBase#<=>): use #date
instead of @date.
(RSS::Maker::Base::self.def_array_element): added #size.
* lib/rss/maker/1.0.rb
(RSS::Maker::RSS10::Channel#to_rss,
RSS::Maker::RSS10::Items::Item#to_rss): cleared dc_dates set
upped by using #date.
* lib/rss/maker/dublincore.rb
(RSS::Maker::ChannelBase, RSS::Maker::ItemsBase::ItemBase):
fixed opposite alias.
* test/rss/test_setup_maker_1.0.rb
(RSS::TestSetupMaker10::test_setup_maker_items_sort): added some
tests for RSS::Maker::ItemsBase#do_sort.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rss')
-rw-r--r-- | lib/rss/1.0.rb | 2 | ||||
-rw-r--r-- | lib/rss/maker/1.0.rb | 2 | ||||
-rw-r--r-- | lib/rss/maker/base.rb | 8 | ||||
-rw-r--r-- | lib/rss/maker/dublincore.rb | 16 |
4 files changed, 15 insertions, 13 deletions
diff --git a/lib/rss/1.0.rb b/lib/rss/1.0.rb index 0e0f8d9fd2..fb1629944b 100644 --- a/lib/rss/1.0.rb +++ b/lib/rss/1.0.rb @@ -279,7 +279,7 @@ module RSS end def setup_maker_attributes(channel) - channel.about = self.about + channel.about = about end class Image < Element diff --git a/lib/rss/maker/1.0.rb b/lib/rss/maker/1.0.rb index e38a2f89e0..3e6542a007 100644 --- a/lib/rss/maker/1.0.rb +++ b/lib/rss/maker/1.0.rb @@ -31,6 +31,7 @@ module RSS channel = RDF::Channel.new(@about) set = setup_values(channel) if set + channel.dc_dates.clear rss.channel = channel setup_items(rss) setup_image(rss) @@ -143,6 +144,7 @@ module RSS item = RDF::Item.new(@link) set = setup_values(item) if set + item.dc_dates.clear rss.items << item setup_other_elements(rss) end diff --git a/lib/rss/maker/base.rb b/lib/rss/maker/base.rb index 629f794b07..4972821cf1 100644 --- a/lib/rss/maker/base.rb +++ b/lib/rss/maker/base.rb @@ -52,7 +52,7 @@ module RSS def_delegators("@\#{name}", :<<, :[], :[]=, :first, :last) def_delegators("@\#{name}", :push, :pop, :shift, :unshift) - def_delegators("@\#{name}", :each) + def_delegators("@\#{name}", :each, :size) add_need_initialize_variable(name, "[]") end @@ -457,9 +457,9 @@ EOC alias_method(:pubDate=, :date=) def <=>(other) - if @date and other.date - @date <=> other.date - elsif @date + if date and other.date + date <=> other.date + elsif date 1 elsif other.date -1 diff --git a/lib/rss/maker/dublincore.rb b/lib/rss/maker/dublincore.rb index 1876ec36ce..29da1c39d9 100644 --- a/lib/rss/maker/dublincore.rb +++ b/lib/rss/maker/dublincore.rb @@ -103,10 +103,10 @@ EOC class ChannelBase include DublinCoreModel - remove_method(:dc_date) - remove_method(:dc_date=) - alias_method(:dc_date, :date) - alias_method(:dc_date=, :date=) + remove_method(:date) + remove_method(:date=) + alias_method(:date, :dc_date) + alias_method(:date=, :dc_date=) end class ImageBase; include DublinCoreModel; end @@ -114,10 +114,10 @@ EOC class ItemBase include DublinCoreModel - remove_method(:dc_date) - remove_method(:dc_date=) - alias_method(:dc_date, :date) - alias_method(:dc_date=, :date=) + remove_method(:date) + remove_method(:date=) + alias_method(:date, :dc_date) + alias_method(:date=, :dc_date=) end end class TextinputBase; include DublinCoreModel; end |