lib/review/book/image_finder.rb in review-2.1.0 vs lib/review/book/image_finder.rb in review-2.2.0
- old
+ new
@@ -20,11 +20,11 @@
@exts = exts
@entries = get_entries()
end
def get_entries
- Dir.glob(File.join(@basedir, "**/*.*"))
+ Dir.glob(File.join(@basedir, "**{,/*/**}/*.*")).uniq
end
def add_entry(path)
unless @entries.include?(path)
@entries << path
@@ -44,26 +44,26 @@
nil
end
def target_list(id)
[
- # 1. <basedir>/<builder>/<chapid>/<id>.<ext>
- "#{@basedir}/#{@builder}/#{@chapid}/#{id}",
+ # 1. <basedir>/<builder>/<chapid>/<id>.<ext>
+ "#{@basedir}/#{@builder}/#{@chapid}/#{id}",
- # 2. <basedir>/<builder>/<chapid>-<id>.<ext>
- "#{@basedir}/#{@builder}/#{@chapid}-#{id}",
+ # 2. <basedir>/<builder>/<chapid>-<id>.<ext>
+ "#{@basedir}/#{@builder}/#{@chapid}-#{id}",
- # 3. <basedir>/<builder>/<id>.<ext>
- "#{@basedir}/#{@builder}/#{id}",
+ # 3. <basedir>/<builder>/<id>.<ext>
+ "#{@basedir}/#{@builder}/#{id}",
- # 4. <basedir>/<chapid>/<id>.<ext>
- "#{@basedir}/#{@chapid}/#{id}",
+ # 4. <basedir>/<chapid>/<id>.<ext>
+ "#{@basedir}/#{@chapid}/#{id}",
- # 5. <basedir>/<chapid>-<id>.<ext>
- "#{@basedir}/#{@chapid}-#{id}",
+ # 5. <basedir>/<chapid>-<id>.<ext>
+ "#{@basedir}/#{@chapid}-#{id}",
- # 6. <basedir>/<id>.<ext>
- "#{@basedir}/#{id}"
+ # 6. <basedir>/<id>.<ext>
+ "#{@basedir}/#{id}"
]
end
end
end