metanorma-standoc 1.2.0 → 1.2.1

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: 30d5bcdf81251b8337ccbc89b87c995e53f2899277d814e6668f20c88b4cfd2e
4
- data.tar.gz: 85b27e1f408c227f92aa9912e8937867583e25dfaec0fb05b7d644dff19fd514
3
+ metadata.gz: 7a90c6f9dab7e41ec8a716b6dcb956b3c5066e6af6c24c4c99f6f9e7242cd490
4
+ data.tar.gz: 3d91ef4648f885f90e301bdc30989e9f89f4e3a07a856fd91cb90b0adbf81c1c
5
5
  SHA512:
6
- metadata.gz: 51cd7259dad7810f4496001fe1013ba6e88bb0cbc033babbba19ce545c3b9210abc7fb169aefc26c850db72493e5016316c6b60fa7f712c04872ff7a0b48bfad
7
- data.tar.gz: 21c1588e83613777b5e25eb412eaf0d4cdaf82b927bdb4f824751af139585c4416a40779fe243505d180ea3db97c2647f393c4d73be09b06b540adba175d8e43
6
+ metadata.gz: d1bfa8ed19b0ec0aaa93739d240e32f1ec312a2cf13a1ba9f4c715b056541519a75765ae794abe1bc54d0cdc89275c8b5652ba69de4c83090c709b24206f59a6
7
+ data.tar.gz: 999e69d048bf5b83a265153d5e08d7bfa9f23a44d08640d309cdca172a5921544d0e1fd5f1cb746a115230134ffe789725eb8ece23026309ad02f797efc1c3fc
data/.travis.yml CHANGED
@@ -6,7 +6,6 @@ os:
6
6
  rvm:
7
7
  - 2.5
8
8
  - 2.4
9
- - 2.3
10
9
  - ruby-head
11
10
  before_install:
12
11
  - gem install bundler -v 2.0.1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- metanorma-standoc (1.2.0)
4
+ metanorma-standoc (1.2.1)
5
5
  asciidoctor (~> 1.5.7)
6
6
  concurrent-ruby
7
7
  html2doc (~> 0.8.11)
@@ -52,7 +52,7 @@ GEM
52
52
  guard-compat (~> 1.1)
53
53
  rspec (>= 2.99.0, < 4.0)
54
54
  hashdiff (0.4.0)
55
- html2doc (0.8.11)
55
+ html2doc (0.8.12)
56
56
  asciimath (~> 1.0.7)
57
57
  htmlentities (~> 4.3.4)
58
58
  image_size
@@ -65,7 +65,7 @@ GEM
65
65
  iev (0.2.2)
66
66
  nokogiri
67
67
  image_size (2.0.1)
68
- isodoc (0.10.0)
68
+ isodoc (0.10.1)
69
69
  asciimath
70
70
  html2doc (~> 0.8.11)
71
71
  htmlentities (~> 4.3.4)
@@ -113,7 +113,7 @@ GEM
113
113
  rb-fsevent (0.10.3)
114
114
  rb-inotify (0.10.0)
115
115
  ffi (~> 1.0)
116
- relaton (0.4.0)
116
+ relaton (0.4.1)
117
117
  algoliasearch
118
118
  relaton-gb (~> 0.5.0)
119
119
  relaton-iec (~> 0.3.0)
@@ -122,35 +122,36 @@ GEM
122
122
  relaton-iso-bib (~> 0.2.0)
123
123
  relaton-itu (~> 0.2.0)
124
124
  relaton-nist (~> 0.2.0)
125
- relaton-bib (0.2.1)
125
+ relaton-bib (0.2.3)
126
126
  addressable
127
127
  nokogiri (~> 1.8.4)
128
- relaton-cli (0.2.0)
128
+ relaton-cli (0.2.1)
129
129
  liquid
130
130
  relaton (~> 0.4)
131
131
  thor
132
- relaton-gb (0.5.0)
132
+ relaton-gb (0.5.1)
133
133
  cnccs (~> 0.1.1)
134
134
  gb-agencies (~> 0.0.1)
135
135
  relaton-iso-bib (~> 0.2.0)
136
- relaton-iec (0.3.0)
136
+ relaton-iec (0.3.1)
137
137
  addressable
138
138
  relaton-iso-bib (~> 0.2.0)
139
- relaton-ietf (0.5.0)
139
+ relaton-ietf (0.5.3)
140
140
  relaton-iso-bib (~> 0.2.0)
141
- relaton-iso (0.5.0)
141
+ relaton-iso (0.5.1)
142
142
  algoliasearch
143
143
  relaton-iec (~> 0.3.0)
144
144
  relaton-iso-bib (~> 0.2.0)
145
- relaton-iso-bib (0.2.1)
145
+ relaton-iso-bib (0.2.3)
146
146
  isoics (~> 0.1.6)
147
147
  nokogiri (~> 1.8.4)
148
148
  relaton-bib (~> 0.2.0)
149
149
  ruby_deep_clone (~> 0.8.0)
150
- relaton-itu (0.2.0)
150
+ relaton-itu (0.2.1)
151
151
  relaton-iso-bib (~> 0.2.0)
152
- relaton-nist (0.2.0)
152
+ relaton-nist (0.2.2)
153
153
  relaton-bib (~> 0.2.0)
154
+ rubyzip
154
155
  roman-numerals (0.3.0)
155
156
  rspec (3.8.0)
156
157
  rspec-core (~> 3.8.0)
@@ -177,6 +178,7 @@ GEM
177
178
  ruby-progressbar (1.10.1)
178
179
  ruby_deep_clone (0.8.0)
179
180
  ruby_dep (1.5.0)
181
+ rubyzip (1.2.3)
180
182
  safe_yaml (1.0.5)
181
183
  sassc (2.0.1)
182
184
  ffi (~> 1.9)
data/appveyor.yml CHANGED
@@ -4,7 +4,6 @@ environment:
4
4
  matrix:
5
5
  - RUBY_VERSION: 25
6
6
  - RUBY_VERSION: 24
7
- - RUBY_VERSION: 23
8
7
  - RUBY_VERSION: _trunk
9
8
 
10
9
  matrix:
@@ -93,8 +93,7 @@ module Asciidoctor
93
93
  @files_to_delete = []
94
94
  @filename = node.attr("docfile") ?
95
95
  node.attr("docfile").gsub(/\.adoc$/, "").gsub(%r{^.*/}, "") : ""
96
- @localdir = %r{/}.match(node.attr("docfile")) ?
97
- node.attr("docfile").sub(%r{/[^/]+$}, "/") : "./"
96
+ @localdir = Utils::localdir(node)
98
97
  @no_isobib_cache = node.attr("no-isobib-cache")
99
98
  @no_isobib = node.attr("no-isobib")
100
99
  @bibdb = nil
@@ -82,14 +82,15 @@ module Asciidoctor
82
82
  end
83
83
 
84
84
  def self.generate_file parent, reader
85
+ localdir = Utils::localdir(parent.document)
85
86
  src = reader.source
86
87
  !reader.lines.first.sub(/\s+$/, "").match /^@startuml($| )/ or
87
88
  src = "@startuml\n#{src}\n@enduml\n"
88
89
  /^@startuml (?<filename>[^\n]+)\n/ =~ src
89
90
  filename ||= parent.document.reader.lineno
90
- FileUtils.mkdir_p "plantuml"
91
- File.open("plantuml/#{filename}.pml", "w") { |f| f.write src }
92
- system "plantuml plantuml/#{filename}.pml"
91
+ FileUtils.mkdir_p "#{localdir}/plantuml"
92
+ File.open("#{localdir}plantuml/#{filename}.pml", "w") { |f| f.write src }
93
+ system "plantuml #{localdir}plantuml/#{filename}.pml"
93
94
  filename
94
95
  end
95
96
 
@@ -17,6 +17,11 @@ module Asciidoctor
17
17
  node.nil? || node.id.nil? || node.id.empty? ? "_" + uuid : node.id
18
18
  end
19
19
 
20
+ def localdir(node)
21
+ %r{/}.match(node.attr("docfile")) ?
22
+ node.attr("docfile").sub(%r{/[^/]+$}, "/") : "./"
23
+ end
24
+
20
25
  def current_location(n)
21
26
  return "Line #{n.lineno}" if n.respond_to?(:lineno) &&
22
27
  !n.lineno.nil? && !n.lineno.empty?
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Standoc
3
- VERSION = "1.2.0".freeze
3
+ VERSION = "1.2.1".freeze
4
4
  end
5
5
  end
@@ -147,11 +147,6 @@ EOS
147
147
  <formattedref format="text/plain">ISO 123:1985</formattedref>
148
148
  </bibitem>
149
149
  </relation>
150
- <relation type="updates">
151
- <bibitem type="standard">
152
- <formattedref format="text/plain">ISO 123:2001</formattedref>
153
- </bibitem>
154
- </relation>
155
150
  <relation type="instance">
156
151
  <bibitem type="standard">
157
152
  <fetched>#{Date.today}</fetched>
@@ -197,11 +192,6 @@ EOS
197
192
  <formattedref format="text/plain">ISO 123:1985</formattedref>
198
193
  </bibitem>
199
194
  </relation>
200
- <relation type="updates">
201
- <bibitem type="standard">
202
- <formattedref format="text/plain">ISO 123:2001</formattedref>
203
- </bibitem>
204
- </relation>
205
195
  </bibitem>
206
196
  </relation>
207
197
  <ext>
@@ -265,11 +255,6 @@ EOS
265
255
  <formattedref format="text/plain">ISO 123:1985</formattedref>
266
256
  </bibitem>
267
257
  </relation>
268
- <relation type="updates">
269
- <bibitem type="standard">
270
- <formattedref format="text/plain">ISO 123:2001</formattedref>
271
- </bibitem>
272
- </relation>
273
258
  <ext>
274
259
  <doctype>international-standard</doctype>
275
260
  <editorialgroup>
@@ -541,12 +526,15 @@ EOS
541
526
  it "fetches uncached references" do
542
527
  FileUtils.mv File.expand_path("~/.relaton/cache"), File.expand_path("~/.relaton-bib.pstore1"), force: true
543
528
  db = Relaton::Db.new "#{Dir.home}/.relaton/cache", nil
544
- db.save_entry("ISO(ISO 123:2001)",
545
- {
546
- "fetched" => Date.today.to_s,
547
- "bib" => RelatonIsoBib::XMLParser.from_xml(ISO_123_DATED)
548
- }
549
- )
529
+ bibitem = RelatonIsoBib::XMLParser.from_xml ISO_123_DATED
530
+ bibitem.instance_variable_set :@fetched, (Date.today - 2)
531
+
532
+ db.save_entry("ISO(ISO 123:2001)", bibitem.to_xml)
533
+ #{
534
+ #"fetched" => (Date.today - 2).to_s,
535
+ #"bib" => RelatonIsoBib::XMLParser.from_xml(ISO_123_DATED)
536
+ #}
537
+ #)
550
538
 
551
539
  # mock_isobib_get_124
552
540
  VCR.use_cassette "isobib_get_124" do
@@ -562,8 +550,8 @@ EOS
562
550
 
563
551
  entry = db.load_entry("ISO(ISO 123:2001)")
564
552
  #expect(db.fetched("ISO(ISO 123:2001)")).to eq(Date.today.to_s)
565
- expect(entry).to include("<fetched>#{Date.today.to_s}</fetched>")
566
- expect(entry).to be_equivalent_to(ISO_123_DATED)
553
+ expect(entry).to include("<fetched>#{(Date.today - 2).to_s}</fetched>")
554
+ #expect(entry).to be_equivalent_to(ISO_123_DATED)
567
555
  entry = db.load_entry("ISO(ISO 124:2014)")
568
556
  #expect(db.fetched("ISO(ISO 124:2014)")).to eq(Date.today.to_s)
569
557
  expect(entry).to include("<fetched>#{Date.today.to_s}</fetched>")
@@ -578,12 +566,14 @@ EOS
578
566
  FileUtils.mv File.expand_path("~/.relaton/cache"), File.expand_path("~/.relaton-bib.pstore1"), force: true
579
567
 
580
568
  db = Relaton::Db.new "#{Dir.home}/.relaton/cache", nil
581
- db.save_entry("ISO 123",
582
- {
583
- "fetched" => (Date.today - 90),
584
- "bib" => RelatonIsoBib::XMLParser.from_xml(ISO_123_SHORT)
585
- }
586
- )
569
+ bibitem = RelatonIsoBib::XMLParser.from_xml ISO_123_SHORT
570
+ bibitem.instance_variable_set :@fetched, (Date.today - 90)
571
+ db.save_entry("ISO 123", bibitem.to_xml)
572
+ #{
573
+ #"fetched" => (Date.today - 90),
574
+ #"bib" => RelatonIsoBib::XMLParser.from_xml(ISO_123_SHORT)
575
+ #}
576
+ #)
587
577
 
588
578
  # mock_isobib_get_123_undated
589
579
  VCR.use_cassette "isobib_get_123" do
@@ -79,7 +79,7 @@ RSpec.describe Asciidoctor::Standoc do
79
79
 
80
80
  </sections><bibliography><references id="_" obligation="informative"><title>Normative References</title>
81
81
  <bibitem id="iso123" type="standard">
82
- <fetched>2019-06-16</fetched>
82
+ <fetched>#{Date.today}</fetched>
83
83
  <title type="title-main" format="text/plain" language="en" script="Latn">Sampling</title>
84
84
  <title type="title-intro" format="text/plain" language="en" script="Latn">Rubber latex</title>
85
85
  <title type="main" format="text/plain" language="en" script="Latn">Sampling - Rubber latex</title>
@@ -121,7 +121,7 @@ RSpec.describe Asciidoctor::Standoc do
121
121
  </relation>
122
122
  <relation type="instance">
123
123
  <bibitem type="standard">
124
- <fetched>2019-06-16</fetched>
124
+ <fetched>#{Date.today}</fetched>
125
125
  <title type="title-main" format="text/plain" language="en" script="Latn">Sampling</title>
126
126
  <title type="title-intro" format="text/plain" language="en" script="Latn">Rubber latex</title>
127
127
  <title type="main" format="text/plain" language="en" script="Latn">Sampling - Rubber latex</title>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-standoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-15 00:00:00.000000000 Z
11
+ date: 2019-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor