= RelatonCie image:https://img.shields.io/gem/v/relaton-cie.svg["Gem Version", link="https://rubygems.org/gems/relaton-cie"] image:https://github.com/relaton/relaton-cie/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/relaton/relaton-cie/actions?workflow=macos"] image:https://github.com/relaton/relaton-cie/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/relaton/relaton-cie/actions?workflow=windows"] image:https://github.com/relaton/relaton-cie/workflows/ubuntu/badge.svg["Build Status (Ubuntu)", link="https://github.com/relaton/relaton-cie/actions?workflow=ubuntu"] image:https://codeclimate.com/github/relaton/relaton-cie/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/relaton/relaton-cie"] image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-cie.svg["Pull Requests", link="https://github.com/relaton/relaton-cie/pulls"] image:https://img.shields.io/github/commits-since/relaton/relaton-cie/latest.svg["Commits since latest",link="https://github.com/relaton/relaton-cie/releases"] RelatonCie is a Ruby gem that searches and fetches standards from the https://www.techstreet.com/cie/searches/31156444[International Commision on Illuminantion]. == Installation Add this line to your application's Gemfile: [source,ruby] ---- gem 'relaton-cie' ---- And then execute: $ bundle install Or install it yourself as: $ gem install relaton-cie == Usage === Search document [source,ruby] ---- require 'relaton_cie' => true item = RelatonCie::CieBibliography.get 'CIE 001-1980' [relaton-cie] (CIE 001-1980) Fetching from Realton repository ... [relaton-cie] (CIE 001-1980) Found: `CIE 001-1980` => # nil ---- === Serialization [source,ruby] ---- item.to_xml => " 2022-12-03 Guidelines for minimizing urban sky glow near astronomical observatories (Joint Publication IAU/CIE) Guidelines for minimizing urban sky glow near astronomical observatories (Joint Publication IAU/CIE) https://www.techstreet.com/cie/standards/cie-001-1980?product_id=1210107 ... " ---- With `bibdata: true` option XML output is wrapped with `bibdata` element and `ext` element added. [source,ruby] ---- item.to_xml bibdata: true => " 2022-12-03 Guidelines for minimizing urban sky glow near astronomical observatories (Joint Publication IAU/CIE) Guidelines for minimizing urban sky glow near astronomical observatories (Joint Publication IAU/CIE) https://www.techstreet.com/cie/standards/cie-001-1980?product_id=1210107 ... document " ---- === Typed links Each CIE document has `src` type link. [source,ruby] ---- item.link => [#, @type="src">] ---- === Parse a file locally [source,ruby] ---- item = RelatonCie::XMLParser.from_xml File.read("spec/fixtures/bibdata.xml") # nil ---- === Logging RelatonCie uses the relaton-logger gem for logging. By default, it logs to STDOUT. To change the log levels and add other loggers, read the https://github.com/relaton/relaton-logger#usage[relaton-logger] documentation. == Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). == Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/relaton/relaton-cie. == License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).