relaton-bsi 1.8.3 → 1.9.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: 84f6c2293e2c3e5fce33f142ae0e5055f000c0066a19a030dc67e29f360424b6
4
- data.tar.gz: 2c70d908fc92fc700695c967087f0eb4d9217e660ed997b270688269422fa58a
3
+ metadata.gz: 0e35dcda4191d7eeb80cff93c299c6d7b629af7fa7534d8c08edf740573d98bd
4
+ data.tar.gz: 7a1b3a52177f1ef5ad36d530c1c2cc2a71f69c5dfe3232d5619b3429a86849b4
5
5
  SHA512:
6
- metadata.gz: 7b7e2d420bd3bb4b9da454e7b69cc78ec1d262b3918ba23b565ce43824e4092f5b6793dd7a5b7dc3ffc0d8f11fdc9d75012fac62dd0defa0f201da4c4e7016be
7
- data.tar.gz: 2f11789f4274ff43ef07c8ddf44b141e6b524d76cd9fd53b996c6c1d6b22c17e31d649469a424b0b3e385caf1342a1c53fe5fb73e3b752106c591c9b3aa4163e
6
+ metadata.gz: 915df61335547d25559ddf97c92b0c7029cf679eb3f09131de86698797912c687be3af9dea159fdb46c43a73915bc1976338925116636b02d2832abe30f06f21
7
+ data.tar.gz: 70b54bc05430c5a983fca9d4b894eaa770d212a662f0741fd08275fcbf2005cb971c883523a590b261c7bda697e7a40d7e30dc59e5c87482bc4a8d488fce5cab
@@ -16,19 +16,9 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '2.7', '2.6', '2.5', '2.4' ]
19
+ ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
- include:
23
- - ruby: '3.0'
24
- os: 'ubuntu-latest'
25
- experimental: true
26
- - ruby: '3.0'
27
- os: 'windows-latest'
28
- experimental: true
29
- - ruby: '3.0'
30
- os: 'macos-latest'
31
- experimental: true
32
22
  steps:
33
23
  - uses: actions/checkout@v2
34
24
  with:
data/.rubocop.yml CHANGED
@@ -5,6 +5,6 @@
5
5
  inherit_from:
6
6
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
7
7
  AllCops:
8
- TargetRubyVersion: 2.4
8
+ TargetRubyVersion: 2.5
9
9
  Rails:
10
10
  Enabled: false
data/README.adoc CHANGED
@@ -94,6 +94,16 @@ item.to_xml
94
94
  </bibitem>"
95
95
  ----
96
96
 
97
+ === Typed links
98
+
99
+ Each BSI document has `src` type link.
100
+
101
+ [source,ruby]
102
+ ----
103
+ item.link
104
+ => [#<RelatonBib::TypedUri:0x00007fc02a152768 @content=#<Addressable::URI:0x576c URI:https://shop.bsigroup.com/products/small-craft-remote-mechanical-steering-systems>, @type="src">]
105
+ ----
106
+
97
107
  With `bibdata: true` option XML output wrapped with `bibdata` element and `ext` element added.
98
108
  [source,ruby]
99
109
  ----
@@ -114,11 +124,10 @@ item.to_xml bibdata: true
114
124
  </bibdata>"
115
125
  ----
116
126
 
117
- === Get code, and year
127
+ === Get standard by code and year
118
128
  [source,ruby]
119
129
  ----
120
- RelatonBsi::BsiBibliographicItem RelatonBsi::BsiBibliography
121
- [7] pry(main)> RelatonBsi::BsiBibliography.get "BS EN ISO 8848:2021"
130
+ RelatonBsi::BsiBibliography.get "BS EN ISO 8848:2021"
122
131
  [relaton-bsi] ("BS EN ISO 8848:2021") fetching...
123
132
  [relaton-bsi] ("BS EN ISO 8848:2021") found BS EN ISO 8848:2021
124
133
  => #<RelatonBsi::BsiBibliographicItem:0x007feb14814ca8
data/grammars/biblio.rng CHANGED
@@ -787,6 +787,7 @@
787
787
  <value>adapted</value>
788
788
  <value>vote-started</value>
789
789
  <value>vote-ended</value>
790
+ <value>announced</value>
790
791
  </choice>
791
792
  </define>
792
793
  <define name="bdate">
data/grammars/bsi.rng CHANGED
@@ -7,18 +7,36 @@
7
7
  </start>
8
8
  <define name="DocumentType">
9
9
  <choice>
10
- <value>specification</value>
11
- <value>management-systems-standard</value>
12
- <value>code-of-practice</value>
10
+ <value>british-standard</value>
11
+ <value>draft-for-development</value>
12
+ <value>published-document</value>
13
+ <value>privately-subscribed-standard</value>
14
+ <value>publicly-available-specification</value>
15
+ <value>flex-standard</value>
16
+ <value>international-standard</value>
17
+ <value>technical-specification</value>
18
+ <value>technical-report</value>
13
19
  <value>guide</value>
20
+ <value>international-workshop-agreement</value>
21
+ <value>industry-technical-agreement</value>
22
+ <value>standard</value>
23
+ <value>european-workshop-agreement</value>
24
+ </choice>
25
+ </define>
26
+ <define name="DocumentSubtype">
27
+ <choice>
28
+ <value>specification</value>
14
29
  <value>method-of-test</value>
15
30
  <value>method-of-specifying</value>
16
31
  <value>vocabulary</value>
17
- <value>classification</value>
32
+ <value>code-of-practice</value>
18
33
  </choice>
19
34
  </define>
20
35
  <define name="BibDataExtensionType">
21
36
  <ref name="doctype"/>
37
+ <optional>
38
+ <ref name="docsubtype"/>
39
+ </optional>
22
40
  <ref name="editorialgroup"/>
23
41
  <zeroOrMore>
24
42
  <ref name="ics"/>
@@ -27,12 +45,9 @@
27
45
  <optional>
28
46
  <ref name="stagename"/>
29
47
  </optional>
30
- <optional>
31
- <ref name="price-code"/>
32
- </optional>
33
- <optional>
34
- <ref name="cen-processing"/>
35
- </optional>
48
+ <zeroOrMore>
49
+ <ref name="coverimages"/>
50
+ </zeroOrMore>
36
51
  </define>
37
52
  <define name="admonition">
38
53
  <element name="admonition">
@@ -71,14 +86,11 @@
71
86
  <define name="AdmonitionType" combine="choice">
72
87
  <value>commentary</value>
73
88
  </define>
74
- <define name="price-code">
75
- <element name="price-code">
76
- <text/>
77
- </element>
78
- </define>
79
- <define name="cen-processing">
80
- <element name="cen-processing">
81
- <data type="boolean"/>
89
+ <define name="coverimages">
90
+ <element name="coverimages">
91
+ <oneOrMore>
92
+ <ref name="image"/>
93
+ </oneOrMore>
82
94
  </element>
83
95
  </define>
84
96
  <!--
data/grammars/isodoc.rng CHANGED
@@ -45,6 +45,11 @@
45
45
  <optional>
46
46
  <attribute name="alt"/>
47
47
  </optional>
48
+ <optional>
49
+ <attribute name="updatetype">
50
+ <data type="boolean"/>
51
+ </attribute>
52
+ </optional>
48
53
  <text/>
49
54
  </element>
50
55
  </define>
@@ -199,6 +204,18 @@
199
204
  </zeroOrMore>
200
205
  </element>
201
206
  </define>
207
+ <define name="dt">
208
+ <element name="dt">
209
+ <optional>
210
+ <attribute name="id">
211
+ <data type="ID"/>
212
+ </attribute>
213
+ </optional>
214
+ <zeroOrMore>
215
+ <ref name="TextElement"/>
216
+ </zeroOrMore>
217
+ </element>
218
+ </define>
202
219
  <define name="example">
203
220
  <element name="example">
204
221
  <attribute name="id">
@@ -543,6 +560,9 @@
543
560
  </define>
544
561
  <define name="BibDataExtensionType">
545
562
  <ref name="doctype"/>
563
+ <optional>
564
+ <ref name="docsubtype"/>
565
+ </optional>
546
566
  <optional>
547
567
  <ref name="editorialgroup"/>
548
568
  </optional>
@@ -876,8 +896,28 @@
876
896
  </zeroOrMore>
877
897
  </element>
878
898
  </define>
899
+ <define name="pagebreak">
900
+ <element name="pagebreak">
901
+ <optional>
902
+ <attribute name="orientation">
903
+ <choice>
904
+ <value>landscape</value>
905
+ <value>portrait</value>
906
+ </choice>
907
+ </attribute>
908
+ </optional>
909
+ </element>
910
+ </define>
879
911
  </include>
880
912
  <!-- end overrides -->
913
+ <define name="docsubtype">
914
+ <element name="subdoctype">
915
+ <ref name="DocumentSubtype"/>
916
+ </element>
917
+ </define>
918
+ <define name="DocumentSubtype">
919
+ <text/>
920
+ </define>
881
921
  <define name="colgroup">
882
922
  <element name="colgroup">
883
923
  <oneOrMore>
@@ -927,7 +967,34 @@
927
967
  <define name="concept">
928
968
  <element name="concept">
929
969
  <optional>
930
- <attribute name="term"/>
970
+ <attribute name="ital">
971
+ <data type="boolean"/>
972
+ </attribute>
973
+ </optional>
974
+ <optional>
975
+ <attribute name="ref">
976
+ <data type="boolean"/>
977
+ </attribute>
978
+ </optional>
979
+ <optional>
980
+ <element name="refterm">
981
+ <zeroOrMore>
982
+ <choice>
983
+ <ref name="PureTextElement"/>
984
+ <ref name="stem"/>
985
+ </choice>
986
+ </zeroOrMore>
987
+ </element>
988
+ </optional>
989
+ <optional>
990
+ <element name="renderterm">
991
+ <zeroOrMore>
992
+ <choice>
993
+ <ref name="PureTextElement"/>
994
+ <ref name="stem"/>
995
+ </choice>
996
+ </zeroOrMore>
997
+ </element>
931
998
  </optional>
932
999
  <choice>
933
1000
  <ref name="eref"/>
@@ -943,8 +1010,173 @@
943
1010
  <ref name="permission"/>
944
1011
  <ref name="imagemap"/>
945
1012
  <ref name="svgmap"/>
1013
+ <ref name="inputform"/>
946
1014
  </choice>
947
1015
  </define>
1016
+ <define name="inputform">
1017
+ <element name="form">
1018
+ <attribute name="id">
1019
+ <data type="ID"/>
1020
+ </attribute>
1021
+ <attribute name="name"/>
1022
+ <attribute name="action"/>
1023
+ <optional>
1024
+ <attribute name="class"/>
1025
+ </optional>
1026
+ <zeroOrMore>
1027
+ <choice>
1028
+ <ref name="TextElement"/>
1029
+ <ref name="FormInput"/>
1030
+ </choice>
1031
+ </zeroOrMore>
1032
+ </element>
1033
+ </define>
1034
+ <define name="FormInput">
1035
+ <choice>
1036
+ <ref name="input"/>
1037
+ <ref name="formlabel"/>
1038
+ <ref name="select"/>
1039
+ <ref name="textarea"/>
1040
+ </choice>
1041
+ </define>
1042
+ <define name="InputType">
1043
+ <choice>
1044
+ <value>button</value>
1045
+ <value>checkbox</value>
1046
+ <value>date</value>
1047
+ <value>file</value>
1048
+ <value>password</value>
1049
+ <value>radio</value>
1050
+ <value>submit</value>
1051
+ <value>text</value>
1052
+ </choice>
1053
+ </define>
1054
+ <define name="input">
1055
+ <element name="input">
1056
+ <attribute name="type">
1057
+ <ref name="InputType"/>
1058
+ </attribute>
1059
+ <optional>
1060
+ <attribute name="checked">
1061
+ <data type="boolean"/>
1062
+ </attribute>
1063
+ </optional>
1064
+ <optional>
1065
+ <attribute name="disabled">
1066
+ <data type="boolean"/>
1067
+ </attribute>
1068
+ </optional>
1069
+ <optional>
1070
+ <attribute name="readonly">
1071
+ <data type="boolean"/>
1072
+ </attribute>
1073
+ </optional>
1074
+ <optional>
1075
+ <attribute name="maxlength">
1076
+ <data type="int"/>
1077
+ </attribute>
1078
+ </optional>
1079
+ <optional>
1080
+ <attribute name="minlength">
1081
+ <data type="int"/>
1082
+ </attribute>
1083
+ </optional>
1084
+ <optional>
1085
+ <attribute name="name"/>
1086
+ </optional>
1087
+ <optional>
1088
+ <attribute name="value"/>
1089
+ </optional>
1090
+ <optional>
1091
+ <attribute name="id">
1092
+ <data type="ID"/>
1093
+ </attribute>
1094
+ </optional>
1095
+ </element>
1096
+ </define>
1097
+ <define name="formlabel">
1098
+ <element name="label">
1099
+ <attribute name="for">
1100
+ <data type="IDREF"/>
1101
+ </attribute>
1102
+ <zeroOrMore>
1103
+ <ref name="PureTextElement"/>
1104
+ </zeroOrMore>
1105
+ </element>
1106
+ </define>
1107
+ <define name="select">
1108
+ <element name="select">
1109
+ <optional>
1110
+ <attribute name="name"/>
1111
+ </optional>
1112
+ <optional>
1113
+ <attribute name="value"/>
1114
+ </optional>
1115
+ <optional>
1116
+ <attribute name="id">
1117
+ <data type="ID"/>
1118
+ </attribute>
1119
+ </optional>
1120
+ <optional>
1121
+ <attribute name="disabled">
1122
+ <data type="boolean"/>
1123
+ </attribute>
1124
+ </optional>
1125
+ <optional>
1126
+ <attribute name="multiple">
1127
+ <data type="boolean"/>
1128
+ </attribute>
1129
+ </optional>
1130
+ <optional>
1131
+ <attribute name="size">
1132
+ <data type="int"/>
1133
+ </attribute>
1134
+ </optional>
1135
+ <oneOrMore>
1136
+ <ref name="option"/>
1137
+ </oneOrMore>
1138
+ </element>
1139
+ </define>
1140
+ <define name="option">
1141
+ <element name="option">
1142
+ <optional>
1143
+ <attribute name="disabled">
1144
+ <data type="boolean"/>
1145
+ </attribute>
1146
+ </optional>
1147
+ <optional>
1148
+ <attribute name="value"/>
1149
+ </optional>
1150
+ <zeroOrMore>
1151
+ <ref name="PureTextElement"/>
1152
+ </zeroOrMore>
1153
+ </element>
1154
+ </define>
1155
+ <define name="textarea">
1156
+ <element name="textarea">
1157
+ <optional>
1158
+ <attribute name="name"/>
1159
+ </optional>
1160
+ <optional>
1161
+ <attribute name="value"/>
1162
+ </optional>
1163
+ <optional>
1164
+ <attribute name="id">
1165
+ <data type="ID"/>
1166
+ </attribute>
1167
+ </optional>
1168
+ <optional>
1169
+ <attribute name="rows">
1170
+ <data type="int"/>
1171
+ </attribute>
1172
+ </optional>
1173
+ <optional>
1174
+ <attribute name="cols">
1175
+ <data type="int"/>
1176
+ </attribute>
1177
+ </optional>
1178
+ </element>
1179
+ </define>
948
1180
  <define name="bibliography">
949
1181
  <element name="bibliography">
950
1182
  <oneOrMore>
@@ -1017,13 +1249,17 @@
1017
1249
  </define>
1018
1250
  <define name="IsoWorkgroup">
1019
1251
  <optional>
1020
- <attribute name="number">
1021
- <data type="int"/>
1022
- </attribute>
1252
+ <attribute name="number"/>
1023
1253
  </optional>
1024
1254
  <optional>
1025
1255
  <attribute name="type"/>
1026
1256
  </optional>
1257
+ <optional>
1258
+ <attribute name="identifier"/>
1259
+ </optional>
1260
+ <optional>
1261
+ <attribute name="prefix"/>
1262
+ </optional>
1027
1263
  <text/>
1028
1264
  </define>
1029
1265
  <define name="ics">
@@ -1285,26 +1521,26 @@
1285
1521
  <optional>
1286
1522
  <ref name="section-title"/>
1287
1523
  </optional>
1288
- <group>
1524
+ <choice>
1289
1525
  <choice>
1290
1526
  <group>
1291
- <zeroOrMore>
1527
+ <oneOrMore>
1292
1528
  <ref name="BasicBlock"/>
1293
- </zeroOrMore>
1529
+ </oneOrMore>
1294
1530
  <zeroOrMore>
1295
1531
  <ref name="note"/>
1296
1532
  </zeroOrMore>
1297
1533
  </group>
1298
1534
  <ref name="amend"/>
1299
1535
  </choice>
1300
- <zeroOrMore>
1536
+ <oneOrMore>
1301
1537
  <choice>
1302
1538
  <ref name="clause-subsection"/>
1303
1539
  <ref name="terms"/>
1304
1540
  <ref name="definitions"/>
1305
1541
  </choice>
1306
- </zeroOrMore>
1307
- </group>
1542
+ </oneOrMore>
1543
+ </choice>
1308
1544
  </define>
1309
1545
  <define name="Annex-Section">
1310
1546
  <optional>
@@ -38,6 +38,9 @@
38
38
  </define>
39
39
  <define name="BibDataExtensionType">
40
40
  <ref name="doctype"/>
41
+ <optional>
42
+ <ref name="docsubtype"/>
43
+ </optional>
41
44
  <optional>
42
45
  <ref name="horizontal"/>
43
46
  </optional>
@@ -98,7 +101,11 @@
98
101
  <ref name="definitions"/>
99
102
  </optional>
100
103
  <oneOrMore>
101
- <ref name="clause"/>
104
+ <choice>
105
+ <ref name="clause"/>
106
+ <ref name="term-clause"/>
107
+ <ref name="terms"/>
108
+ </choice>
102
109
  </oneOrMore>
103
110
  </element>
104
111
  </define>
@@ -133,7 +140,7 @@
133
140
  <optional>
134
141
  <ref name="section-title"/>
135
142
  </optional>
136
- <group>
143
+ <choice>
137
144
  <choice>
138
145
  <group>
139
146
  <oneOrMore>
@@ -148,7 +155,7 @@
148
155
  <oneOrMore>
149
156
  <ref name="clause-subsection"/>
150
157
  </oneOrMore>
151
- </group>
158
+ </choice>
152
159
  </define>
153
160
  <define name="term">
154
161
  <element name="term">
@@ -256,6 +263,15 @@
256
263
  <value>guide</value>
257
264
  <value>amendment</value>
258
265
  <value>technical-corrigendum</value>
266
+ <value>directive</value>
267
+ </choice>
268
+ </define>
269
+ <define name="DocumentSubtype">
270
+ <choice>
271
+ <value>specification</value>
272
+ <value>method-of-test</value>
273
+ <value>vocabulary</value>
274
+ <value>code-of-practice</value>
259
275
  </choice>
260
276
  </define>
261
277
  <define name="structuredidentifier">
data/grammars/reqt.rng CHANGED
@@ -30,15 +30,34 @@
30
30
  <data type="boolean"/>
31
31
  </attribute>
32
32
  </optional>
33
+ <optional>
34
+ <attribute name="number"/>
35
+ </optional>
33
36
  <optional>
34
37
  <attribute name="subsequence"/>
35
38
  </optional>
39
+ <optional>
40
+ <attribute name="keep-with-next">
41
+ <data type="boolean"/>
42
+ </attribute>
43
+ </optional>
44
+ <optional>
45
+ <attribute name="keep-lines-together">
46
+ <data type="boolean"/>
47
+ </attribute>
48
+ </optional>
36
49
  <attribute name="id">
37
50
  <data type="ID"/>
38
51
  </attribute>
39
52
  <optional>
40
53
  <attribute name="filename"/>
41
54
  </optional>
55
+ <optional>
56
+ <attribute name="model"/>
57
+ </optional>
58
+ <optional>
59
+ <attribute name="type"/>
60
+ </optional>
42
61
  <optional>
43
62
  <ref name="reqtitle"/>
44
63
  </optional>
@@ -48,9 +67,9 @@
48
67
  <optional>
49
68
  <ref name="subject"/>
50
69
  </optional>
51
- <optional>
70
+ <zeroOrMore>
52
71
  <ref name="reqinherit"/>
53
- </optional>
72
+ </zeroOrMore>
54
73
  <zeroOrMore>
55
74
  <ref name="classification"/>
56
75
  </zeroOrMore>
@@ -135,6 +154,16 @@
135
154
  <data type="boolean"/>
136
155
  </attribute>
137
156
  </optional>
157
+ <optional>
158
+ <attribute name="keep-with-next">
159
+ <data type="boolean"/>
160
+ </attribute>
161
+ </optional>
162
+ <optional>
163
+ <attribute name="keep-lines-together">
164
+ <data type="boolean"/>
165
+ </attribute>
166
+ </optional>
138
167
  <oneOrMore>
139
168
  <ref name="BasicBlock"/>
140
169
  </oneOrMore>
@@ -1,24 +1,25 @@
1
1
  module RelatonBsi
2
2
  class BsiBibliographicItem < RelatonIsoBib::IsoBibliographicItem
3
3
  TYPES = %w[
4
- specification management-systems-standard code-of-practice guide
5
- method-of-test method-of-specifying vocabulary classification
4
+ british-standard draft-for-development published-document privately-subscribed-standard
5
+ publicly-available-specification flex-standard international-standard technical-specification
6
+ technical-report guide international-workshop-agreement industry-technical-agreement
7
+ standard european-workshop-agreement
6
8
  ].freeze
7
9
 
8
- # @return [String, nil]
9
- attr_reader :price_code
10
-
11
- # @return [Boolean, nil]
12
- attr_reader :cen_processing
10
+ SUBDOCTYPES = %w[specification method-of-test method-of-specifying vocabulary code-of-practice].freeze
13
11
 
14
12
  # @params price_code [String, nil]
15
13
  # @param cen_processing [Boolean, nil]
16
- def initialize(**args)
14
+ def initialize(**args) # rubocop:disable Metrics/AbcSize
17
15
  # if args[:doctype] && !TYPES.include?(args[:doctype])
18
16
  # warn "[relaton-bsi] WARNING: invalid doctype: #{args[:doctype]}"
17
+ # warn "[relaton-bsi] Allowed doctypes are: #{TYPES.join(', ')}"
19
18
  # end
20
- @price_code = args.delete :price_code
21
- @cen_processing = args.delete :cen_processing
19
+ if args[:subdoctype] && !SUBDOCTYPES.include?(args[:subdoctype])
20
+ warn "[relaton-bsi] WARNING: invalid subdoctype: #{args[:subdoctype]}"
21
+ warn "[relaton-bsi] Allowed subdoctypes are: #{SUBDOCTYPES.join(', ')}"
22
+ end
22
23
  super
23
24
  end
24
25
 
@@ -28,7 +29,7 @@ module RelatonBsi
28
29
  # @option opts [String] :lang language
29
30
  # @return [String] XML
30
31
  def to_xml(**opts) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
31
- super **opts do |b|
32
+ super(**opts) do |b|
32
33
  if opts[:bibdata] && (has_ext_attrs? || price_code ||
33
34
  !cen_processing.nil?)
34
35
  b.ext do
@@ -38,8 +39,6 @@ module RelatonBsi
38
39
  ics.each { |i| i.to_xml b }
39
40
  structuredidentifier&.to_xml b
40
41
  b.stagename stagename if stagename
41
- b.send "price-code", price_code if price_code
42
- b.send "cen-processing", cen_processing unless cen_processing.nil?
43
42
  end
44
43
  end
45
44
  end
@@ -49,7 +48,7 @@ module RelatonBsi
49
48
  # @return [RelatonBsi::BsiBibliographicItem]
50
49
  def self.from_hash(hash)
51
50
  item_hash = ::RelatonBsi::HashConverter.hash_to_bib(hash)
52
- new **item_hash
51
+ new(**item_hash)
53
52
  end
54
53
  end
55
54
  end