pubid-iec 0.3.0 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e57bcfb0e8b8e333e16b5fae2f8103cc7fb3c755717f55afd485f5d100931e4
4
- data.tar.gz: 57af222f9db3651ec847af8b5b21ec0715eeadf0883df955de4cc69ccf2b7b72
3
+ metadata.gz: 134c88cd97b9f01cb400274bf68da78d3b32dfb376a075a5917a50275c54436a
4
+ data.tar.gz: 295a46cd51f15c8d2c5be73e2cdda9b74ef35cbc69d93045ff1e45e22f319bae
5
5
  SHA512:
6
- metadata.gz: bcb6be5089d7225c204df7209102cb429e13eebaf4782097edfc664a588e536d19dfdbd4d3f8bc2e27e8456772c996c7fb5dd1ceb59f47e1400f7fd0627c55ca
7
- data.tar.gz: 838eb82be8b4385f99f028e87fcf301b7f128901369309adaffaee00ec245e36132581111f658b60e66aae6a3b448ccd3571d7cbcb8f3f447895823aff836d1b
6
+ metadata.gz: 413c4a52be16b94e4afa98991b08bc20ec97f302612aa9b00677a94ccf682b94dd053ba3d672e5bbb2e6f8c07696e1435d39aba99133874121a082081599690b
7
+ data.tar.gz: 1355b18c8e905925d58a77375c7765b0bcbbb9477f57858d88b7059dcae7709cac7dc7598190881d1e26d552c091136c6c38b7725280cfa5a122d84578e73f50
@@ -5,7 +5,7 @@ module Pubid::Iec
5
5
 
6
6
  attr_accessor :vap, :database, :fragment, :version, :decision_sheet,
7
7
  :conjuction_part, :part_version, :trf_publisher,
8
- :trf_series, :trf_version, :test_type, :month, :day
8
+ :trf_series, :trf_version, :test_type, :month, :day, :sheet
9
9
 
10
10
  extend Forwardable
11
11
 
@@ -17,7 +17,7 @@ module Pubid::Iec
17
17
  conjuction_part: nil, part_version: nil, trf_publisher: nil,
18
18
  trf_series: nil, trf_version: nil, test_type: nil,
19
19
  edition: nil, type: nil, month: nil, day: nil,
20
- language: nil, stage: nil, **args)
20
+ language: nil, stage: nil, sheet: nil, **args)
21
21
 
22
22
  @vap = vap.to_s if vap
23
23
  @database = database if database
@@ -34,6 +34,7 @@ module Pubid::Iec
34
34
  @month = month if month
35
35
  @day = day if day
36
36
  @language = language if language
37
+ @sheet = sheet if sheet
37
38
 
38
39
  if stage
39
40
  @stage = self.class.has_project_stage?(stage) ? self.class.resolve_project_stage(stage) : resolve_stage(stage)
@@ -17,7 +17,7 @@ module Pubid::Iec
17
17
 
18
18
  rule(:part) do
19
19
  (str("-") | str("/")) >> space? >>
20
- (str("Amd") | str("Cor")).absent? >> (match['[\dA-Z]'] | str("-")).repeat(1).as(:part)
20
+ (str("Amd") | str("Cor")).absent? >> (match['[\dA-Za-z]'] | str("-")).repeat(1).as(:part)
21
21
  end
22
22
 
23
23
  rule(:version) { digits >> (dot >> digits).maybe }
@@ -41,6 +41,11 @@ module Pubid::Iec
41
41
  (str(":") >> digits.as(:year)).maybe).as(:interpretation_sheet)
42
42
  end
43
43
 
44
+ rule(:sheet) do
45
+ (str("/") >> digits.as(:number) >> (str(":") >>
46
+ digits.as(:year)).maybe).as(:sheet)
47
+ end
48
+
44
49
  rule(:fragment) do
45
50
  (str("/") >> str("FRAG") >> match('[\dA-Z]').repeat(1).as(:fragment)).maybe
46
51
  end
@@ -59,7 +64,7 @@ module Pubid::Iec
59
64
  rule(:number) do
60
65
  (digits | str("SYMBOL") | str("SYCSMARTENERGY") | str("SyCLVDC") |
61
66
  str("SYCLVDC") | str("SyCCOMM") | str("SyCAAL") | str("VIM") | match("[A-Za-z0-9 ]").repeat) >>
62
- ((str(":") >> match("[A-Z]").repeat(1)) | match("[A-Z]")).maybe
67
+ ((str(":") >> match("[A-Z]").repeat(1)) | match("[a-zA-Z]")).maybe
63
68
  end
64
69
 
65
70
  rule(:std_document_body) do
@@ -69,8 +74,8 @@ module Pubid::Iec
69
74
  part.maybe >>
70
75
  conjuction_part.maybe >>
71
76
  (space? >> str(":") >> year >> (str("-") >> month_digits.as(:month) >>
72
- (str("-") >> day_digits.as(:day)).maybe).maybe).maybe >>
73
- ((amendment >> corrigendum.maybe) | corrigendum).repeat >>
77
+ (str("-") >> day_digits.as(:day)).maybe).maybe).maybe >> sheet.maybe >>
78
+ ((amendment >> vap.maybe >> corrigendum.maybe) | corrigendum).repeat >>
74
79
  interpretation_sheet.maybe >> fragment.maybe
75
80
  end
76
81
 
@@ -3,7 +3,7 @@ module Pubid::Iec::Renderer
3
3
  def render_identifier(params)
4
4
  "%{publisher}%{type}%{typed_stage}%{stage} %{number}%{part}%{conjuction_part}"\
5
5
  "%{part_version}%{version}%{iteration}"\
6
- "%{year}%{month}%{day}%{amendments}%{corrigendums}%{fragment}%{vap}%{edition}%{database}" % params
6
+ "%{year}%{month}%{day}%{sheet}%{amendments}%{corrigendums}%{fragment}%{vap}%{edition}%{database}" % params
7
7
  end
8
8
  def render_typed_stage(typed_stage, _opts, _params)
9
9
  " #{typed_stage}"
@@ -29,6 +29,10 @@ module Pubid::Iec::Renderer
29
29
  "/FRAG#{fragment}"
30
30
  end
31
31
 
32
+ def render_sheet(sheet, _opts, _params)
33
+ "/#{sheet[:number]}" + (sheet[:year] ? ":#{sheet[:year]}" : "")
34
+ end
35
+
32
36
  def render_database(database, _opts, _params)
33
37
  " DB" if database
34
38
  end
@@ -1,5 +1,5 @@
1
1
  module Pubid
2
2
  module Iec
3
- VERSION = "0.3.0".freeze
3
+ VERSION = "0.3.2".freeze
4
4
  end
5
5
  end
data/update_codes.yaml CHANGED
@@ -57,3 +57,7 @@ IECEE TRF 60730-1HSOF:2014: IECEE TRF 60730-1H_SOF:2014
57
57
  IECEE TRF 60730-1HEMC:2014: IECEE TRF 60730-1H_EMC:2014
58
58
  IECEE TRF 60730-2-1IEMC:2019: IECEE TRF 60730-2-1I_EMC:2019
59
59
  IECEE TRF 60601-1-2CEMC:2011: IECEE TRF 60601-1-2C_EMC:2011
60
+ "CISPR 14-2:2015/AMD1/FRAG3:": CISPR 14-2:2015/AMD1/FRAG3 ED2
61
+ "IEC 60309-3:1994/FRAG1:": IEC 60309-3:1994/FRAG1 ED1
62
+ "CISPR 14-1:2016/AMD1/FRAG5:": CISPR 14-1:2016/AMD1/FRAG5 ED5
63
+ "IEC 60285-/1:1989": IEC 60285-1:1989
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pubid-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
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-01-10 00:00:00.000000000 Z
11
+ date: 2024-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  requirements: []
146
- rubygems_version: 3.3.26
146
+ rubygems_version: 3.3.27
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: Library to generate, parse and manipulate IEC PubID.