Improve HTML formatting. Handle more variants of EPUB.
[quanlib.git] / walkdir.rb
index df73e4e9f393b0f9b9cf956bb50b0e87601fbb11..035752f05d48785d10db87d3b6e6bf91abe855a2 100644 (file)
@@ -28,7 +28,7 @@ class WalkDir
 
   def books
     result = []
-    for file in @files
+    for file in @files.sort
       if Book.canHandle?(file)
         book = Book.new(file)
         result.push(book)
@@ -42,7 +42,7 @@ class WalkDir
     children = Dir.entries(path)
     for child in children
       fullName = (path.chomp("/")) + "/" + child
-      if (File.directory?(fullName)) and (child != ".") and (child != "..")
+      if (File.directory?(fullName)) and (child != ".") and (child != "..") and (!File.symlink?(fullName))
         sub = walk(fullName)
         if (sub != nil) and (sub.length > 0)
           result.concat(sub)