Class: SourceBase

Inherits:
Object
  • Object
show all
Defined in:
lib/abelard/load.rb

Direct Known Subclasses

FileSource, Source

Instance Method Summary collapse

Instance Method Details

#process(parser, destination) ⇒ Object



196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/abelard/load.rb', line 196

def process(parser, destination)
  doc = parser.parse

  case doc.root.name
  when "feed"
    atom = Splitter_atom.new(doc, destination)
    atom.split_items
  when "rss"
    rss = Splitter_rss.new(doc, destination)
    rss.split_items
  else
    puts "don't know what to do with element #{doc.root.name}"
  end

  archive = Directory.new(destination)
  archive.save
end