Skip to content

Better Setup for majortom connector #3

@tamaloa

Description

@tamaloa

To avoid the close coupling to rails and to be able to use majortom_connector in ruby only projects the fixed setup using a config file in a certain directory should be changed.
Also setting host, port and "context" (actually should be called path) makes things more complicated than necessary and should be replaced by a single call to full server url (e.g. the url under which majortom server admin interface is accessible).

There should be two basic ways of setting up majortom_connector:

A: using a Initializer to setup a project wide (or default) Majorton_connector. Inside the initializer one may set a path to a config file or directly declare the configuration.

MajortomConnector.configure do |config|
  config.path_to_config_file = 'somewhere.yml'
end

MajortomConnector.configure do |config|
  config.server_url = "http://full-server-url.com/with/path/to/majortom-server"
  config.topicmap = "tmid or base_iri"
  config.api_key = "api-key for access"
end

B: Setting up a Connection on the Fly

connection = MajortomConnector.new(:server_url => ".....", :topicmap => "....", api_key => ".....")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions