Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Commit

Permalink
Add rake task for dublin core ingest.
Browse files Browse the repository at this point in the history
  • Loading branch information
redlibrarian committed Aug 29, 2014
1 parent 8f1f123 commit 90b3ce5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/tasks/ingest.rake
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 90b3ce5

Please sign in to comment.