lib/relaton_nist/data_fetcher.rb in relaton-nist-1.18.0 vs lib/relaton_nist/data_fetcher.rb in relaton-nist-1.19.0
- old
+ new
@@ -28,11 +28,11 @@
#
def write_file(bib) # rubocop:disable Metrics/AbcSize
id = bib.docidentifier[0].id.gsub(%r{[/\s:.]}, "_").upcase.sub(/^NIST_IR/, "NISTIR")
file = File.join(@output, "#{id}.#{@ext}")
if @files.include? file
- warn "File #{file} exists. Docid: #{bib.docidentifier[0].id}"
+ Util.warn "File #{file} exists. Docid: #{bib.docidentifier[0].id}"
# warn "Link: #{bib.link.detect { |l| l.type == 'src' }.content}"
else @files << file
end
index.add_or_update bib.docidentifier[0].id, file
File.write file, output(bib), encoding: "UTF-8"
@@ -62,11 +62,10 @@
t2 = Time.now
puts "Stopped at: #{t2}"
puts "Done in: #{(t2 - t1).round} sec."
rescue StandardError => e
- warn e.message
- warn e.backtrace[0..5].join("\n")
+ Util.error "#{e.message}\n#{e.backtrace[0..5].join("\n")}"
end
def fetch_tech_pubs
docs = Nokogiri::XML OpenURI.open_uri URL
docs.xpath(