# TODO: Fix horrible hard-coded strings and paths
return unless category == "00_nonFic" && classification_id.nil?
- File.open(Store.unclassified_csv, "a") do |fd|
+ File.open(@store.unclassified_csv, "a") do |fd|
fd.puts "#{grouping.inspect},#{path.inspect}"
end
end
opf_path = cont_doc.css("container rootfiles rootfile")[0]["full-path"]
scan_opf!(zipfile, opf_path)
- rescue Zip::Error => e
- puts "ERROR processing file #{file_name.inspect}:"
- puts e.message
- puts e.backtrace
end
+ rescue Zip::Error => e
+ puts "ERROR processing file #{file_name.inspect}:"
+ puts e.message
+ puts e.backtrace
end
def scan_pdf!(file_name)
series_infos.push([series, book_ids]) unless book_ids&.empty?
end
- 0..(series_infos.length - 1).each do |idx|
+ (0..(series_infos.length - 1)).each do |idx|
back = nil
fwd = nil
end
end
- private
-
- def navig_back_up_forward
- [navig_link(@back), navig_link(@up), navig_link(@forward)].join(" ")
- end
-
- def navig_link(data)
- return "" if data.nil?
-
- "<a href=#{data[0].inspect}>#{data[1]}</a>"
- end
-
- def write_footer(file_descriptor)
- file_descriptor.puts " <p class=\"navigator\">#{navig_back_up_forward}</p>"
- end
-
- def write_header(file_descriptor)
- file_descriptor.puts " <h1 class=\"header\">#{@title}</h1>"
-
- file_descriptor.puts " <p class=\"navigator\">#{navig_back_up_forward}</p>"
- end
-
def write_html(book_ids)
FileUtils.mkdir_p(@output_dir) unless Dir.exist?(@output_dir)
end
end
+ private
+
+ def navig_back_up_forward
+ [navig_link(@back), navig_link(@up), navig_link(@forward)].join(" ")
+ end
+
+ def navig_link(data)
+ return "" if data.nil?
+
+ "<a href=#{data[0].inspect}>#{data[1]}</a>"
+ end
+
+ def write_footer(file_descriptor)
+ file_descriptor.puts " <p class=\"navigator\">#{navig_back_up_forward}</p>"
+ end
+
+ def write_header(file_descriptor)
+ file_descriptor.puts " <h1 class=\"header\">#{@title}</h1>"
+
+ file_descriptor.puts " <p class=\"navigator\">#{navig_back_up_forward}</p>"
+ end
+
def write_special(file_descriptor)
file_descriptor.puts(@special) unless @special.nil?
end