Gem Version Build Status Appveyor Build Status Code Climate

NistBib is a Ruby gem that implements the IsoBibliographicItem model.

You can use it to retrieve metadata of NIST Standards from https://csrc.nist.gov, and access such metadata through the IsoBibliographicItem object.

Installation

Add this line to your application’s Gemfile:

gem 'nistbib'

And then execute:

$ bundle

Or install it yourself as:

$ gem install nistbib

Usage

Search for a standard using keywords

require 'nistbib'

hit_collection = NistBib::NistBibliography.search("8200")
=> [<NistBib::Hit:0x007f82b9b2b298 @text="8200" @fetched="false" @fullIdentifier="" @title="8200">,
 <NistBib::Hit:0x007f82b9b2a1e0 @text="8200" @fetched="false" @fullIdentifier="" @title="8200">]

 item = hit_collection[1].fetch
 => #<IsoBibItem::IsoBibliographicItem:0x007f82b986e668
 ...

XML serialization

item.to_xml
=> "<bibitem type="" id="NISTIR8200(DRAFT)">
      <fetched>2019-02-11</fetched>
      <title format="text/plain" language="en" script="Latn">
        Interagency Report on Status of International Cybersecurity Standardization for the Internet of Things (IoT)
      </title>
      ...
    </bibitem>"

Get code, and year

NistBib::NistBibliography.get("8200", "2018", {})
fetching 8200...
=> #<IsoBibItem::IsoBibliographicItem:0x007f82bb3370a8
...

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/metanorma/nistbib.

License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).