README.md in ezid-client-0.7.0 vs README.md in ezid-client-0.8.0

- old
+ new

@@ -87,11 +87,11 @@ => #<Ezid::Identifier id="ark:/99999/fk43f4wd4v" status="public" target="http://example.com" created="2014-12-09 16:22:35 UTC"> >> identifier.target => "http://example.com" ``` -**Delete** +**Delete** *Identifier status must be "reserved" to delete.* http://ezid.cdlib.org/doc/apidoc.html#operation-delete-identifier ```ruby >> identifier = Ezid::Identifier.create(shoulder: "ark:/99999/fk4", status: "reserved") @@ -103,11 +103,11 @@ => #<Ezid::Identifier id="ark:/99999/fk4n58pc0r" DELETED> ``` ## Metadata handling -Although "EZID imposes no requirements on the presence or form of citation metadata"[*](http://ezid.cdlib.org/doc/apidoc.html#metadata-requirements-mapping), `ezid-client` is intended to support the EZID [reserved metadata elements](http://ezid.cdlib.org/doc/apidoc.html#internal-metadata) and [metadata profiles](http://ezid.cdlib.org/doc/apidoc.html#metadata-profiles). While it is possible to use the client to send and receive any metadata, the object methods are geared towards the defined elements. Therefore it was seen fit, for example, to map the method `Ezid::Identifier#status` to the "_status" element. Likewise, all the reserved elements, except for "_crossref", have readers and -- for user-writable elements -- writers without the leading underscores. Since there are both "_crossref" and "crossref" elements, their accessors match the elements names. Similarly, accessors for metadata profile elements use underscores in place of dots -- for example, `Ezid::Identifer#dc_title` and `#dc_title=` for the "dc.title" element. +Although "EZID imposes no requirements on the presence or form of citation metadata"[*](http://ezid.cdlib.org/doc/apidoc.html#metadata-requirements-mapping), `ezid-client` is intended to support the EZID [reserved metadata elements](http://ezid.cdlib.org/doc/apidoc.html#internal-metadata) and [metadata profiles](http://ezid.cdlib.org/doc/apidoc.html#metadata-profiles). While it is possible to use the client to send and receive any metadata, the object methods are geared towards the defined elements. Therefore it was seen fit, for example, to map the method `Ezid::Identifier#status` to the `_status` element. Likewise, all the reserved elements, except for `_crossref`, have readers and -- for user-writable elements -- writers without the leading underscores. Since there are both `_crossref` and `crossref` elements, their accessors match the elements names. Similarly, accessors for metadata profile elements use underscores in place of dots -- for example, `Ezid::Identifer#dc_title` and `#dc_title=` for the `dc.title` element. **Setting default metadata values** Default metadata values can be set: @@ -147,16 +147,37 @@ config.user = "eziduser" config.password = "ezidpass" end ``` -- At client initialization (only if using Ezid::Client explicity): +- At client initialization (only if explicitly instantiating `Ezid::Client`): ```ruby client = Ezid::Client.new(user: "eziduser", password: "ezidpass") ``` +## Alternate Host and Disabling SSL + +By default Ezid::Client connects over SSL to the EZID host at [ezid.cdlib.org](http://ezid.cdlib.org), but the host and SSL settings may be overridden: + +- By setting the `EZID_HOST` environment variable; `EZID_USE_SSL` may be set to the string "false" to disable SSL for all requests. + +- Client configuration: + +```ruby +Ezid::Client.configure do |config| + config.host = "localhost" + config.use_ssl = false +end +``` + +- At client initialization (only if explicitly instantiating `Ezid::Client`): + +```ruby +client = Ezid::Client.new(host: "localhost", use_ssl: false) +``` + ## Test Helper If you have tests that (directly or indirectly) use `ezid-client` you may want to require the test helper module: ```ruby @@ -166,15 +187,17 @@ The module provides constants: - `TEST_ARK_SHOULDER` => "ark:/99999/fk4" - `TEST_DOI_SHOULDER` => "doi:10.5072/FK2" - `TEST_USER` => "apitest" +- `TEST_HOST` => "ezid.cdlib.org" The test user password is not provided - contact EZID and configure as above - or use your own EZID credentials, since all accounts can mint/create on the test shoulders. A convenience method `ezid_test_mode!` is provided to configure the client to: - authenticate as `TEST_USER` +- use `TEST_HOST` as the host - use `TEST_ARK_SHOULDER` as the default shoulder - log to the null device (instead of default STDERR) ## Running the ezid-client tests