X-Git-Url: http://jaekl.net/gitweb/?p=quanlib.git;a=blobdiff_plain;f=walkdir.rb;h=5d5bf84ec90804e5c4b4be4ff30bdb69ab62a741;hp=035752f05d48785d10db87d3b6e6bf91abe855a2;hb=291671015d4e88cbb7e7f3995109a88ee993aac6;hpb=b0ed11b1a03aab548e3c274dfd89732e8e11892f diff --git a/walkdir.rb b/walkdir.rb index 035752f..5d5bf84 100644 --- a/walkdir.rb +++ b/walkdir.rb @@ -19,10 +19,12 @@ # .../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 @@ -31,6 +33,7 @@ class WalkDir for file in @files.sort if Book.canHandle?(file) book = Book.new(file) + @store.store_book(book) result.push(book) end end @@ -51,6 +54,7 @@ class WalkDir result.push(fullName) end end + #puts result return result end end