# .../DorothyGilman/P06_On_the_China_Station.epub.
require 'book'
+require 'store'
class WalkDir
- def initialize(root)
+ def initialize(store, root)
@root = root
+ @store = store
@files = walk(@root)
end
result = []
for file in @files.sort
if Book.canHandle?(file)
- book = Book.new(file)
- result.push(book)
+ book = Book.new(@store)
+ book.loadFromFile(file)
+ id = @store.store_book(book)
+ result.push(id)
end
end
return result
result.push(fullName)
end
end
+ #puts result
return result
end
end