lib/dwc-archive.rb in dwc-archive-0.2.3 vs lib/dwc-archive.rb in dwc-archive-0.3.0
- old
+ new
@@ -1,22 +1,28 @@
# encoding: UTF-8
$:.unshift(File.dirname(__FILE__)) unless
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
+R19 = RUBY_VERSION.split('.')[0..1].join('').to_i > 18
require 'ruby_extensions'
require 'fileutils'
-begin
+require 'ostruct'
+
+if R19
+ require 'csv'
+else
require 'fastercsv'
CSV = FasterCSV
-rescue LoadError
- require 'csv'
end
require 'dwc-archive/ingester'
require 'dwc-archive/errors'
require 'dwc-archive/expander'
require 'dwc-archive/archive'
require 'dwc-archive/core'
require 'dwc-archive/extension'
require 'dwc-archive/metadata'
+require 'dwc-archive/generator'
+require 'dwc-archive/generator_meta_xml'
+require 'dwc-archive/generator_eml_xml'
class DarwinCore
attr_reader :archive, :core, :metadata, :extensions
alias :eml :metadata