1 # Walk the directory (and subdirectories), identifying books.
4 # .../AuthorName/Title_of_the_Awesome_Book.ext
6 # Author is given as FirstLast. For example,
7 # Robert Anson Heinlein is RoberHeinlein, and
8 # JKRowling is JoanneRowling.
10 # Book titles have spaces replaced with underscores,
11 # and punctuation [,!?'] replaced with hyphens.
13 # If the book forms part of a series, then an all-capitals
14 # series designator, followed by a numeric volume number,
15 # followed by an underscore, is prefixed to the name.
16 # For example, Hardy Boys' volume 1, The Tower Treasure,
17 # is rendered as .../FranklinDixon/HB001_The_Tower_Treasure.epub
18 # and Mrs. Pollifax volume 6, On the China Station, is
19 # .../DorothyGilman/P06_On_the_China_Station.epub.
25 def initialize(store, root)
33 for file in @files.sort
34 if Book.canHandle?(file)
36 @store.store_book(book)
45 children = Dir.entries(path)
47 fullName = (path.chomp("/")) + "/" + child
48 if (File.directory?(fullName)) and (child != ".") and (child != "..") and (!File.symlink?(fullName))
50 if (sub != nil) and (sub.length > 0)
53 elsif (! File.directory?(fullName))