Class: Debci::Feed
- Inherits:
-
Object
- Object
- Debci::Feed
- Defined in:
- lib/debci/feed.rb
Instance Method Summary collapse
-
#initialize(news) ⇒ Feed
constructor
A new instance of Feed.
- #to_s ⇒ Object
- #write(output) ⇒ Object
Constructor Details
#initialize(news) ⇒ Feed
Returns a new instance of Feed.
7 8 9 10 11 12 13 14 |
# File 'lib/debci/feed.rb', line 7 def initialize(news) @feed = RSS::Maker.make('atom') do |feed| feed.channel. = "#{distro_name} Continuous Integration" feed.channel.updated = (news.first && news.first.date) || Time.parse('2020-04-18T21:17:00 UTC') yield(feed) if block_given? insert_items(news, feed) end end |
Instance Method Details
#to_s ⇒ Object
20 21 22 |
# File 'lib/debci/feed.rb', line 20 def to_s @feed.to_s.gsub('<summary>', '<summary type="html">') end |
#write(output) ⇒ Object
16 17 18 |
# File 'lib/debci/feed.rb', line 16 def write(output) File.write(output, to_s) end |