From 90b3ce55da50d1b70f637fbfc1e0a4fb9ae6b8f9 Mon Sep 17 00:00:00 2001 From: Sam Popowich Date: Fri, 29 Aug 2014 12:44:39 -0600 Subject: [PATCH] Add rake task for dublin core ingest. --- lib/tasks/ingest.rake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/tasks/ingest.rake diff --git a/lib/tasks/ingest.rake b/lib/tasks/ingest.rake new file mode 100644 index 000000000..7af182aab --- /dev/null +++ b/lib/tasks/ingest.rake @@ -0,0 +1,15 @@ +namespace :ingest do + + desc 'ingest Dublin Core records' + task :dublin_core do |t, args| + require "#{Rails.root}/lib/ingest/batch_ingest.rb" + path= args[:path] + mode = args[:mode] + batch_ingester = BatchIngest.new + batch_ingester.ingester = Ingester.new + batch_ingester.root = "//xmlns:record" + batch_ingester.namespace = {"xmlns" => "http://www.openarchives.org/OAI/2.0/"} + mode=="file" ? batch_ingester.from_file(path) : batch_ingester.from_dir(path) + end +end +