Module: Dwca::Generator
- Defined in:
- lib/dwca/generator.rb
Class Method Summary collapse
-
.get_archive ⇒ String
Generates a DwC-A from database data.
Class Method Details
.get_archive ⇒ String
Generates a DwC-A from database data
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/dwca/generator.rb', line 5 def self.get_archive path = Rails.root.join('tmp/dwc_' + SecureRandom.hex + '.tar.gz') gen = DarwinCore::Generator.new(path) core = [['http://rs.tdwg.org/dwc/terms/taxonID']] gen.add_core(core, 'core.txt') gen. gen.pack gen.clean return path end |