Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Rubyhorn is a ruby library for accessing Matterhorn via its REST API.



Under rails you can setup an initializer (conf/initializers/rubyhorn.rb) based on the default in Hydrant:

require 'rubyhorn'

config = {:uri=>"http://localhost:8080/",
 :password=>'CHANGE_ME' }


Then in your code calls are made using the Rubyhorn client:
Rubyhorn.client.addMediaPackage(file, {"title" => params[:container_id], "flavor" => "video/source", "workflow" => "fedora-test", "filename" => file.original_filename})


Adding New Methods

Each REST method is accessible directly from the client object.  Adding support for methods is as simple as creating a new module under lib/rubyhorn/rest_client, adding the methods there, and including the new module in lib/rubyhorn/matterhorn_client.rb.  Make sure to add unit tests in spec/lib whenever you do add support for new methods.

  • No labels