Project

mrt-ingest

0.0
Low commit activity in last 3 years
No release in over a year
A client for the Merritt ingest system. More details available from https://github.com/CDLUC3/mrt-doc/wiki
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

= 0.0.6
~> 1.7
~> 12.0
~> 3.8
~> 0.68
~> 3.6
~> 0.16
~> 3.5

Runtime

 Project Readme

Merritt Ingest Gem

Build Status

This microservice is part of the Merritt Preservation System.

Purpose

This library provides utility methods for preparing content for ingest into Merritt.

See https://rubygems.org/gems/mrt-ingest

Used By

This code is used by

Build instructions

$ gem build mrt-ingest.gemspec
$ sudo gem install mrt-ingest-0.0.1.gem

Test instructions

The code below creates a new Merritt object with content consisting of two local files and one remote URL. The object is submitted to Merritt as a manifest, with the manifest, local files, and mrt-erc.txt made available to Ingest by an Mrt::Ingest::OneTimeServer -- a simple WEBrick-based server that finds itself an open port, serves each file from a temporary directory, and when all files have been served, shuts down.

require 'mrt/ingest'

client = Mrt::Ingest::Client.new(
  "http://merritt.cdlib.org/object/ingest",
  USERNAME,
  PASSWORD
)
ingest_profile = "demo_merritt_content"
user_agent = "me/My Name"

obj = Mrt::Ingest::IObject.new(
  erc: {
    "who" => "Doe, John",
    "what" => "Hello, world",
    "when/created" => "2011"
  }
)
obj.add_component(File.new("/tmp/helloworld_a"))
obj.add_component(File.new("/tmp/helloworld_b"))
obj.add_component(
  URI.parse("http://example.org/xxx"),
  name: "helloworld_c",
  digest: Mrt::Ingest::MessageDigest::MD5.new("6f5902ac237024bdd0c176cb93063dc4")
)

obj.start_ingest(client, ingest_profile, user_agent)
obj.finish_ingest # waits for all files to be served, then shuts down

For a more detailed example, see the Merritt::Atom module of the Merritt dashboard.

Internal Links