slaw 0.6.10 → 0.6.11

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: 509885e0ab8866ac5793804d77249885c141b2dc
4
- data.tar.gz: 20f4d702127bbe215f4710e25587c10f2e07b73e
3
+ metadata.gz: 32f937272e68d3b5ebb089d674c5b1bc922c8701
4
+ data.tar.gz: 1db5a51f4e907f62a24d1161431307cc08532fcb
5
5
  SHA512:
6
- metadata.gz: cca31525dc5bed1c19ff6be61b5a167b6debfe42b59f196c55624d9b4e333f86480b6a8ff0100a43e7ac8086489d4352a7d27ef0bc1745cdc9b9c18b17343216
7
- data.tar.gz: 4a8af41380e9a45d3785844347e17fae18de1669ce41ada5989dff2d807dcaefbaeda7f89a0d1b15b8d6aeaf9d98ff2cea2e61799dd45867094a5ed3fceeb31b
6
+ metadata.gz: 3f8efd5235fc15f73ff3541740162239eaa836d929254761fa0a1c18172f99a50903e2ee2893bd6a1bdf5b860bf1a5882e039964489d456bfe0e890dfe9bad30
7
+ data.tar.gz: f1df7fcc8ae78241881576a4faf0d8032f995fa6a23b0267fc7c2364788b8bd9845079d9ba91b818c2e649d1c80b50856e469868f5e6b3d66fe8f22d89302851
data/lib/slaw/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Slaw
2
- VERSION = "0.6.10"
2
+ VERSION = "0.6.11"
3
3
  end
@@ -59,11 +59,11 @@ module Slaw
59
59
  end
60
60
 
61
61
  def write_preface(b)
62
- preface.to_xml(b)
62
+ preface.to_xml(b) if preface.respond_to? :to_xml
63
63
  end
64
64
 
65
65
  def write_preamble(b)
66
- preamble.to_xml(b)
66
+ preamble.to_xml(b) if preamble.respond_to? :to_xml
67
67
  end
68
68
 
69
69
  def write_body(b)
data/spec/za/act_spec.rb CHANGED
@@ -486,6 +486,66 @@ bar
486
486
  (2) more stuff
487
487
  baz
488
488
  "
489
+ to_xml(node.preface).should == '<preface>
490
+ <p>foo</p>
491
+ <p>bar</p>
492
+ <p>(1) stuff</p>
493
+ <p>(2) more stuff</p>
494
+ <p>baz</p>
495
+ </preface>'
496
+
497
+ today = Time.now.strftime('%Y-%m-%d')
498
+ to_xml(node, "").should == '<act contains="originalVersion">
499
+ <meta>
500
+ <identification source="#slaw">
501
+ <FRBRWork>
502
+ <FRBRthis value="/za/act/1980/01/main"/>
503
+ <FRBRuri value="/za/act/1980/01"/>
504
+ <FRBRalias value="Short Title"/>
505
+ <FRBRdate date="1980-01-01" name="Generation"/>
506
+ <FRBRauthor href="#council" as="#author"/>
507
+ <FRBRcountry value="za"/>
508
+ </FRBRWork>
509
+ <FRBRExpression>
510
+ <FRBRthis value="/za/act/1980/01/eng@/main"/>
511
+ <FRBRuri value="/za/act/1980/01/eng@"/>
512
+ <FRBRdate date="1980-01-01" name="Generation"/>
513
+ <FRBRauthor href="#council" as="#author"/>
514
+ <FRBRlanguage language="eng"/>
515
+ </FRBRExpression>
516
+ <FRBRManifestation>
517
+ <FRBRthis value="/za/act/1980/01/eng@/main"/>
518
+ <FRBRuri value="/za/act/1980/01/eng@"/>
519
+ <FRBRdate date="' + today + '" name="Generation"/>
520
+ <FRBRauthor href="#slaw" as="#author"/>
521
+ </FRBRManifestation>
522
+ </identification>
523
+ <references source="#this">
524
+ <TLCOrganization id="slaw" href="https://github.com/longhotsummer/slaw" showAs="Slaw"/>
525
+ <TLCOrganization id="council" href="/ontology/organization/za/council" showAs="Council"/>
526
+ <TLCRole id="author" href="/ontology/role/author" showAs="Author"/>
527
+ </references>
528
+ </meta>
529
+ <preface>
530
+ <p>foo</p>
531
+ <p>bar</p>
532
+ <p>(1) stuff</p>
533
+ <p>(2) more stuff</p>
534
+ <p>baz</p>
535
+ </preface>
536
+ <body>
537
+ <section id="section-1">
538
+ <num>1.</num>
539
+ <heading>Section</heading>
540
+ <subsection id="section-1.1">
541
+ <num>(1)</num>
542
+ <content>
543
+ <p>hello</p>
544
+ </content>
545
+ </subsection>
546
+ </section>
547
+ </body>
548
+ </act>'
489
549
  end
490
550
 
491
551
  it 'should support an optional preface' do
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: 0.6.10
4
+ version: 0.6.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Kempe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-25 00:00:00.000000000 Z
11
+ date: 2015-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler