lib/html2rss/feed_builder.rb in html2rss-0.8.2 vs lib/html2rss/feed_builder.rb in html2rss-0.9.0

- old
+ new

@@ -57,10 +57,16 @@ channel_maker.generator = "html2rss V. #{::Html2rss::VERSION}" channel_maker.lastBuildDate = Time.now end def items - @items ||= Item.from_url(config.url, config) + return @items if defined?(@items) + + items = Item.from_url(config.url, config) + + items.reverse! if config.items_order == :reverse + + @items = items end def add_item(item, item_maker) item.available_attributes.each do |attribute_name| item_maker.public_send("#{attribute_name}=", item.public_send(attribute_name))