README.adoc in relaton-ecma-1.16.1 vs README.adoc in relaton-ecma-1.16.2
- old
+ new
@@ -27,10 +27,24 @@
$ gem install relaton-ecma
== Usage
+=== Configuration
+
+Configuration is optional. The available option is `logger` which is a `Logger` instance. By default, the logger is `Logger.new($stderr)` with `Logger::WARN` level. To change the logger level, use `RelatonEcma.configure` block.
+
+[source,ruby]
+----
+require 'relaton_ecma'
+=> true
+
+RelatonEcma.configure do |config|
+ config.logger.level = Logger::DEBUG
+end
+----
+
=== Fetch documents
Documents can be fetched by reference. The structure of the reference depends on the type of the document. There are three types of documents:
- ECMA standards
@@ -43,64 +57,61 @@
ECMA mementos have the following reference structure: `ECMA MEM/{YEAR}`. Where: `YEAR` is an year of the memento.
[source,ruby]
----
-require 'relaton_ecma'
-=> true
-
# fetch ECMA standard
item = RelatonEcma::EcmaBibliography.get 'ECMA-6'
-[relaton-ecma] ("ECMA-6") fetching...
-[relaton-ecma] ("ECMA-6") found ECMA-6
+[relaton-ecma] (ECMA-6) Fetching from Relaton repository ...
+[relaton-ecma] (ECMA-6) Found: `ECMA-6`
#<RelatonEcma::BibliographicItem:0x00007fc645b11c10
...
# fetch ECMA standard with edition and volume
RelatonEcma::EcmaBibliography.get "ECMA-269 ed3 vol2"
-[relaton-ecma] ("ECMA-269 ed3 vol2") fetching...
-[relaton-ecma] ("ECMA-269 ed3 vol2") found ECMA-269
+[relaton-ecma] (ECMA-269 ed3 vol2) Fetching from Relaton repository ...
+[relaton-ecma] (ECMA-269 ed3 vol2) Found: `ECMA-269`
=> #<RelatonEcma::BibliographicItem:0x0000000106ac8210
...
# fetch the last edition of ECMA standard
bib = RelatonEcma::EcmaBibliography.get "ECMA-269"
-[relaton-ecma] ("ECMA-269") fetching...
-[relaton-ecma] ("ECMA-269") found ECMA-269
+[relaton-ecma] (ECMA-269) Fetching from Relaton repository ...
+[relaton-ecma] (ECMA-269) Found: `ECMA-269`
=> #<RelatonEcma::BibliographicItem:0x000000010a408480
...
bib.edition.content
=> "9"
# fetch the first volume of ECMA standard
bib = RelatonEcma::EcmaBibliography.get "ECMA-269 ed3"
-[relaton-ecma] ("ECMA-269 ed3") fetching...
-[relaton-ecma] ("ECMA-269 ed3") found ECMA-269
+[relaton-ecma] (ECMA-269 ed3) Fetching from Relaton repository ...
+[relaton-ecma] (ECMA-269 ed3) Found: `ECMA-269`
=> #<RelatonEcma::BibliographicItem:0x000000010a3ed0e0
...
bib.extent.first.reference_from
=> "1"
# fetch ECMA technical report
RelatonEcma::EcmaBibliography.get 'ECMA TR/18'
-[relaton-ecma] ("ECMA TR/18") fetching...
-[relaton-ecma] ("ECMA TR/18") found ECMA TR/18
+[relaton-ecma] (ECMA TR/18) Fetching from Relaton repository ...
+[relaton-ecma] (ECMA TR/18) Found: `ECMA TR/18`
=> #<RelatonEcma::BibliographicItem:0x00007fc645c00cc0
...
# fetch ECMA memento
RelatonEcma::EcmaBibliography.get "ECMA MEM/2021"
-[relaton-ecma] ("ECMA MEM/2021") fetching...
-[relaton-ecma] ("ECMA MEM/2021") found ECMA MEM/2021
+[relaton-ecma] (ECMA MEM/2021) Fetching from Relaton repository ...
+[relaton-ecma] (ECMA MEM/2021) Found: `ECMA MEM/2021`
=> #<RelatonEcma::BibliographicItem:0x00007fc665b2f060
...
# Return nil if a document doesn't exist.
RelatonEcma::EcmaBibliography.get '1111'
-[relaton-ecma] ("1111") fetching...
-[relaton-ecma] WARNING no match found online for 1111. The code must be exactly like it is on the standards website.
+[relaton-ecma] (1111) Fetching from Relaton repository ...
+[relaton-ecma] (1111) Not found.
=> nil
----
=== Serialization