slaw 9.2.0 → 10.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,7 +44,7 @@ describe Slaw::ActGenerator do
44
44
  |}
45
45
  EOS
46
46
 
47
- to_xml(node, "prefix.").should == '<table id="prefix.table0">
47
+ to_xml(node, "prefix__").should == '<table eId="prefix__table_1">
48
48
  <tr>
49
49
  <th>
50
50
  <p>r1c1</p>
@@ -78,7 +78,7 @@ EOS
78
78
  |}
79
79
  EOS
80
80
 
81
- to_xml(node, "prefix.").should == '<table id="prefix.table0">
81
+ to_xml(node, "prefix__").should == '<table eId="prefix__table_1">
82
82
  <tr>
83
83
  <th>
84
84
  <p/>
@@ -109,7 +109,7 @@ EOS
109
109
  |}
110
110
  EOS
111
111
 
112
- to_xml(node, "prefix.").should == '<table id="prefix.table0">
112
+ to_xml(node, "prefix__").should == '<table eId="prefix__table_1">
113
113
  <tr>
114
114
  <td colspan="2">
115
115
  <p>r1c1</p>
@@ -148,7 +148,7 @@ two
148
148
  |}
149
149
  EOS
150
150
 
151
- to_xml(node, "prefix.").should == '<table id="prefix.table0">
151
+ to_xml(node, "prefix__").should == '<table eId="prefix__table_1">
152
152
  <tr>
153
153
  <td>
154
154
  <p>foo<eol/>bar<eol/><eol/>baz</p>
@@ -173,7 +173,7 @@ EOS
173
173
  |}
174
174
  EOS
175
175
 
176
- to_xml(node, "prefix.").should == '<table id="prefix.table0">
176
+ to_xml(node, "prefix__").should == '<table eId="prefix__table_1">
177
177
  <tr>
178
178
  <th>
179
179
  <p>foo<eol/>three</p>
@@ -195,7 +195,7 @@ EOS
195
195
  |}
196
196
  EOS
197
197
 
198
- to_xml(node, "prefix.").should == '<table id="prefix.table0">
198
+ to_xml(node, "prefix__").should == '<table eId="prefix__table_1">
199
199
  <tr>
200
200
  <td>
201
201
  <p>cell</p>
@@ -223,13 +223,13 @@ Heres a table:
223
223
  EOS
224
224
 
225
225
  xml = to_xml(node)
226
- xml.should == '<section id="section-10">
226
+ xml.should == '<section eId="sec_10">
227
227
  <num>10.</num>
228
228
  <heading>A section title</heading>
229
- <paragraph id="section-10.paragraph0">
229
+ <hcontainer eId="sec_10__hcontainer_1" name="hcontainer">
230
230
  <content>
231
231
  <p>Heres a table:</p>
232
- <table id="section-10.paragraph0.table1">
232
+ <table eId="sec_10__hcontainer_1__table_1">
233
233
  <tr>
234
234
  <td>
235
235
  <p>r1c1</p>
@@ -248,7 +248,7 @@ EOS
248
248
  </tr>
249
249
  </table>
250
250
  </content>
251
- </paragraph>
251
+ </hcontainer>
252
252
  </section>'
253
253
  end
254
254
 
@@ -269,12 +269,13 @@ EOS
269
269
 
270
270
  xml = to_xml(node, "")
271
271
  today = Time.now.strftime('%Y-%m-%d')
272
- xml.should == '<component id="component-schedule1">
273
- <doc name="schedule1">
272
+ xml.should == '<attachment eId="att_1">
273
+ <heading>Schedule 1</heading>
274
+ <doc name="schedule">
274
275
  <meta>
275
276
  <identification source="#slaw">
276
277
  <FRBRWork>
277
- <FRBRthis value="/za/act/1980/01/schedule1"/>
278
+ <FRBRthis value="/za/act/1980/01/!schedule1"/>
278
279
  <FRBRuri value="/za/act/1980/01"/>
279
280
  <FRBRalias value="Schedule 1"/>
280
281
  <FRBRdate date="1980-01-01" name="Generation"/>
@@ -282,14 +283,14 @@ EOS
282
283
  <FRBRcountry value="za"/>
283
284
  </FRBRWork>
284
285
  <FRBRExpression>
285
- <FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
286
+ <FRBRthis value="/za/act/1980/01/eng@/!schedule1"/>
286
287
  <FRBRuri value="/za/act/1980/01/eng@"/>
287
288
  <FRBRdate date="1980-01-01" name="Generation"/>
288
289
  <FRBRauthor href="#council"/>
289
290
  <FRBRlanguage language="eng"/>
290
291
  </FRBRExpression>
291
292
  <FRBRManifestation>
292
- <FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
293
+ <FRBRthis value="/za/act/1980/01/eng@/!schedule1"/>
293
294
  <FRBRuri value="/za/act/1980/01/eng@"/>
294
295
  <FRBRdate date="' + today + '" name="Generation"/>
295
296
  <FRBRauthor href="#slaw"/>
@@ -297,35 +298,32 @@ EOS
297
298
  </identification>
298
299
  </meta>
299
300
  <mainBody>
300
- <hcontainer id="schedule1" name="schedule">
301
- <heading>Schedule 1</heading>
302
- <paragraph id="schedule1.paragraph0">
303
- <content>
304
- <p>Heres a table:</p>
305
- <table id="schedule1.paragraph0.table1">
306
- <tr>
307
- <td>
308
- <p>r1c1</p>
309
- </td>
310
- <td>
311
- <p>r1c2</p>
312
- </td>
313
- </tr>
314
- <tr>
315
- <td>
316
- <p>r2c1</p>
317
- </td>
318
- <td>
319
- <p>r2c2</p>
320
- </td>
321
- </tr>
322
- </table>
323
- </content>
324
- </paragraph>
301
+ <hcontainer eId="hcontainer_1" name="hcontainer">
302
+ <content>
303
+ <p>Heres a table:</p>
304
+ <table eId="hcontainer_1__table_1">
305
+ <tr>
306
+ <td>
307
+ <p>r1c1</p>
308
+ </td>
309
+ <td>
310
+ <p>r1c2</p>
311
+ </td>
312
+ </tr>
313
+ <tr>
314
+ <td>
315
+ <p>r2c1</p>
316
+ </td>
317
+ <td>
318
+ <p>r2c2</p>
319
+ </td>
320
+ </tr>
321
+ </table>
322
+ </content>
325
323
  </hcontainer>
326
324
  </mainBody>
327
325
  </doc>
328
- </component>'
326
+ </attachment>'
329
327
  end
330
328
 
331
329
  it 'should ignore an escaped table' do
@@ -336,14 +334,14 @@ EOS
336
334
  |}
337
335
  EOS
338
336
 
339
- to_xml(node).should == '<paragraph id="paragraph0">
337
+ to_xml(node).should == '<hcontainer eId="hcontainer_1" name="hcontainer">
340
338
  <content>
341
339
  <p>{|</p>
342
340
  <p>| r1c1</p>
343
341
  <p>| r1c2</p>
344
342
  <p>|}</p>
345
343
  </content>
346
- </paragraph>'
344
+ </hcontainer>'
347
345
  end
348
346
 
349
347
  it 'should allow a table as part of a subsection' do
@@ -353,10 +351,10 @@ EOS
353
351
  |}
354
352
  EOS
355
353
 
356
- to_xml(node, '', 0).should == '<subsection id="1">
354
+ to_xml(node, '', 0).should == '<subsection eId="subsec_1">
357
355
  <num>(1)</num>
358
356
  <content>
359
- <table id="1.table0">
357
+ <table eId="subsec_1__table_1">
360
358
  <tr>
361
359
  <td>
362
360
  <p>foo</p>
@@ -376,7 +374,7 @@ EOS
376
374
  |}
377
375
  EOS
378
376
 
379
- to_xml(node, '', 0).should == '<table id="table0">
377
+ to_xml(node, '', 0).should == '<table eId="table_1">
380
378
  <tr>
381
379
  <td>
382
380
  <p>a <ref href="/a/b">link</ref> in a table</p>
@@ -396,7 +394,7 @@ EOS
396
394
  |}
397
395
  EOS
398
396
 
399
- to_xml(node, '', 0).should == '<table id="table0">
397
+ to_xml(node, '', 0).should == '<table eId="table_1">
400
398
  <tr>
401
399
  <td>
402
400
  <p>a &gt; b</p>
@@ -12,7 +12,7 @@ describe Slaw::Grammars::ZA::Postprocess do
12
12
  context 'schedule_aliases' do
13
13
  it 'should include all text in schedule aliases' do
14
14
  xml = '
15
- <akomaNtoso xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.akomantoso.org/2.0" xsi:schemaLocation="http://www.akomantoso.org/2.0 akomantoso20.xsd">
15
+ <akomaNtoso xmlns="http://docs.oasis-open.org/legaldocml/ns/akn/3.0">
16
16
  <components>
17
17
  <component id="component-firstschedule">
18
18
  <doc name="firstschedule">
@@ -64,7 +64,7 @@ describe Slaw::Grammars::ZA::Postprocess do
64
64
 
65
65
  it 'should have a decent alias when there is an empty heading' do
66
66
  xml = '
67
- <akomaNtoso xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.akomantoso.org/2.0" xsi:schemaLocation="http://www.akomantoso.org/2.0 akomantoso20.xsd">
67
+ <akomaNtoso xmlns="http://docs.oasis-open.org/legaldocml/ns/akn/3.0">
68
68
  <components>
69
69
  <component id="component-firstschedule">
70
70
  <doc name="firstschedule">
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slaw
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.2.0
4
+ version: 10.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Kempe
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-10 00:00:00.000000000 Z
11
+ date: 2021-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -94,20 +94,6 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0.20'
97
- - !ruby/object:Gem::Dependency
98
- name: mimemagic
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '0.2'
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '0.2'
111
97
  description: Slaw is a lightweight library for rendering and generating Akoma Ntoso
112
98
  acts from plain text and PDF documents.
113
99
  email:
@@ -150,10 +136,12 @@ files:
150
136
  - lib/slaw/parse/error.rb
151
137
  - lib/slaw/parse/grammar_helpers.rb
152
138
  - lib/slaw/schemas/akomantoso20.xsd
139
+ - lib/slaw/schemas/akomantoso30.xsd
153
140
  - lib/slaw/schemas/xml.xsd
154
141
  - lib/slaw/version.rb
155
142
  - lib/slaw/xml_support.rb
156
143
  - slaw.gemspec
144
+ - spec/counters_spec.rb
157
145
  - spec/extract/extractor_spec.rb
158
146
  - spec/fixtures/community-fire-safety.xml
159
147
  - spec/generator_spec.rb
@@ -171,7 +159,7 @@ homepage: https://github.com/longhotsummer/slaw
171
159
  licenses:
172
160
  - MIT
173
161
  metadata: {}
174
- post_install_message:
162
+ post_install_message:
175
163
  rdoc_options: []
176
164
  require_paths:
177
165
  - lib
@@ -187,10 +175,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
175
  version: '0'
188
176
  requirements: []
189
177
  rubygems_version: 3.0.3
190
- signing_key:
178
+ signing_key:
191
179
  specification_version: 4
192
180
  summary: A lightweight library for using Akoma Ntoso acts in Ruby.
193
181
  test_files:
182
+ - spec/counters_spec.rb
194
183
  - spec/extract/extractor_spec.rb
195
184
  - spec/fixtures/community-fire-safety.xml
196
185
  - spec/generator_spec.rb