slaw 0.6.8 → 0.6.9

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
  SHA1:
3
- metadata.gz: 8eeb58782b2816f1d5a79ff2ca9c58a01b31ae98
4
- data.tar.gz: 263785f7925b2f7634b32823e421748e75bc7c71
3
+ metadata.gz: c547c592602183d308cb921d933342705d3abfc5
4
+ data.tar.gz: 6c51e8eb899baa73562df3e6ce80f6d29ad7e048
5
5
  SHA512:
6
- metadata.gz: 6faaf2748a1b641f8e7f375d08ef070a36d1e3a1d1c25e3ecda4af0e18e5d7f488f831bf3859857f95c95725605c4d9127bfb7ff19c5e394dfde002dc309bd7a
7
- data.tar.gz: fd534bb5d9b6d8fee1d004c30c0657df1ca2ab6625a938c0a1ad6aad03c22bd399c9b2e3dbb53cddbd06be9a834990b18f050bc71a2393d16117d88cb44928d2
6
+ metadata.gz: b529abf4b1c3040c3217a02ea2abf5ac534f76cca5863b0c5d84049a835d5a835247d0b0768c75bf80aae9cefdca57409573f162cad4e78324a28c6f84646f01
7
+ data.tar.gz: 5405a71b050b492e998e01a6e29d8c7cf02d498912759207902b81114bbc76e3aae487d0de1112a23114e7c4aabf8f04d9c634be2ee326168e49237f75d72997
data/lib/slaw/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Slaw
2
- VERSION = "0.6.8"
2
+ VERSION = "0.6.9"
3
3
  end
@@ -117,7 +117,7 @@ module Slaw
117
117
  end
118
118
 
119
119
  rule schedule_statement
120
- space? (!schedule_heading) content eol
120
+ space? (!schedule_heading) clauses eol
121
121
  <ScheduleStatement>
122
122
  end
123
123
 
@@ -453,7 +453,7 @@ module Slaw
453
453
 
454
454
  class ScheduleStatement < Treetop::Runtime::SyntaxNode
455
455
  def to_xml(b, idprefix)
456
- b.p(content.text_value) if content
456
+ b.p { |b| clauses.to_xml(b, idprefix) } if clauses
457
457
  end
458
458
  end
459
459
  end
data/spec/za/act_spec.rb CHANGED
@@ -402,6 +402,55 @@ EOS
402
402
  </subsection>
403
403
  </section>'
404
404
  end
405
+
406
+ it 'should handle a remark in a schedule' do
407
+ node = parse :schedule, <<EOS
408
+ Schedule 1
409
+ A Title
410
+
411
+ [[Schedule 1 added by Act 23 of 2004]]
412
+
413
+ Some content
414
+ EOS
415
+ to_xml(node, "").should == '<doc name="schedule1">
416
+ <meta>
417
+ <identification source="#slaw">
418
+ <FRBRWork>
419
+ <FRBRthis value="/za/act/1980/01/schedule1"/>
420
+ <FRBRuri value="/za/act/1980/01"/>
421
+ <FRBRalias value="Schedule 1"/>
422
+ <FRBRdate date="1980-01-01" name="Generation"/>
423
+ <FRBRauthor href="#council" as="#author"/>
424
+ <FRBRcountry value="za"/>
425
+ </FRBRWork>
426
+ <FRBRExpression>
427
+ <FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
428
+ <FRBRuri value="/za/act/1980/01/eng@"/>
429
+ <FRBRdate date="1980-01-01" name="Generation"/>
430
+ <FRBRauthor href="#council" as="#author"/>
431
+ <FRBRlanguage language="eng"/>
432
+ </FRBRExpression>
433
+ <FRBRManifestation>
434
+ <FRBRthis value="/za/act/1980/01/eng@/schedule1"/>
435
+ <FRBRuri value="/za/act/1980/01/eng@"/>
436
+ <FRBRdate date="2015-05-20" name="Generation"/>
437
+ <FRBRauthor href="#slaw" as="#author"/>
438
+ </FRBRManifestation>
439
+ </identification>
440
+ </meta>
441
+ <mainBody>
442
+ <article id="schedule-1">
443
+ <heading>A Title</heading>
444
+ <content>
445
+ <p>
446
+ <remark status="editorial">[Schedule 1 added by Act 23 of 2004]</remark>
447
+ </p>
448
+ <p>Some content</p>
449
+ </content>
450
+ </article>
451
+ </mainBody>
452
+ </doc>'
453
+ end
405
454
  end
406
455
 
407
456
  #-------------------------------------------------------------------------------
@@ -534,9 +583,9 @@ EOS
534
583
 
535
584
  sched = node.schedules.elements[0]
536
585
  sched.schedule_heading.schedule_heading_prefix.text_value.should == "Schedule"
537
- sched.statements.elements[0].content.text_value.should == "Subject to approval in terms of this By-Law, the erection:"
538
- sched.statements.elements[1].content.text_value.should == "1. Foo"
539
- sched.statements.elements[2].content.text_value.should == "2. Bar"
586
+ sched.statements.elements[0].clauses.text_value.should == "Subject to approval in terms of this By-Law, the erection:"
587
+ sched.statements.elements[1].clauses.text_value.should == "1. Foo"
588
+ sched.statements.elements[2].clauses.text_value.should == "2. Bar"
540
589
  end
541
590
 
542
591
  it 'should handle many schedules' do
@@ -555,15 +604,15 @@ EOS
555
604
  sched.schedule_heading.schedule_heading_prefix.text_value.should == "Schedule"
556
605
  sched.schedule_heading.schedule_title.content.text_value.should == "A Title"
557
606
  sched.schedule_heading.num.text_value.should == "1"
558
- sched.statements.elements[0].content.text_value.should == "1. Foo"
559
- sched.statements.elements[1].content.text_value.should == "2. Bar"
607
+ sched.statements.elements[0].clauses.text_value.should == "1. Foo"
608
+ sched.statements.elements[1].clauses.text_value.should == "2. Bar"
560
609
 
561
610
  sched = node.schedules.elements[1]
562
611
  sched.schedule_heading.schedule_heading_prefix.text_value.should == "Schedule"
563
612
  sched.schedule_heading.schedule_title.content.text_value.should == "Another Title"
564
613
  sched.schedule_heading.num.text_value.should == "2"
565
- sched.statements.elements[0].content.text_value.should == "Baz"
566
- sched.statements.elements[1].content.text_value.should == "Boom"
614
+ sched.statements.elements[0].clauses.text_value.should == "Baz"
615
+ sched.statements.elements[1].clauses.text_value.should == "Boom"
567
616
  end
568
617
 
569
618
  it 'should serialise many schedules correctly' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slaw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8
4
+ version: 0.6.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Kempe