Source

mrt-ingest-ruby /

Filename Size Date modified Message
lib/mrt
test
38 B
184 B
1.5 KB
947 B
424 B
876 B
= mrt-ingest (ruby)
Date:: 6 Sept. 2011
Author:: Erik Hetzner (mailto:erik.hetzner@ucop.edu)

== What?

A Ruby ingest client for Merritt[http://merritt.cdlib.org/].

== Install

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

== How?

  require 'rubygems'
  require 'mrt/ingest'
  client = Mrt::Ingest::Client.new("http://merritt.cdlib.org/object/ingest", USERNAME, PASSWORD)
  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, "demo_merritt_content", "me/My Name")
  obj.finish_ingest()