metanorma 0.3.3 → 0.3.4

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: 81a9d0206754ec2f1d456dc7812e54b05b5f74055025e723ba003af362d78380
4
- data.tar.gz: 3b306cb4f28c937b46ebb2308f7fcf546c89493ee9eff2aad29140b6a5c3e583
3
+ metadata.gz: 719e0a648d4b04e1bef5f855cde357b517551d50b3a8a0abca2f8f2c340c253c
4
+ data.tar.gz: 3cd70ccdd980e869bc130b2ca88d524741624ab926e37988634e5c97674054bf
5
5
  SHA512:
6
- metadata.gz: c173af8b2eff9547b2c7d17a54426f89dee53a030e717866f40ab5c5b2cf35092988a65a1df7681636897d2d07e5291ec7717a8d72bd4b4b2daac796970767b6
7
- data.tar.gz: b71ac8b84f2de84828530e89d9df566ed0e2bc111b9254de3fb223b65573e495ae0f814d247fa17083d8861de4105b5cc2ce05c4b7b1ff0d57433131fc509ca5
6
+ metadata.gz: 6fea024ec085822b3637df3cab6abae988c32988c783af52281ce4da1592104d6bebc6ec8f39940fd4c916e6ca295b03133cee8f2abbeec7561bf3de54c325b8
7
+ data.tar.gz: a4b52af8af72a734f36dd5d95d24ce4765f12c6fbdd577a787229ed9701e7b0a116a31f102d5e7851b03af537ae237e7fe16b56bb1aa179ca9f13b0501ad890d
data/Gemfile.lock CHANGED
@@ -1,11 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- metanorma (0.3.3)
4
+ metanorma (0.3.4)
5
+ asciidoctor
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
8
9
  specs:
10
+ asciidoctor (1.5.8)
9
11
  byebug (10.0.2)
10
12
  diff-lcs (1.3)
11
13
  equivalent-xml (0.6.0)
data/lib/metanorma.rb CHANGED
@@ -1,8 +1,10 @@
1
1
  require "metanorma/version"
2
+ require "asciidoctor"
2
3
  require "metanorma/input"
3
4
  require "metanorma/output"
4
5
  require "metanorma/registry"
5
6
  require "metanorma/processor"
7
+ require "metanorma/asciidoctor_extensions"
6
8
 
7
9
  module Metanorma
8
10
 
@@ -0,0 +1 @@
1
+ require_relative "asciidoctor_extensions/glob_include_processor"
@@ -0,0 +1,22 @@
1
+ module Metanorma::AsciidoctorExtensions
2
+
3
+ class GlobIncludeProcessor < ::Asciidoctor::Extensions::IncludeProcessor
4
+ def process doc, reader, target_glob, attributes
5
+ Dir[File.join reader.dir, target_glob].sort.reverse_each do |target|
6
+ content = IO.readlines target
7
+ content.unshift '' unless attributes['adjoin-option']
8
+ reader.push_include content, target, target, 1, attributes
9
+ end
10
+ reader
11
+ end
12
+
13
+ def handles? target
14
+ target.include? '*'
15
+ end
16
+ end
17
+
18
+ end
19
+
20
+ Asciidoctor::Extensions.register do
21
+ include_processor ::Metanorma::AsciidoctorExtensions::GlobIncludeProcessor
22
+ end
@@ -1,11 +1,11 @@
1
-
2
1
  module Metanorma
3
2
  module Input
4
3
 
5
4
  class Asciidoc < Base
6
5
 
7
6
  def process(file, filename, type)
8
- Asciidoctor.convert(
7
+ require "asciidoctor"
8
+ ::Asciidoctor.convert(
9
9
  file,
10
10
  to_file: false,
11
11
  safe: :safe,
@@ -1,3 +1,3 @@
1
1
  module Metanorma
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
data/metanorma.gemspec CHANGED
@@ -24,6 +24,8 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.required_ruby_version = '>= 2.3.0'
26
26
 
27
+ spec.add_runtime_dependency 'asciidoctor'
28
+
27
29
  spec.add_development_dependency "bundler", "~> 1.16"
28
30
  spec.add_development_dependency "rake", "~> 10.0"
29
31
  spec.add_development_dependency "rspec", "~> 3.0"
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
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-12-05 00:00:00.000000000 Z
11
+ date: 2018-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: asciidoctor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +136,8 @@ files:
122
136
  - bin/rasterize.js
123
137
  - bin/setup
124
138
  - lib/metanorma.rb
139
+ - lib/metanorma/asciidoctor_extensions.rb
140
+ - lib/metanorma/asciidoctor_extensions/glob_include_processor.rb
125
141
  - lib/metanorma/document.rb
126
142
  - lib/metanorma/input.rb
127
143
  - lib/metanorma/input/asciidoc.rb