Class: BibSync::Actions::DetermineArXivDOI
- Inherits:
-
Object
- Object
- BibSync::Actions::DetermineArXivDOI
- Defined in:
- lib/bibsync/actions/determine_arxiv_doi.rb
Constant Summary
Constants included from Log
Log::Blue, Log::Level, Log::Red, Log::Reset, Log::Yellow
Instance Method Summary collapse
-
#initialize(options) ⇒ DetermineArXivDOI
constructor
A new instance of DetermineArXivDOI.
- #run ⇒ Object
Methods included from Log
Methods included from Utils
#arxiv_download, #arxiv_id, #fetch, #fetch_xml, #name_without_ext
Constructor Details
#initialize(options) ⇒ DetermineArXivDOI
Returns a new instance of DetermineArXivDOI.
7 8 9 10 |
# File 'lib/bibsync/actions/determine_arxiv_doi.rb', line 7 def initialize() raise 'Option --bib is required' unless @bib = [:bib] @force = [:resync] end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/bibsync/actions/determine_arxiv_doi.rb', line 12 def run notice 'Determine arXiv and DOI identifiers' @bib.each do |entry| next if entry.comment? || (entry[:doi] && entry[:arxiv]) || (!@force && entry[:title] && entry[:author] && entry[:year]) determine_arxiv_and_doi(entry) end end |