pubid-nist 0.2.3 → 0.2.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7f76d8947ccd706282e78b94eb9c4284671b866acc1630c08a1fdd398dbd73e
4
- data.tar.gz: 01dfd5d1e8afbe479916a906566406f2d3a7d8d3235053a86be6d0cf1c09de5c
3
+ metadata.gz: 7e7f47e08604ec704f0cf6468e57bf119027caf37ccba4043269374d2e9381a3
4
+ data.tar.gz: ec580488f65954d7fcbbfff5dd17e0cdc2dc88f7d07cb81d0bada5812beae2fe
5
5
  SHA512:
6
- metadata.gz: 051144f72ccff63f56b875f2bb843750b14b86d3b9014f27ecd15cfd61e084052df6ae44be931a2c9b7a7e63dee3e03a927e4c6123cf6ff3727cb134fcb43340
7
- data.tar.gz: 7b26bc1e82271f82286079bda318834594dc93eca2ef6e3569109e2323d47c06708404aed1f1dd02aead5a1d03d60efe14d900556696976945fa4778fd2a032a
6
+ metadata.gz: d3c2ec778fb99af9427532d92404c60fef8a4e1f65342ab61b0925ade00849c9e151604e2bc2b3cf2d71877dbad840c017c581036e0dc22b1a307bafd06ae2f4
7
+ data.tar.gz: 787c614f6716d8cc8044821c1ff90ae1afebbe2731673adef5aef5150fa77a5e8d32d633f7367d2929620578d84ed6b6bb81e39367e422f017704d2b34cc65e0
@@ -73,7 +73,7 @@ module Pubid::Nist
73
73
 
74
74
  # @param without_edition [Boolean] render pubid without rendering edition
75
75
  def to_s(format = :short, without_edition: false)
76
- self.class.get_renderer_class.new(get_params).render(format: format, without_edition: without_edition)
76
+ self.class.get_renderer_class.new(to_h).render(format: format, without_edition: without_edition)
77
77
  end
78
78
 
79
79
  def to_json(*args)
@@ -40,7 +40,8 @@ module Pubid::Nist
40
40
  end
41
41
 
42
42
  rule(:stage) do
43
- (space >> (array_to_str(STAGES["id"].keys).as(:id) >> array_to_str(STAGES["type"].keys).as(:type)).as(:stage))
43
+ (space >> (array_to_str(STAGES["id"].keys + STAGES["id"].keys.map(&:upcase)).as(:id) >>
44
+ array_to_str(STAGES["type"].keys + STAGES["type"].keys.map(&:upcase)).as(:type)).as(:stage))
44
45
  end
45
46
 
46
47
  rule(:draft) do
@@ -83,7 +84,7 @@ module Pubid::Nist
83
84
  end
84
85
 
85
86
  rule(:update) do
86
- (str("/Upd") | str("/upd")) >> (digits.as(:number) >> str("-") >> digits.as(:year)).as(:update)
87
+ (str("/Upd") | str("/upd")) >> (digits.as(:number) >> (str("-") >> digits.as(:year)).maybe).as(:update)
87
88
  end
88
89
 
89
90
  rule(:translation) do
@@ -2,7 +2,7 @@ require_relative "nbs_fips"
2
2
 
3
3
  module Pubid::Nist
4
4
  module Parsers
5
- class FipsPub < NbsFips
5
+ class Fips < NbsFips
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module Pubid::Nist
2
2
  module Parsers
3
3
  class NistSp < Default
4
4
  rule(:version) do
5
- (((str("ver") | str(" Ver. ")) >> (digits >> (str(".") >> digits).repeat).as(:version)) |
5
+ (((str("ver") | str(" Ver. ") | str(" Version ")) >> (digits >> (str(".") >> digits).repeat).as(:version)) |
6
6
  (str("v") >>
7
7
  (match('\d') >> str(".") >> match('\d') >> (str(".") >> match('\d')).maybe).as(:version)))
8
8
  end
@@ -39,15 +39,21 @@ module Pubid::Nist
39
39
 
40
40
  rule(:edition) do
41
41
  ((str("e") >> year_digits.as(:edition_year)) | (str("-") >> year_digits.as(:edition_year)) |
42
- (str("e") >> digits.as(:edition)))
42
+ ((str("e") | str(" E")) >> digits.as(:edition)))
43
43
  end
44
44
 
45
45
  rule(:revision) do
46
- ((str("rev") | str("r")) >> (digits >> match("[a-z]").maybe).as(:revision)) |
46
+ ((str("rev") | str("r") | str(" Rev. ")) >> (digits >> match("[a-z]").maybe).as(:revision)) |
47
47
  (str("-") >> digits.as(:revision)) |
48
48
  (str("r") >> match("[a-z]").as(:revision)) |
49
- (str("r") >> str("").as(:revision))
49
+ ((str("r") | str(" Revision (r)")) >> str("").as(:revision))
50
50
  end
51
+
52
+ rule(:volume) do
53
+ (str("v") | str(" Vol. ")) >> digits.as(:volume)
54
+ end
55
+
56
+ rule(:part_prefixes) { str("pt") | str("p") | str(" Part ") }
51
57
  end
52
58
  end
53
59
  end
@@ -204,7 +204,7 @@ module Pubid::Nist
204
204
  when :mr
205
205
  "."
206
206
  when :short
207
- ""
207
+ " "
208
208
  else
209
209
  " "
210
210
  end + stage.to_s(opts[:format])
@@ -13,7 +13,7 @@ module Pubid::Nist
13
13
 
14
14
  case format
15
15
  when :short
16
- " #{@id}#{@type}"
16
+ "#{@id}#{@type}"
17
17
  when :mr
18
18
  "#{@id}#{@type}"
19
19
  else
@@ -1,5 +1,5 @@
1
1
  module Pubid
2
2
  module Nist
3
- VERSION = "0.2.3".freeze
3
+ VERSION = "0.2.4".freeze
4
4
  end
5
5
  end
data/series.yaml CHANGED
@@ -15,7 +15,7 @@ long:
15
15
  NBS CS-E: Commercial Standards (emergency)
16
16
  NBS CSM: Commercial Standards Monthly
17
17
  NBS FIPS: Federal Information Processing Standards Publication
18
- FIPS PUB: Federal Information Processing Standards Publication
18
+ FIPS: Federal Information Processing Standards Publication
19
19
  NIST GCR: Grant/Contract Reports
20
20
  NBS GCR: Grant/Contract Reports
21
21
  NIST HB: Handbook
@@ -59,7 +59,7 @@ abbrev:
59
59
  NIST BSS: Bldg. Sci. Ser.
60
60
  NBS BSS: Bldg. Sci. Ser.
61
61
  NBS FIPS: Federal Inf. Process. Stds.
62
- FIPS PUB: Federal Inf. Process. Stds.
62
+ FIPS: Federal Inf. Process. Stds.
63
63
  NIST HB: Handb.
64
64
  NBS HB: Handb.
65
65
  NIST MN: Monogr.
@@ -98,7 +98,7 @@ mr:
98
98
  NBS CS-E: NBS.CS-E
99
99
  NBS CSM: NBS.CSM
100
100
  NBS FIPS: NBS.FIPS
101
- FIPS PUB: NIST.FIPS
101
+ FIPS: NIST.FIPS
102
102
  NIST GCR: NIST.GCR
103
103
  NBS GCR: NBS.GCR
104
104
  NIST HB: NIST.HB
data/update_codes.yaml CHANGED
@@ -17,12 +17,14 @@ NIST LCIRC: NIST LC
17
17
  NBS LCIRC: NBS LC
18
18
  NIST SP 800-57Pt3r1: NIST SP 800-57pt3r1
19
19
  NISTIR: NIST IR
20
- NIST FIPS: FIPS PUB
20
+ NIST FIPS: FIPS
21
21
  NIST.CSWP.01162020pt: NIST.CSWP.01162020(por)
22
22
  /^NBS FIPS 11-1-Sep30$/: NBS FIPS 11-1-Sep30/1977
23
23
  /^NBS FIPS 89-Sep1$/: NBS FIPS 89-Sep1981
24
- /^FIPS PUB 54-1-Jan15$/: FIPS PUB 54-1
25
- /^FIPS PUB 54-1-Jan17$/: FIPS PUB 54-1-Jan17/1991
24
+ /^FIPS PUB 54-1-Jan15$/: FIPS 54-1
25
+ /^FIPS 54-1-Jan15$/: FIPS 54-1
26
+ /^FIPS 54-1-Jan17$/: FIPS 54-1-Jan17/1991
27
+ FIPS PUB: FIPS
26
28
  NBS CRPL c4-4: NBS CRPL 4-4
27
29
  NIST AMS 300-8r1 (February 2021 update): NIST AMS 300-8r1/Upd1-202102
28
30
  NIST AMS 300-8r1/upd: NIST AMS 300-8r1/Upd1-202102
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.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-11 00:00:00.000000000 Z
11
+ date: 2023-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -128,14 +128,28 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 1.8.0
131
+ version: 1.10.3
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 1.8.0
138
+ version: 1.10.3
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubyzip
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  description: Library to generate, parse and manipulate NIST PubID.
140
154
  email:
141
155
  - open.source@ribose.com
@@ -157,7 +171,7 @@ files:
157
171
  - lib/pubid/nist/nist_tech_pubs.rb
158
172
  - lib/pubid/nist/parser.rb
159
173
  - lib/pubid/nist/parsers/default.rb
160
- - lib/pubid/nist/parsers/fips_pub.rb
174
+ - lib/pubid/nist/parsers/fips.rb
161
175
  - lib/pubid/nist/parsers/nbs_bh.rb
162
176
  - lib/pubid/nist/parsers/nbs_circ.rb
163
177
  - lib/pubid/nist/parsers/nbs_crpl.rb