Class: Relaton::Iana::DataFetcher
- Inherits:
-
Core::DataFetcher
- Object
- Core::DataFetcher
- Relaton::Iana::DataFetcher
- Defined in:
- lib/relaton/iana/data_fetcher.rb
Instance Method Summary collapse
- #fetch(_source = nil) ⇒ Object
-
#log_error(msg) ⇒ Object
Parse documents.
Instance Method Details
#fetch(_source = nil) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/relaton/iana/data_fetcher.rb', line 15 def fetch(_source = nil) Dir["iana-registries/**/*.xml"].each do |file| content = File.read file, encoding: "UTF-8" parse(content) if content.include? "<registry" rescue StandardError => e Util.error "Error: #{e.}. File: #{file}" end index.save report_errors end |
#log_error(msg) ⇒ Object
Parse documents
11 12 13 |
# File 'lib/relaton/iana/data_fetcher.rb', line 11 def log_error(msg) Util.error msg end |