metanorma 0.3.18 → 1.0.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
2
  SHA256:
3
- metadata.gz: e21da3c608de6a3e0c7ee58193b6da323e99ac3d71c1ff55b26dc5c15e8e176c
4
- data.tar.gz: 953981d803ee6b4a29af3ebae91641205d7af697b268ac9c9605b4e996b425fb
3
+ metadata.gz: 1d0a42d18ad2b95b3d714ad8564f52946bfc3f7aea5d92c0811145aaa73dbe02
4
+ data.tar.gz: 5f2eadd66a58d2d26a0ff281a67438030a41eb0a5bc0b6fe3c80f6731703b93f
5
5
  SHA512:
6
- metadata.gz: 2ee31399c24eadc600bdb96a12143d1d007252b628c0f22baf8efac30b0a53ae07235c61a8198dec773d6b851381c87b06fc146377ca5a3babbf8417c91f5174
7
- data.tar.gz: 007b54fefb79aeec05bcb455bf0d9f3578baa5c652d3a8cba380a0371d5f01b5e0f1a78475ff7b7627304e3f4af40d086ae529dff51a41392c46836d0953a787
6
+ metadata.gz: 6aee169581e757063339606669a64c7027e98fd6f817d9944f23b66dde5dba28050e1985cf8c98331be2a4438fe6f7bb7573a9ffa53bf526db2292817c64cc30
7
+ data.tar.gz: dd1bfa19872fea3ca3d61f462998f00d961de3dfc4f22f9893263f88a5dd18dbcb13518696c9514e200d8eac759bdcb461dcda637e0187b364208a0cca1124cd
@@ -0,0 +1,2 @@
1
+ ORGANISATION=metanorma
2
+ DEPENDENT_REPOS=metanorma-docker
@@ -2,13 +2,18 @@
2
2
  # use ci-master https://github.com/metanorma/metanorma-build-scripts
3
3
  name: macos
4
4
 
5
- on: [push]
5
+ on:
6
+ push:
7
+ branches: [ master ]
8
+ pull_request:
9
+ branches: [ '**' ]
6
10
 
7
11
  jobs:
8
12
  test-macos:
9
13
  name: Test on Ruby ${{ matrix.ruby }} macOS
10
14
  runs-on: macos-latest
11
15
  strategy:
16
+ fail-fast: false
12
17
  matrix:
13
18
  ruby: [ '2.6', '2.5', '2.4' ]
14
19
  steps:
@@ -20,7 +25,7 @@ jobs:
20
25
  architecture: 'x64'
21
26
  - name: Update gems
22
27
  run: |
23
- sudo gem install bundler -v "~> 2" --force
28
+ sudo gem install bundler --force
24
29
  bundle install --jobs 4 --retry 3
25
30
  - name: Use Node
26
31
  uses: actions/setup-node@v1
@@ -2,13 +2,17 @@
2
2
  # use ci-master https://github.com/metanorma/metanorma-build-scripts
3
3
  name: ubuntu
4
4
 
5
- on: [push]
5
+ on:
6
+ push:
7
+ branches: [ master ]
8
+ pull_request:
6
9
 
7
10
  jobs:
8
11
  test-linux:
9
12
  name: Test on Ruby ${{ matrix.ruby }} Ubuntu
10
13
  runs-on: ubuntu-latest
11
14
  strategy:
15
+ fail-fast: false
12
16
  matrix:
13
17
  ruby: [ '2.6', '2.5', '2.4' ]
14
18
  steps:
@@ -20,7 +24,7 @@ jobs:
20
24
  architecture: 'x64'
21
25
  - name: Update gems
22
26
  run: |
23
- gem install bundler -v "~> 2"
27
+ gem install bundler
24
28
  bundle install --jobs 4 --retry 3
25
29
  - name: Use Node
26
30
  uses: actions/setup-node@v1
@@ -32,3 +36,15 @@ jobs:
32
36
  - name: Run specs
33
37
  run: |
34
38
  bundle exec rake
39
+ - name: Trigger dependent repositories
40
+ if: github.ref == 'refs/heads/master'
41
+ env:
42
+ GH_USERNAME: ${{ secrets.PAT_USERNAME }}
43
+ GH_ACCESS_TOKEN: ${{ secrets.PAT_TOKEN }}
44
+ run: |
45
+ curl -LO --retry 3 https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/trigger-gh-actions.sh
46
+ source .github/workflows/dependent_repos.env
47
+ for repo in $DEPENDENT_REPOS
48
+ do
49
+ sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY
50
+ done
@@ -2,13 +2,18 @@
2
2
  # use ci-master https://github.com/metanorma/metanorma-build-scripts
3
3
  name: windows
4
4
 
5
- on: [push]
5
+ on:
6
+ push:
7
+ branches: [ master ]
8
+ pull_request:
9
+ branches: [ '**' ]
6
10
 
7
11
  jobs:
8
12
  test-windows:
9
13
  name: Test on Ruby ${{ matrix.ruby }} Windows
10
14
  runs-on: windows-latest
11
15
  strategy:
16
+ fail-fast: false
12
17
  matrix:
13
18
  ruby: [ '2.6', '2.5', '2.4' ]
14
19
  steps:
@@ -21,7 +26,7 @@ jobs:
21
26
  - name: Update gems
22
27
  shell: pwsh
23
28
  run: |
24
- gem install bundler -v "~> 2"
29
+ gem install bundler
25
30
  bundle config --local path vendor/bundle
26
31
  bundle update
27
32
  bundle install --jobs 4 --retry 3
@@ -28,8 +28,19 @@ module Metanorma
28
28
  end
29
29
  end
30
30
 
31
+ def xml_options_extract(file)
32
+ xml = Nokogiri::XML(file)
33
+ if xml.root
34
+ @registry.root_tags.each do |k, v|
35
+ return { type: k } if v == xml.root.name
36
+ end
37
+ end
38
+ {}
39
+ end
40
+
31
41
  def options_extract(filename, options)
32
42
  o = Metanorma::Input::Asciidoc.new.extract_metanorma_options(File.read(filename, encoding: "utf-8"))
43
+ o = o.merge(xml_options_extract(File.read(filename, encoding: "utf-8")))
33
44
  options[:type] ||= o[:type]&.to_sym
34
45
  dir = filename.sub(%r(/[^/]+$), "/")
35
46
  options[:relaton] ||= "#{dir}/#{o[:relaton]}" if o[:relaton]
@@ -1,3 +1,5 @@
1
+ require "nokogiri"
2
+
1
3
  module Metanorma
2
4
  module Input
3
5
 
@@ -6,6 +6,7 @@ module Metanorma
6
6
 
7
7
  attr_reader :short
8
8
  attr_reader :input_format
9
+ attr_reader :asciidoctor_backend
9
10
 
10
11
  def initialize
11
12
  raise "This is an abstract class!"
@@ -44,5 +44,14 @@ module Metanorma
44
44
  end
45
45
  end
46
46
 
47
+ def root_tags
48
+ @processors.inject({}) do |acc, (k,v)|
49
+ if v.asciidoctor_backend
50
+ x = Asciidoctor.load nil, {backend: v.asciidoctor_backend}
51
+ acc[k] = x.converter.class::XML_ROOT_TAG
52
+ end
53
+ acc
54
+ end
55
+ end
47
56
  end
48
57
  end
@@ -1,3 +1,3 @@
1
1
  module Metanorma
2
- VERSION = "0.3.18"
2
+ VERSION = "1.0.0"
3
3
  end
data/metanorma.gemspec CHANGED
@@ -25,8 +25,8 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  spec.add_runtime_dependency 'asciidoctor'
27
27
  spec.add_runtime_dependency 'htmlentities'
28
+ spec.add_runtime_dependency 'nokogiri'
28
29
 
29
- spec.add_development_dependency "bundler", "~> 2.0"
30
30
  spec.add_development_dependency "rake", "~> 12.0"
31
31
  spec.add_development_dependency "rspec", "~> 3.0"
32
32
  spec.add_development_dependency "byebug", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.18
4
+ version: 1.0.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: 2019-11-19 00:00:00.000000000 Z
11
+ date: 2020-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: bundler
42
+ name: nokogiri
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
48
- type: :development
47
+ version: '0'
48
+ type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '2.0'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -146,6 +146,7 @@ extra_rdoc_files:
146
146
  - CHANGELOG.adoc
147
147
  - LICENSE.txt
148
148
  files:
149
+ - ".github/workflows/dependent_repos.env"
149
150
  - ".github/workflows/macos.yml"
150
151
  - ".github/workflows/ubuntu.yml"
151
152
  - ".github/workflows/windows.yml"
@@ -156,7 +157,6 @@ files:
156
157
  - CHANGELOG.adoc
157
158
  - CODE_OF_CONDUCT.md
158
159
  - Gemfile
159
- - Gemfile.lock
160
160
  - LICENSE.txt
161
161
  - README.adoc
162
162
  - Rakefile
data/Gemfile.lock DELETED
@@ -1,167 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- metanorma (0.3.18)
5
- asciidoctor
6
- htmlentities
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- addressable (2.7.0)
12
- public_suffix (>= 2.0.2, < 5.0)
13
- asciidoctor (2.0.10)
14
- asciimath (1.0.9)
15
- byebug (10.0.2)
16
- cnccs (0.1.5)
17
- concurrent-ruby (1.1.5)
18
- diff-lcs (1.3)
19
- equivalent-xml (0.6.0)
20
- nokogiri (>= 1.4.3)
21
- faraday (0.17.0)
22
- multipart-post (>= 1.2, < 3)
23
- ffi (1.11.2)
24
- gb-agencies (0.0.6)
25
- html2doc (0.9.2)
26
- asciimath (~> 1.0.9)
27
- htmlentities (~> 4.3.4)
28
- image_size
29
- mime-types
30
- nokogiri (>= 1.10.4)
31
- thread_safe
32
- uuidtools
33
- htmlentities (4.3.4)
34
- iev (0.2.3)
35
- nokogiri (>= 1.10.4)
36
- image_size (2.0.2)
37
- isodoc (1.0.8)
38
- asciimath
39
- html2doc (~> 0.9.0)
40
- htmlentities (~> 4.3.4)
41
- liquid
42
- metanorma (~> 0.3.0)
43
- nokogiri (>= 1.10.4)
44
- rake (~> 12.0)
45
- roman-numerals
46
- sassc (~> 2.2.1)
47
- thread_safe
48
- uuidtools
49
- isoics (0.1.8)
50
- liquid (4.0.3)
51
- metanorma-iso (1.3.8)
52
- isodoc (~> 1.0.0)
53
- metanorma-standoc (~> 1.3.0)
54
- ruby-jing
55
- metanorma-standoc (1.3.8)
56
- asciidoctor (~> 2.0.0)
57
- concurrent-ruby
58
- html2doc (~> 0.9.0)
59
- iev (~> 0.2.1)
60
- isodoc (~> 1.0.0)
61
- mimemagic
62
- relaton (~> 0.5.0)
63
- relaton-iev (~> 0.1.0)
64
- ruby-jing
65
- sterile (~> 1.0.14)
66
- unicode2latex (~> 0.0.1)
67
- mime-types (3.3)
68
- mime-types-data (~> 3.2015)
69
- mime-types-data (3.2019.1009)
70
- mimemagic (0.3.3)
71
- mini_portile2 (2.4.0)
72
- mixlib-shellout (2.4.4)
73
- multipart-post (2.1.1)
74
- nokogiri (1.10.5)
75
- mini_portile2 (~> 2.4.0)
76
- optout (0.0.2)
77
- public_suffix (4.0.1)
78
- rake (12.3.3)
79
- relaton (0.5.14)
80
- relaton-calconnect (~> 0.1.0)
81
- relaton-gb (~> 0.6.0)
82
- relaton-iec (~> 0.4.0)
83
- relaton-ietf (~> 0.6.0)
84
- relaton-iso (~> 0.6.0)
85
- relaton-itu (~> 0.3.0)
86
- relaton-nist (~> 0.3.0)
87
- relaton-ogc (~> 0.1.0)
88
- relaton-bib (0.3.12)
89
- addressable
90
- nokogiri
91
- relaton-calconnect (0.1.0)
92
- faraday
93
- relaton-iso-bib (~> 0.3.0)
94
- relaton-gb (0.6.7)
95
- cnccs (~> 0.1.1)
96
- gb-agencies (~> 0.0.1)
97
- relaton-iso-bib (~> 0.3.0)
98
- relaton-iec (0.4.10)
99
- addressable
100
- relaton-iso-bib (~> 0.3.0)
101
- relaton-ietf (0.6.10)
102
- relaton-bib (~> 0.3.0)
103
- relaton-iev (0.1.1)
104
- relaton (~> 0.5.0)
105
- relaton-iso (0.6.9)
106
- relaton-iec (~> 0.4.0)
107
- relaton-iso-bib (~> 0.3.0)
108
- relaton-iso-bib (0.3.12)
109
- isoics (~> 0.1.6)
110
- relaton-bib (~> 0.3.0)
111
- ruby_deep_clone (~> 0.8.0)
112
- relaton-itu (0.3.7)
113
- relaton-iso-bib (~> 0.3.0)
114
- relaton-nist (0.3.8)
115
- relaton-bib (~> 0.3.0)
116
- rubyzip
117
- relaton-ogc (0.1.4)
118
- faraday
119
- relaton-iso-bib (~> 0.3.0)
120
- roman-numerals (0.3.0)
121
- rspec (3.9.0)
122
- rspec-core (~> 3.9.0)
123
- rspec-expectations (~> 3.9.0)
124
- rspec-mocks (~> 3.9.0)
125
- rspec-command (1.0.3)
126
- mixlib-shellout (~> 2.0)
127
- rspec (~> 3.2)
128
- rspec-its (~> 1.2)
129
- rspec-core (3.9.0)
130
- rspec-support (~> 3.9.0)
131
- rspec-expectations (3.9.0)
132
- diff-lcs (>= 1.2.0, < 2.0)
133
- rspec-support (~> 3.9.0)
134
- rspec-its (1.3.0)
135
- rspec-core (>= 3.0.0)
136
- rspec-expectations (>= 3.0.0)
137
- rspec-mocks (3.9.0)
138
- diff-lcs (>= 1.2.0, < 2.0)
139
- rspec-support (~> 3.9.0)
140
- rspec-support (3.9.0)
141
- ruby-jing (0.0.1)
142
- optout (>= 0.0.2)
143
- ruby_deep_clone (0.8.0)
144
- rubyzip (2.0.0)
145
- sassc (2.2.1)
146
- ffi (~> 1.9)
147
- sterile (1.0.14)
148
- nokogiri
149
- thread_safe (0.3.6)
150
- unicode2latex (0.0.3)
151
- uuidtools (2.1.5)
152
-
153
- PLATFORMS
154
- ruby
155
-
156
- DEPENDENCIES
157
- bundler (~> 2.0)
158
- byebug (~> 10.0)
159
- equivalent-xml (~> 0.6)
160
- metanorma!
161
- metanorma-iso (~> 1.3)
162
- rake (~> 12.0)
163
- rspec (~> 3.0)
164
- rspec-command (~> 1.0)
165
-
166
- BUNDLED WITH
167
- 2.0.2