pubid-nist 0.2.6 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/pubid/nist/edition.rb +25 -13
- data/lib/pubid/nist/identifier.rb +12 -7
- data/lib/pubid/nist/parser.rb +10 -5
- data/lib/pubid/nist/parsers/{nbs_circ.rb → circ.rb} +1 -1
- data/lib/pubid/nist/parsers/{nbs_crpl.rb → crpl.rb} +1 -1
- data/lib/pubid/nist/parsers/{nbs_csm.rb → csm.rb} +1 -1
- data/lib/pubid/nist/parsers/fips.rb +10 -3
- data/lib/pubid/nist/parsers/{nist_gcr.rb → gcr.rb} +1 -1
- data/lib/pubid/nist/parsers/{nbs_hb.rb → hb.rb} +2 -10
- data/lib/pubid/nist/parsers/{nbs_mp.rb → mp.rb} +1 -1
- data/lib/pubid/nist/parsers/{nist_ncstar.rb → ncstar.rb} +1 -1
- data/lib/pubid/nist/parsers/{nist_owmwp.rb → owmwp.rb} +1 -1
- data/lib/pubid/nist/parsers/{nbs_rpt.rb → rpt.rb} +1 -1
- data/lib/pubid/nist/parsers/{nist_sp.rb → sp.rb} +5 -3
- data/lib/pubid/nist/parsers/tn.rb +17 -0
- data/lib/pubid/nist/renderer/base.rb +12 -10
- data/lib/pubid/nist/series.rb +30 -0
- data/lib/pubid/nist/stage.rb +4 -5
- data/lib/pubid/nist/transformer.rb +10 -2
- data/lib/pubid/nist/version.rb +1 -1
- data/lib/pubid/nist.rb +1 -1
- data/series.yaml +60 -82
- data/update_codes.yaml +3 -3
- metadata +14 -20
- data/lib/pubid/nist/parsers/nbs_bh.rb +0 -6
- data/lib/pubid/nist/parsers/nbs_fips.rb +0 -15
- data/lib/pubid/nist/parsers/nbs_mn.rb +0 -6
- data/lib/pubid/nist/parsers/nbs_sp.rb +0 -13
- data/lib/pubid/nist/parsers/nbs_tn.rb +0 -9
- data/lib/pubid/nist/parsers/nist_hb.rb +0 -9
- data/lib/pubid/nist/parsers/nist_tn.rb +0 -13
- data/lib/pubid/nist/serie.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d4329248de2fde990db7f396796b104fc7152a4d3cf19c9b1fba9817bd9bc59
|
4
|
+
data.tar.gz: 1f1368050820296d410019b9bb66d980de01d166ba62ec9572b9f048c1fde931
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d711d29e07f10c5f69307dcfb0267a4a480c12a715d75901d083362fb123ff5a7074d45d9d37f83cea5efc12ae8a5aa6e2c8d47f529c2b78858dba4e3e7fb23
|
7
|
+
data.tar.gz: 50b16da1bb63033efe8c09d37f2f9687e79d2efc73a0b7b66a61637e1fad7d414a71b6a182b4710556ab9f332b6e9670d1af10d82940a170f30e12b1fc8f04d2
|
data/lib/pubid/nist/edition.rb
CHANGED
@@ -1,26 +1,38 @@
|
|
1
1
|
module Pubid::Nist
|
2
2
|
class Edition < Pubid::Core::Entity
|
3
|
-
attr_accessor :year, :month, :day, :parsed, :
|
3
|
+
attr_accessor :year, :month, :day, :parsed, :number
|
4
4
|
|
5
|
-
def initialize(parsed: nil, year: nil, month: nil, day: nil,
|
5
|
+
def initialize(parsed: nil, year: nil, month: nil, day: nil, number: nil)
|
6
6
|
@parsed = parsed
|
7
7
|
@year = year
|
8
8
|
@month = month
|
9
9
|
@day = day
|
10
|
-
@
|
10
|
+
@number = number
|
11
11
|
end
|
12
12
|
|
13
|
-
def to_s
|
14
|
-
result = (@sequence && [@sequence]) || []
|
15
|
-
if @day
|
16
|
-
result << Date.new(@year, @month, @day).strftime("%Y%m%d")
|
17
|
-
elsif @month
|
18
|
-
result << Date.new(@year, @month).strftime("%Y%m")
|
19
|
-
elsif @year
|
20
|
-
result << Date.new(@year).strftime("%Y")
|
21
|
-
end
|
13
|
+
def to_s(format: :short)
|
22
14
|
|
23
|
-
|
15
|
+
if format == :long
|
16
|
+
result = (@number && ["Edition #{@number}"]) || []
|
17
|
+
if @day
|
18
|
+
result << Date.new(@year, @month, @day).strftime("(%B %d, %Y)")
|
19
|
+
elsif @month
|
20
|
+
result << Date.new(@year, @month).strftime("(%B %Y)")
|
21
|
+
elsif @year
|
22
|
+
result << Date.new(@year).strftime("(%Y)")
|
23
|
+
end
|
24
|
+
result.join(" ")
|
25
|
+
else
|
26
|
+
result = (@number && [@number]) || []
|
27
|
+
if @day
|
28
|
+
result << Date.new(@year, @month, @day).strftime("%Y%m%d")
|
29
|
+
elsif @month
|
30
|
+
result << Date.new(@year, @month).strftime("%Y%m")
|
31
|
+
elsif @year
|
32
|
+
result << Date.new(@year).strftime("%Y")
|
33
|
+
end
|
34
|
+
result.join("-")
|
35
|
+
end
|
24
36
|
end
|
25
37
|
end
|
26
38
|
end
|
@@ -8,19 +8,24 @@ UPDATE_CODES = YAML.load_file(File.join(File.dirname(__FILE__), "../../../update
|
|
8
8
|
module Pubid::Nist
|
9
9
|
class Identifier < Pubid::Core::Identifier::Base
|
10
10
|
extend Forwardable
|
11
|
-
attr_accessor :
|
11
|
+
attr_accessor :series, :code, :revision, :publisher, :version, :volume,
|
12
12
|
:part, :addendum, :stage, :translation,
|
13
13
|
:edition, :supplement, :update,
|
14
14
|
:section, :appendix, :errata, :index, :insert
|
15
15
|
|
16
|
-
def initialize(publisher: "NIST",
|
17
|
-
edition_month: nil, edition_year: nil, edition_day: nil, update: nil,
|
18
|
-
|
19
|
-
@
|
16
|
+
def initialize(publisher: "NIST", series:, number: nil, stage: nil, supplement: nil,
|
17
|
+
edition_month: nil, edition_year: nil, edition_day: nil, update: nil,
|
18
|
+
edition: nil, **opts)
|
19
|
+
@publisher = publisher.is_a?(Publisher) ? publisher : Publisher.new(publisher: publisher.to_s)
|
20
|
+
@series = series.is_a?(Series) ? series : Series.new(series: series)
|
20
21
|
@code = number
|
21
22
|
@stage = Stage.new(**stage) if stage
|
22
23
|
@supplement = (supplement.is_a?(Array) && "") || supplement
|
23
|
-
|
24
|
+
if edition_month || edition_year
|
25
|
+
@edition = parse_edition(edition_month, edition_year, edition_day)
|
26
|
+
elsif edition
|
27
|
+
@edition = Edition.new(number: edition)
|
28
|
+
end
|
24
29
|
@update = update
|
25
30
|
opts.each { |key, value| send("#{key}=", value.to_s) }
|
26
31
|
end
|
@@ -56,7 +61,7 @@ module Pubid::Nist
|
|
56
61
|
document.instance_variables.each do |var|
|
57
62
|
val = document.instance_variable_get(var)
|
58
63
|
current_val = instance_variable_get(var)
|
59
|
-
if [:@
|
64
|
+
if [:@series, :@publisher].include?(var) ||
|
60
65
|
(val && current_val.nil?) ||
|
61
66
|
(val && current_val.to_s.length < val.to_s.length)
|
62
67
|
instance_variable_set(var, val)
|
data/lib/pubid/nist/parser.rb
CHANGED
@@ -5,7 +5,7 @@ module Pubid::Nist
|
|
5
5
|
rule(:series) do
|
6
6
|
(array_to_str(SERIES["long"].keys.sort_by(&:length).reverse.flatten).as(:series) |
|
7
7
|
array_to_str(SERIES["mr"].values).as(:series_mr) |
|
8
|
-
(str("
|
8
|
+
((str("NBS") | str("NIST")).as(:publisher) >> (space | dot) >> array_to_str(SERIES["long"].keys.sort_by(&:length).reverse.flatten).as(:series))) >>
|
9
9
|
any.repeat.as(:remaining)
|
10
10
|
end
|
11
11
|
|
@@ -18,7 +18,8 @@ module Pubid::Nist
|
|
18
18
|
else
|
19
19
|
SERIES["mr"].key(parsed[:series_mr].to_s)
|
20
20
|
end
|
21
|
-
|
21
|
+
publisher = parsed[:publisher]
|
22
|
+
parser = find_parser(publisher, series)
|
22
23
|
begin
|
23
24
|
parsed = parser.new.parse(parsed[:remaining].to_s)
|
24
25
|
rescue Parslet::ParseFailed
|
@@ -26,11 +27,15 @@ module Pubid::Nist
|
|
26
27
|
# so parse using Default parser which is comply with PubID 1.0
|
27
28
|
parsed = Parsers::Default.new.parse(parsed[:remaining].to_s)
|
28
29
|
end
|
29
|
-
|
30
|
+
if publisher
|
31
|
+
parsed.is_a?(Array) ? parsed << { series: series, publisher: publisher } : parsed.merge({ series: series, publisher: publisher })
|
32
|
+
else
|
33
|
+
parsed.is_a?(Array) ? parsed << { series: series } : parsed.merge({ series: series })
|
34
|
+
end
|
30
35
|
end
|
31
36
|
|
32
|
-
def find_parser(series)
|
33
|
-
PARSERS_CLASSES[series] || Pubid::Nist::Parsers::Default
|
37
|
+
def find_parser(publisher, series)
|
38
|
+
PARSERS_CLASSES[series] || PARSERS_CLASSES["#{publisher} #{series}"] || Pubid::Nist::Parsers::Default
|
34
39
|
end
|
35
40
|
end
|
36
41
|
end
|
@@ -1,8 +1,15 @@
|
|
1
|
-
require_relative "nbs_fips"
|
2
|
-
|
3
1
|
module Pubid::Nist
|
4
2
|
module Parsers
|
5
|
-
class Fips <
|
3
|
+
class Fips < Default
|
4
|
+
rule(:edition) do
|
5
|
+
str("-") >> (
|
6
|
+
(month_letters.as(:edition_month) >> year_digits.as(:edition_year)) |
|
7
|
+
year_digits.as(:edition_year) |
|
8
|
+
(month_letters.as(:edition_month) >> match('\d').repeat(2, 2).as(:edition_day) >>
|
9
|
+
str("/") >> year_digits.as(:edition_year))
|
10
|
+
) |
|
11
|
+
(str("e") >> year_digits.as(:edition_year) >> month_digits.as(:edition_month).maybe)
|
12
|
+
end
|
6
13
|
end
|
7
14
|
end
|
8
15
|
end
|
@@ -1,15 +1,7 @@
|
|
1
1
|
module Pubid::Nist
|
2
2
|
module Parsers
|
3
|
-
class
|
4
|
-
|
5
|
-
# 44e2-1955 -> 44e2
|
6
|
-
# 146v1-1991
|
7
|
-
# 105-1-1990 -> 105-1e1990
|
8
|
-
# 111r1977 / 146v1
|
9
|
-
# 130-1979 -> 130e1979
|
10
|
-
# 105-8 -> 105-8
|
11
|
-
# 28supp1957pt1
|
12
|
-
# 67suppFeb1965
|
3
|
+
class Hb < Default
|
4
|
+
rule(:number_suffix) { match("[a-zA-Z]") }
|
13
5
|
|
14
6
|
rule(:edition) do
|
15
7
|
(str("supp") >> str("").as(:supplement) >>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Pubid::Nist
|
2
2
|
module Parsers
|
3
|
-
class
|
3
|
+
class Sp < Default
|
4
4
|
rule(:version) do
|
5
5
|
(((str("ver") | str(" Ver. ") | str(" Version ")) >> (digits >> (str(".") >> digits).repeat).as(:version)) |
|
6
6
|
(str("v") >>
|
@@ -50,10 +50,12 @@ module Pubid::Nist
|
|
50
50
|
end
|
51
51
|
|
52
52
|
rule(:volume) do
|
53
|
-
|
53
|
+
# hack for NBS SP 535v2a-l vs NBS SP 535v2m-z
|
54
|
+
# https://github.com/metanorma/pubid-nist/issues/98
|
55
|
+
(str("v") | str(" Vol. ")) >> (digits >> (str("a-l") | str("m-z")).maybe >> match("[A-Z]").repeat).as(:volume)
|
54
56
|
end
|
55
57
|
|
56
|
-
rule(:part_prefixes) { str("pt") | str("p") | str(" Part ") }
|
58
|
+
rule(:part_prefixes) { str("pt") | str("p") | str("P") | str(" Part ") }
|
57
59
|
end
|
58
60
|
end
|
59
61
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Pubid::Nist
|
2
|
+
module Parsers
|
3
|
+
class Tn < Default
|
4
|
+
# rule(:report_number) do
|
5
|
+
# first_report_number
|
6
|
+
# end
|
7
|
+
|
8
|
+
rule(:edition_prefixes) do
|
9
|
+
str("-") | str("e")
|
10
|
+
end
|
11
|
+
|
12
|
+
rule(:second_report_number) do
|
13
|
+
year_digits.absent? >> (digits_with_suffix | str("A")).as(:second_report_number)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -10,22 +10,24 @@ module Pubid::Nist
|
|
10
10
|
def render_identifier(params, opts)
|
11
11
|
case opts[:format]
|
12
12
|
when :short, :mr
|
13
|
-
"%{
|
13
|
+
"%{series}%{code}%{volume}%{part}%{edition}%{revision}%{version}"\
|
14
14
|
"%{supplement}%{section}%{appendix}%{errata}%{index}%{insert}%{update}"\
|
15
15
|
"%{stage}%{translation}" % params
|
16
16
|
else
|
17
|
-
"%{
|
17
|
+
"%{series}%{code}%{stage}%{volume}%{part}%{edition}%{revision}%{version}"\
|
18
18
|
"%{supplement}%{section}%{appendix}%{errata}%{index}%{insert}%{update}"\
|
19
19
|
"%{translation}" % params
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
def
|
24
|
-
if
|
25
|
-
return
|
23
|
+
def render_series(series, opts, params)
|
24
|
+
if series.to_s(opts[:format]).include?(params[:publisher].to_s(opts[:format]))
|
25
|
+
return series.to_s(opts[:format])
|
26
26
|
end
|
27
27
|
|
28
|
-
"#{params[:publisher].to_s(opts[:format])}
|
28
|
+
"#{params[:publisher].to_s(opts[:format])}" +
|
29
|
+
(opts[:format] == :mr ? "." : " ") +
|
30
|
+
"#{series.to_s(opts[:format])}"
|
29
31
|
end
|
30
32
|
|
31
33
|
def render_code(code, opts, _params)
|
@@ -37,12 +39,12 @@ module Pubid::Nist
|
|
37
39
|
|
38
40
|
case opts[:format]
|
39
41
|
when :long
|
40
|
-
"
|
42
|
+
" #{edition.to_s(format: :long)}"
|
41
43
|
when :abbrev
|
42
|
-
" Ed. "
|
44
|
+
" Ed. " + edition.to_s
|
43
45
|
when :short, :mr
|
44
|
-
"e"
|
45
|
-
end
|
46
|
+
"e" + edition.to_s
|
47
|
+
end
|
46
48
|
end
|
47
49
|
|
48
50
|
def render_revision(revision, opts, _params)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
SERIES = YAML.load_file(File.join(File.dirname(__FILE__), "../../../series.yaml"))
|
2
|
+
|
3
|
+
module Pubid::Nist
|
4
|
+
class Series
|
5
|
+
attr_accessor :series, :parsed
|
6
|
+
|
7
|
+
def initialize(series:, parsed: nil)
|
8
|
+
raise Errors::SerieInvalidError, "#{series} is not valid series" unless SERIES["long"].key?(series)
|
9
|
+
|
10
|
+
@series = series
|
11
|
+
@parsed = parsed
|
12
|
+
end
|
13
|
+
|
14
|
+
def to_s(format = :short)
|
15
|
+
# return SERIES["abbrev"][@serie] ||
|
16
|
+
return @series if format == :short
|
17
|
+
|
18
|
+
result = SERIES[format.to_s][@series]
|
19
|
+
return @series if result.nil? && format == :mr
|
20
|
+
|
21
|
+
return SERIES["long"][@series] if result.nil?
|
22
|
+
|
23
|
+
result
|
24
|
+
end
|
25
|
+
|
26
|
+
def ==(other)
|
27
|
+
other.series == @series
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/pubid/nist/stage.rb
CHANGED
@@ -6,6 +6,9 @@ module Pubid::Nist
|
|
6
6
|
|
7
7
|
def initialize(id:, type:)
|
8
8
|
@id, @type = id.to_s.downcase, type.to_s.downcase
|
9
|
+
|
10
|
+
raise ArgumentError, "id cannot be #{id.inspect}" unless STAGES['id'].key?(@id)
|
11
|
+
raise ArgumentError, "type cannot be #{type.inspect}" unless STAGES['type'].key?(@type)
|
9
12
|
end
|
10
13
|
|
11
14
|
def to_s(format = :short)
|
@@ -17,12 +20,8 @@ module Pubid::Nist
|
|
17
20
|
when :mr
|
18
21
|
"#{@id}#{@type}"
|
19
22
|
else
|
20
|
-
"#{STAGES['id'][@id]} #{STAGES['type'][@type]}"
|
23
|
+
"(#{STAGES['id'][@id]} #{STAGES['type'][@type]})"
|
21
24
|
end
|
22
25
|
end
|
23
|
-
|
24
|
-
def nil?
|
25
|
-
@id.nil? && @type.nil?
|
26
|
-
end
|
27
26
|
end
|
28
27
|
end
|
@@ -10,8 +10,16 @@ module Pubid::Nist
|
|
10
10
|
end
|
11
11
|
|
12
12
|
rule(series: subtree(:series)) do |context|
|
13
|
-
|
14
|
-
|
13
|
+
if context[:publisher]
|
14
|
+
if context[:series]
|
15
|
+
{ series: Series.new(series: context[:series].to_s.gsub(".", " ")) }
|
16
|
+
else
|
17
|
+
{}
|
18
|
+
end
|
19
|
+
else
|
20
|
+
{ series: Series.new(series: context[:series].to_s.gsub(".", " ")),
|
21
|
+
publisher: Publisher.parse(context[:series]) }
|
22
|
+
end
|
15
23
|
end
|
16
24
|
|
17
25
|
# remove :second_report_number from output
|
data/lib/pubid/nist/version.rb
CHANGED
data/lib/pubid/nist.rb
CHANGED
data/series.yaml
CHANGED
@@ -1,137 +1,115 @@
|
|
1
1
|
long:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
NBS BMS: Building Material Structures Report
|
2
|
+
AMS: Advanced Manufacturing Series
|
3
|
+
BSS: Building Science Series
|
4
|
+
BMS: Building Material Structures Report
|
6
5
|
NBS BRPD-CRPL-D: Basic Radio Propagation Predictions Series
|
7
|
-
|
8
|
-
|
6
|
+
BH: Building and Housing
|
7
|
+
CRPL: Central Radio Propagation Laboratory Reports
|
9
8
|
NBS CRPL-F-A: CRPL Ionospheric Data
|
10
9
|
NBS CRPL-F-B: CRPL Solar-Geophysical Data
|
11
10
|
NBS IP: CRPL Ionospheric Predictions
|
12
|
-
|
11
|
+
CIRC: Circulars
|
13
12
|
NBS CIS: Consumer Information Series
|
14
|
-
|
13
|
+
CS: Commercial Standards
|
15
14
|
NBS CS-E: Commercial Standards (emergency)
|
16
|
-
|
17
|
-
NBS FIPS: Federal Information Processing Standards Publication
|
15
|
+
CSM: Commercial Standards Monthly
|
18
16
|
FIPS: Federal Information Processing Standards Publication
|
19
|
-
|
20
|
-
|
21
|
-
NIST HB: Handbook
|
22
|
-
NBS HB: Handbook
|
17
|
+
GCR: Grant/Contract Reports
|
18
|
+
HB: Handbooks
|
23
19
|
NBS HR: Hydraulic Research in the United States
|
24
20
|
NBS IRPL: Interservice Radio Propagation Laboratory
|
25
21
|
ITL Bulletin: ITL Bulletin
|
26
22
|
NIST LC: Letter Circular
|
27
23
|
NBS LC: Letter Circular
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
NIST NSRDS: National Standard Reference Data Series
|
24
|
+
MONO: Monograph
|
25
|
+
MP: Miscellaneous Publications
|
26
|
+
NCSTAR: National Construction Safety Team Act Reports
|
27
|
+
NSRDS: National Standard Reference Data Series
|
33
28
|
NSRDS-NBS: National Standard Reference Data Series
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
NBS RPT: Reports
|
29
|
+
IR: IR
|
30
|
+
OWMWP: Office of Weights and Measures White Papers
|
31
|
+
PC: Photographic Laboratory Circulars
|
32
|
+
RPT: Reports
|
39
33
|
NIST PS: Voluntary Product Standards
|
40
|
-
|
34
|
+
SIBS: Special Interior Ballistics Studies
|
41
35
|
NBS PS: Voluntary Product Standards
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
NBS TIBM: Technical Information on Building Materials
|
47
|
-
NIST TTB: Technology Transfer Brief
|
36
|
+
SP: Special Publication
|
37
|
+
TN: Technical Notes
|
38
|
+
TIBM: Technical Information on Building Materials for Use in the Design of Low Cost Housing
|
39
|
+
TTB: Technology Transfer Briefs
|
48
40
|
NIST DCI: Data Collection Instruments
|
49
|
-
|
41
|
+
EAB: Economic Analysis Brief
|
50
42
|
NIST Other: Other
|
51
|
-
|
43
|
+
CSWP: Cybersecurity White Papers
|
52
44
|
CSRC Book: Cybersecurity Resource Center Book
|
53
45
|
CSRC Use Case: Cybersecurity Resource Center Use Case
|
54
46
|
CSRC Building Block: Cybersecurity Resource Center Building Block
|
55
47
|
JPCRD: Journal of Physical and Chemical Reference Data
|
56
48
|
JRES: Journal of Research of NIST
|
57
49
|
abbrev:
|
58
|
-
|
59
|
-
|
60
|
-
NBS BSS: Bldg. Sci. Ser.
|
61
|
-
NBS FIPS: Federal Inf. Process. Stds.
|
50
|
+
AMS: Adv. Man. Ser
|
51
|
+
BSS: Bldg. Sci. Ser.
|
62
52
|
FIPS: Federal Inf. Process. Stds.
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
NIST NCSTAR: Natl. Constr. Tm. Act Rpt.
|
68
|
-
NIST NSRDS: Natl. Stand. Ret. Data Ser.
|
53
|
+
HB: Handb.
|
54
|
+
MONO: Monogr.
|
55
|
+
NCSTAR: Natl. Constr. Tm. Act Rpt.
|
56
|
+
NSRDS: Natl. Stand. Ret. Data Ser.
|
69
57
|
NSRDS-NBS: Natl. Stand. Ret. Data Ser.
|
70
58
|
NIST PS: Prod. Stand.
|
71
59
|
NBS PS: Prod. Stand.
|
72
|
-
|
73
|
-
|
74
|
-
NIST TN: Tech. Note
|
75
|
-
NBS TN: Tech. Note
|
60
|
+
SP: Spec. Publ.
|
61
|
+
TN: Tech. Note
|
76
62
|
NIST DCI: Data Collect. Instr.
|
77
63
|
NIST Other: Other
|
78
|
-
|
64
|
+
CSWP: CSWP
|
79
65
|
CSRC Book: CSRC Book
|
80
66
|
CSRC Use Case: CSRC Use Case
|
81
67
|
CSRC Building Block: CSRC Building Block
|
82
68
|
JPCRD: J. Phys. & Chem. Ref. Data
|
83
69
|
JRES: J. Res. Natl. Inst. Stan.
|
84
70
|
mr:
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
NBS BMS: NBS.BMS
|
71
|
+
AMS: AMS
|
72
|
+
BSS: BSS
|
73
|
+
BMS: BMS
|
89
74
|
NBS BRPD-CRPL-D: NBS.BRPD-CRPL-D
|
90
|
-
|
91
|
-
|
75
|
+
BH: BH
|
76
|
+
CRPL: CRPL
|
92
77
|
NBS CRPL-F-A: NBS.CRPL-F-A
|
93
78
|
NBS CRPL-F-B: NBS.CRPL-F-B
|
94
79
|
NBS IP: NBS.IP
|
95
|
-
|
80
|
+
CIRC: CIRC
|
96
81
|
NBS CIS: NBS.CIS
|
97
|
-
|
82
|
+
CS: CS
|
98
83
|
NBS CS-E: NBS.CS-E
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
NBS GCR: NBS.GCR
|
104
|
-
NIST HB: NIST.HB
|
105
|
-
NBS HB: NBS.HB
|
84
|
+
CSM: CSM
|
85
|
+
FIPS: FIPS
|
86
|
+
GCR: GCR
|
87
|
+
HB: HB
|
106
88
|
NBS HR: NBS.HR
|
107
89
|
NBS IRPL: NBS.IRPL
|
108
90
|
ITL Bulletin: NIST.ITLB
|
109
91
|
NIST LC: NIST.LC
|
110
92
|
NBS LC: NBS.LC
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
NIST NSRDS: NIST.NSRDS
|
93
|
+
MONO: MN
|
94
|
+
MP: MP
|
95
|
+
NCSTAR: NCSTAR
|
96
|
+
NSRDS: NSRDS
|
116
97
|
NSRDS-NBS: NBS.NSRDS
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
NBS RPT: NBS.RPT
|
98
|
+
IR: IR
|
99
|
+
OWMWP: OWMWP
|
100
|
+
PC: PC
|
101
|
+
RPT: RPT
|
122
102
|
NIST PS: NIST.PS
|
123
|
-
|
103
|
+
SIBS: SIBS
|
124
104
|
NBS PS: NBS.PS
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
NBS TIBM: NBS.TIBM
|
130
|
-
NIST TTB: NIST.TTB
|
105
|
+
SP: SP
|
106
|
+
TN: TN
|
107
|
+
TIBM: TIBM
|
108
|
+
TTB: TTB
|
131
109
|
NIST DCI: NIST.DCI
|
132
|
-
|
110
|
+
EAB: EAB
|
133
111
|
NIST Other: NIST.O
|
134
|
-
|
112
|
+
CSWP: CSWP
|
135
113
|
CSRC Book: NIST.CSB
|
136
114
|
CSRC Use Case: NIST.CSUC
|
137
115
|
CSRC Building Block: NIST.CSBB
|
data/update_codes.yaml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
NBS
|
2
|
-
NIST
|
1
|
+
NBS MN: NBS MONO
|
2
|
+
NIST MN: NIST MONO
|
3
3
|
NIST MP: NBS MP
|
4
4
|
NIST SP 260-162 2006ed.: NIST SP 260-162e2006
|
5
5
|
NBS CIRC 154suprev: NBS CIRC 154r1sup
|
@@ -9,7 +9,7 @@ NBS CIRC supJun1925-Jun1927: NBS CIRC 24e7sup3
|
|
9
9
|
NBS CIRC e2: NBS CIRC 2e2
|
10
10
|
NBS CIRC 25sup-1924: NBS CIRC 25sup
|
11
11
|
NIST SP 260-126 rev 2013: NIST SP 260-126r2013
|
12
|
-
NIST
|
12
|
+
NIST CSRC White Paper: NIST CSWP
|
13
13
|
NIST SP 800-56ar: NIST SP 800-56Ar1
|
14
14
|
NIST.LCIRC: NIST.LC
|
15
15
|
NBS.LCIRC: NBS.LC
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pubid-nist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -171,32 +171,26 @@ files:
|
|
171
171
|
- lib/pubid/nist/identifier.rb
|
172
172
|
- lib/pubid/nist/nist_tech_pubs.rb
|
173
173
|
- lib/pubid/nist/parser.rb
|
174
|
+
- lib/pubid/nist/parsers/circ.rb
|
175
|
+
- lib/pubid/nist/parsers/crpl.rb
|
176
|
+
- lib/pubid/nist/parsers/csm.rb
|
174
177
|
- lib/pubid/nist/parsers/default.rb
|
175
178
|
- lib/pubid/nist/parsers/fips.rb
|
176
|
-
- lib/pubid/nist/parsers/
|
177
|
-
- lib/pubid/nist/parsers/
|
178
|
-
- lib/pubid/nist/parsers/
|
179
|
-
- lib/pubid/nist/parsers/nbs_csm.rb
|
180
|
-
- lib/pubid/nist/parsers/nbs_fips.rb
|
181
|
-
- lib/pubid/nist/parsers/nbs_hb.rb
|
179
|
+
- lib/pubid/nist/parsers/gcr.rb
|
180
|
+
- lib/pubid/nist/parsers/hb.rb
|
181
|
+
- lib/pubid/nist/parsers/mp.rb
|
182
182
|
- lib/pubid/nist/parsers/nbs_ir.rb
|
183
183
|
- lib/pubid/nist/parsers/nbs_lc.rb
|
184
|
-
- lib/pubid/nist/parsers/
|
185
|
-
- lib/pubid/nist/parsers/nbs_mp.rb
|
186
|
-
- lib/pubid/nist/parsers/nbs_rpt.rb
|
187
|
-
- lib/pubid/nist/parsers/nbs_sp.rb
|
188
|
-
- lib/pubid/nist/parsers/nbs_tn.rb
|
189
|
-
- lib/pubid/nist/parsers/nist_gcr.rb
|
190
|
-
- lib/pubid/nist/parsers/nist_hb.rb
|
184
|
+
- lib/pubid/nist/parsers/ncstar.rb
|
191
185
|
- lib/pubid/nist/parsers/nist_ir.rb
|
192
|
-
- lib/pubid/nist/parsers/
|
193
|
-
- lib/pubid/nist/parsers/
|
194
|
-
- lib/pubid/nist/parsers/
|
195
|
-
- lib/pubid/nist/parsers/
|
186
|
+
- lib/pubid/nist/parsers/owmwp.rb
|
187
|
+
- lib/pubid/nist/parsers/rpt.rb
|
188
|
+
- lib/pubid/nist/parsers/sp.rb
|
189
|
+
- lib/pubid/nist/parsers/tn.rb
|
196
190
|
- lib/pubid/nist/publisher.rb
|
197
191
|
- lib/pubid/nist/renderer/addendum.rb
|
198
192
|
- lib/pubid/nist/renderer/base.rb
|
199
|
-
- lib/pubid/nist/
|
193
|
+
- lib/pubid/nist/series.rb
|
200
194
|
- lib/pubid/nist/stage.rb
|
201
195
|
- lib/pubid/nist/transformer.rb
|
202
196
|
- lib/pubid/nist/update.rb
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module Pubid::Nist
|
2
|
-
module Parsers
|
3
|
-
class NbsFips < Default
|
4
|
-
rule(:edition) do
|
5
|
-
str("-") >> (
|
6
|
-
(month_letters.as(:edition_month) >> year_digits.as(:edition_year)) |
|
7
|
-
year_digits.as(:edition_year) |
|
8
|
-
(month_letters.as(:edition_month) >> match('\d').repeat(2, 2).as(:edition_day) >>
|
9
|
-
str("/") >> year_digits.as(:edition_year))
|
10
|
-
) |
|
11
|
-
(str("e") >> year_digits.as(:edition_year) >> month_digits.as(:edition_month).maybe)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
module Pubid::Nist
|
2
|
-
module Parsers
|
3
|
-
class NbsSp < Default
|
4
|
-
rule(:part_prefixes) do
|
5
|
-
str("pt") | str("p") | str("P")
|
6
|
-
end
|
7
|
-
|
8
|
-
rule(:volume) do
|
9
|
-
str("v") >> (match('[\da-z-]').repeat(1) >> match("[A-Z]").repeat).as(:volume)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
data/lib/pubid/nist/serie.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
SERIES = YAML.load_file(File.join(File.dirname(__FILE__), "../../../series.yaml"))
|
2
|
-
|
3
|
-
module Pubid::Nist
|
4
|
-
class Serie
|
5
|
-
attr_accessor :serie, :parsed
|
6
|
-
|
7
|
-
def initialize(serie:, parsed: nil)
|
8
|
-
raise Errors::SerieInvalidError, "#{serie} is not valid serie" unless SERIES["long"].key?(serie)
|
9
|
-
|
10
|
-
@serie = serie
|
11
|
-
@parsed = parsed
|
12
|
-
end
|
13
|
-
|
14
|
-
def to_s(format = :short)
|
15
|
-
return @serie if format == :short
|
16
|
-
|
17
|
-
result = SERIES[format.to_s][@serie]
|
18
|
-
return @serie if result.nil? && format == :mr
|
19
|
-
|
20
|
-
return SERIES["long"][@serie] if result.nil?
|
21
|
-
|
22
|
-
result
|
23
|
-
end
|
24
|
-
|
25
|
-
def ==(other)
|
26
|
-
other.serie == @serie
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|