asciidoctor-rfc 0.8.5 → 0.9.0

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
- SHA1:
3
- metadata.gz: '0870e860045d4a8c9d597097567e671c1fa5a6c9'
4
- data.tar.gz: 7583fa0df0d6ba3c320d4eae8aadcd5e7abdd5bf
2
+ SHA256:
3
+ metadata.gz: 0a6bea3ae379ea8404bb2554c297ac8021f575dc09c5e11cb5ddb72802bed384
4
+ data.tar.gz: c530c5f75c72755c9b78240dff2117a098d15d695854cfbcc3d77fd77eb305af
5
5
  SHA512:
6
- metadata.gz: 6ed53a096a521ef2424673d95c71e96b4c8256b9863e4517d72201d4f5b669547e5b9b10a066dbf91f5f57dae76d7a7c173eea03f514ad6a74b223aa132ba744
7
- data.tar.gz: fe916106d9dba4a87c2bc88bcdbe0c2af403cc34873dce7e2c877d85cd228764f7fac4651bf9ebf77085853197b1bc05f24fea82b399e719ae435700be79028c
6
+ metadata.gz: 1aec907eef6a4f4ba30d58d182242217fa679348dba0e33b805efaca7f5a9fb95326a2b87c2a7a571b5548642bf0aba572f2972d012e01e421fa694af961cb10
7
+ data.tar.gz: e601d621850627bb9899477f1488f75fd37fbea898cbcd17b8be45f25446d2405b649a25dfc733d5c3bcff948801d9127dc9fb8ba699c9ad1c41d9a6080eb68c
@@ -2,3 +2,9 @@ require "asciidoctor" unless defined? Asciidoctor::Converter
2
2
  require_relative "asciidoctor/rfc/v2/converter"
3
3
  require_relative "asciidoctor/rfc/v3/converter"
4
4
  require_relative "asciidoctor/rfc/version"
5
+
6
+ if defined? Metanorma
7
+ require_relative "metanorma/rfc"
8
+ Metanorma::Registry.instance.register(Metanorma::Rfc::ProcessorV2)
9
+ Metanorma::Registry.instance.register(Metanorma::Rfc::ProcessorV3)
10
+ end
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module RFC
3
- VERSION = "0.8.5".freeze
3
+ VERSION = "0.9.0".freeze
4
4
  end
5
5
  end
@@ -0,0 +1,8 @@
1
+ require_relative "./rfc/processor_v2"
2
+ require_relative "./rfc/processor_v3"
3
+
4
+ module Metanorma
5
+ module Rfc
6
+
7
+ end
8
+ end
@@ -0,0 +1,38 @@
1
+ require "metanorma/processor"
2
+
3
+ module Metanorma
4
+ module Rfc
5
+ class ProcessorV2 < Metanorma::Processor
6
+
7
+ def initialize
8
+ @short = :rfc2
9
+ @input_format = :asciidoc
10
+ @asciidoctor_backend = :rfc2
11
+ end
12
+
13
+ def output_formats
14
+ {
15
+ xmlrfc: "v2.xml"
16
+ }
17
+ end
18
+
19
+ def input_to_isodoc(file)
20
+ Asciidoctor.convert(
21
+ file,
22
+ to_file: false,
23
+ safe: :safe,
24
+ backend: @asciidoctor_backend,
25
+ header_footer: true
26
+ )
27
+ end
28
+
29
+ def output(isodoc_node, outname, format, options={})
30
+ case format
31
+ when :xmlrfc
32
+ File.open(outname, 'w') { |file| file << isodoc_node }
33
+ end
34
+ end
35
+
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,38 @@
1
+ require "metanorma/processor"
2
+
3
+ module Metanorma
4
+ module Rfc
5
+ class ProcessorV3 < Metanorma::Processor
6
+
7
+ def initialize
8
+ @short = :rfc3
9
+ @input_format = :asciidoc
10
+ @asciidoctor_backend = :rfc3
11
+ end
12
+
13
+ def output_formats
14
+ {
15
+ xmlrfc: "v3.xml"
16
+ }
17
+ end
18
+
19
+ def input_to_isodoc(file)
20
+ Asciidoctor.convert(
21
+ file,
22
+ to_file: false,
23
+ safe: :safe,
24
+ backend: @asciidoctor_backend,
25
+ header_footer: true
26
+ )
27
+ end
28
+
29
+ def output(isodoc_node, outname, format, options={})
30
+ case format
31
+ when :xmlrfc
32
+ File.open(outname, 'w') { |file| file << isodoc_node }
33
+ end
34
+ end
35
+
36
+ end
37
+ end
38
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-rfc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-02 00:00:00.000000000 Z
11
+ date: 2018-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -283,6 +283,9 @@ files:
283
283
  - lib/asciidoctor/rfc/v3/validate.rb
284
284
  - lib/asciidoctor/rfc/v3/validate.rng
285
285
  - lib/asciidoctor/rfc/version.rb
286
+ - lib/metanorma/rfc.rb
287
+ - lib/metanorma/rfc/processor_v2.rb
288
+ - lib/metanorma/rfc/processor_v3.rb
286
289
  - rfc2629-other.ent
287
290
  - rfc2629-xhtml.ent
288
291
  - rfc2629.dtd
@@ -474,7 +477,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
474
477
  version: '0'
475
478
  requirements: []
476
479
  rubyforge_project:
477
- rubygems_version: 2.6.14
480
+ rubygems_version: 2.7.7
478
481
  signing_key:
479
482
  specification_version: 4
480
483
  summary: asciidoctor-rfc lets you write Internet-Drafts and RFCs in AsciiDoc.