= RelatonCen retrieve CEN Standards for bibliographic use using the BibliographicItem model image:https://img.shields.io/gem/v/relaton-cen.svg["Gem Version", link="https://rubygems.org/gems/relaton-cen"] image:https://github.com/relaton/relaton-cen/workflows/rake/badge.svg["Build Status", link="https://github.com/relaton/relaton-cen/actions?workflow=rake"] image:https://codeclimate.com/github/relaton/relaton-cen/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/relaton/relaton-cen"] image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-cen.svg["Pull Requests", link="https://github.com/relaton/relaton-cen/pulls"] image:https://img.shields.io/github/commits-since/relaton/relaton-cen/latest.svg["Commits since latest",link="https://github.com/relaton/relaton-cen/releases"] RelatonCen is a Ruby gem that implements the https://github.com/metanorma/metanorma-model-iso#iso-bibliographic-item[IsoBibliographicItem model]. == Installation Add this line to your application's `Gemfile`: [source,ruby] ---- gem 'relaton-cen' ---- And then execute: [source,sh] ---- $ bundle install ---- Or install it yourself as: [source,sh] ---- $ gem install relaton-cen ---- == Usage For CENELEC standards, use references with the prefix `CEN/CLC`. For example, `CEN/CLC Guide 6`. === 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 `RelatonCen.configure` block. [source,ruby] ---- require 'relaton_cen' => true RelatonCen.configure do |config| config.logger.level = Logger::DEBUG end ---- === Search for a standard using keywords [source,ruby] ---- hit_collection = RelatonCen::CenBibliography.search("CEN ISO/TS 21003-7") => item = hit_collection[0].fetch => # # RelatonCen::CenBibliography.get "CEN/CLC Guide 6" [relaton-cen] (CEN/CLC Guide 6) Fetching from standards.cencenelec.eu ... [isoics] code not found in ICS list [relaton-cen] (CEN/CLC Guide 6) Found: `CEN/CLC Guide 6` => # RelatonCen::CenBibliography.get "CEN/CLC Guide 6", nil, keep_year: true [relaton-cen] (CEN/CLC Guide 6) Fetching from standards.cencenelec.eu ... [isoics] code not found in ICS list [relaton-cen] (CEN/CLC Guide 6) Found: `CEN/CLC Guide 6:2014` => # " 2022-12-03 Multilayer piping systems for hot and cold water installations inside buildings ... " ---- With `bibdata: true` option XML output wrapped with `bibdata` element and `ext` element added. [source,ruby] ---- item.to_xml bibdata: true => " 2022-12-03 Multilayer piping systems for hot and cold water installations inside buildings ... international-standard ... " ---- === Typed links Each CEN document has `src` type link. [source,ruby] ---- item.link => [#, @type="src">] ---- === Get code, and year [source,ruby] ---- RelatonCen::CenBibliography.get "CEN ISO/TS 21003-7:2019" [relaton-cen] (CEN ISO/TS 21003-7) Fetching from standards.cencenelec.eu ... [relaton-cen] (CEN ISO/TS 21003-7) Found: CEN `ISO/TS 21003-7:2019` => # # {"id"=>"CENISO/TS21003-7-2019", ... RelatonCen::BibliographicItem.from_hash hash => # #