Skip to content

Commit

Permalink
update extent, locality, & move flavor data under ext in YAML
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew2net committed Dec 13, 2024
1 parent 0442373 commit 0a37334
Show file tree
Hide file tree
Showing 15 changed files with 2,296 additions and 2,272 deletions.
5 changes: 3 additions & 2 deletions lib/relaton_nist/hash_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ def bib_item(item_hash)
end

def commentperiod_hash_to_bib(ret)
return unless ret[:commentperiod]
cp = ret.dig(:ext, :commentperiod) || ret[:commentperiod] # @TODO: remove ret[:commentperiod] after all gem versions are updated
return unless cp

ret[:commentperiod] = CommentPeriod.new(**ret[:commentperiod])
ret[:commentperiod] = CommentPeriod.new(**cp)
end

# @param ret [Hash]
Expand Down
6 changes: 5 additions & 1 deletion lib/relaton_nist/nist_bibliographic_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,14 @@ def to_xml(**opts)
def to_hash(embedded: false)
hash = super
# hash["keyword"] = single_element_array(keyword) if keyword&.any?
hash["commentperiod"] = commentperiod.to_hash if commentperiod
hash["ext"]["commentperiod"] = commentperiod.to_hash if commentperiod
hash
end

def has_ext?
super || commentperiod
end

# @param prefix [String]
# @return [String]
def to_asciibib(prefix = "")
Expand Down
2 changes: 1 addition & 1 deletion lib/relaton_nist/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RelatonNist
VERSION = "1.19.7".freeze
VERSION = "1.20.0".freeze
end
2 changes: 1 addition & 1 deletion relaton_nist.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
spec.add_dependency "base64"
spec.add_dependency "loc_mods", "~> 0.2.0"
spec.add_dependency "pubid", "~> 0.1.0"
spec.add_dependency "relaton-bib", "~> 1.19.2"
spec.add_dependency "relaton-bib", "~> 1.20.0"
spec.add_dependency "relaton-index", "~> 0.2.0"
spec.add_dependency "rubyzip"
end
27 changes: 15 additions & 12 deletions spec/examples/nist_bib_item.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ docstatus:
substage:
value: active

doctype:
type: standard

date:
- type: published
value: "2018-12-01"
Expand Down Expand Up @@ -80,24 +77,27 @@ link:
relation:
- type: partOf
bibitem:
doctype:
type: standard
formattedref:
content: NISTIR 8011 Vol. 1
format: text/plain
link:
- type: src
content: https://csrc.nist.gov/publications/detail/nistir/8011/vol-1/final
ext:
doctype:
type: standard

- type: updates
bibitem:
doctype:
type: standard
formattedref:
content: SP 800-53A Rev. 4
format: text/plain
link:
- type: src
content: https://csrc.nist.gov/publications/detail/sp/800-53a/rev-4/final
ext:
doctype:
type: standard

series:
- formattedref:
Expand All @@ -118,10 +118,13 @@ keyword:
- content: authorization boundary
- content: automation

commentperiod:
from: "2018-12-17"
to: "2019-03-15"
extended: "2019-05-15"

ext:
schema-version: v1.0.0

doctype:
type: standard

commentperiod:
from: "2018-12-17"
to: "2019-03-15"
extended: "2019-05-15"
30 changes: 15 additions & 15 deletions spec/vcr_cassettes/8011_1.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions spec/vcr_cassettes/8200.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions spec/vcr_cassettes/8200_2018.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0a37334

Please sign in to comment.