Class: ODDB::Export::Rss::Exporter
- Inherits:
-
Object
- Object
- ODDB::Export::Rss::Exporter
- Defined in:
- lib/oddb/export/rss.rb
Direct Known Subclasses
Instance Method Summary collapse
- #export ⇒ Object
-
#initialize ⇒ Exporter
constructor
A new instance of Exporter.
- #rss(items, session) ⇒ Object
Constructor Details
Instance Method Details
#export ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/oddb/export/rss.rb', line 16 def export items = sorted_items return if(items.empty?) Export.l10n_sessions { |session| dir = File.join(@rss_dir, session.language) FileUtils.mkdir_p(dir) path = File.join(dir, @filename) tmp = File.join(dir, '.' << @filename) File.open(tmp, 'w') { |io| io.puts rss(items, session) } File.rename(tmp, path) } end |