Class: DwcaHunter::ResourceArctos
- Defined in:
- lib/dwca_hunter/resources/arctos.rb
Instance Attribute Summary
Attributes inherited from Resource
#abbr, #command, #download_path, #title, #url, #uuid
Instance Method Summary collapse
- #download ⇒ Object
-
#initialize(opts = {}) ⇒ ResourceArctos
constructor
A new instance of ResourceArctos.
- #make_dwca ⇒ Object
- #unpack ⇒ Object
Methods inherited from Resource
gunzip, #needs_download?, #needs_unpack?, unzip
Constructor Details
#initialize(opts = {}) ⇒ ResourceArctos
Returns a new instance of ResourceArctos.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/dwca_hunter/resources/arctos.rb', line 5 def initialize(opts = {}) @command = 'arctos' @title = 'Arctos' @url = 'https://www.dropbox.com/s/3rmny5d8cfm9mmp/arctos.tar.gz?dl=1' @UUID = 'eea8315d-a244-4625-859a-226675622312' @download_path = File.join(Dir.tmpdir, 'dwca_hunter', 'arctos', 'data.zip') @synonyms = [] @names = [] @vernaculars = [] @extensions = [] @synonyms_hash = {} @vernaculars_hash = {} super(opts) end |
Instance Method Details
#download ⇒ Object
23 24 25 26 |
# File 'lib/dwca_hunter/resources/arctos.rb', line 23 def download puts "Downloading cached verion of the file. Ask Arctos to generate new." `curl -s -L #{@url} -o #{@download_path}` end |
#make_dwca ⇒ Object
32 33 34 35 36 |
# File 'lib/dwca_hunter/resources/arctos.rb', line 32 def make_dwca DwcaHunter::logger_write(self.object_id, 'Extracting data') get_names generate_dwca end |
#unpack ⇒ Object
28 29 30 |
# File 'lib/dwca_hunter/resources/arctos.rb', line 28 def unpack unpack_tar end |