stepmod-utils 0.4.5 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test-concept-generation.yml +8 -1
- data/exe/stepmod-annotate-all +22 -4
- data/lib/stepmod/utils/converters/eqn.rb +1 -0
- data/lib/stepmod/utils/converters/example.rb +1 -0
- data/lib/stepmod/utils/converters/express_note.rb +1 -0
- data/lib/stepmod/utils/converters/figure.rb +0 -1
- data/lib/stepmod/utils/converters/note.rb +1 -0
- data/lib/stepmod/utils/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb9578dd41ed9730c2c5821debb5a29f405741f12d5f5838a7547145abfbf3f2
|
4
|
+
data.tar.gz: 2c019e36f6a2ada973ef012bda7a41a50d57d391fceabfa9b613e6c96b29b238
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f452f78f0d2ad725a03643561315373be8b3b70cad58b75d0728a8ea256b4a0563c8c8380ae84c991cec7788bffd84355573d51885105b3c2ec961f91c93a59
|
7
|
+
data.tar.gz: f9440eed18984579c7ba222d7ff32609a46528ebee9d76b650245c20463a8d5f5a27b67000402f653d9ecc7076a21e5330feafb1771f2919651c1241f0980054
|
@@ -26,11 +26,18 @@ jobs:
|
|
26
26
|
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
|
27
27
|
path: iso-10303-stepmod-wg12
|
28
28
|
|
29
|
+
- name: Generate Folders for schemas
|
30
|
+
run: mkdir schemas
|
31
|
+
|
32
|
+
- name: Generate Folders for documents
|
33
|
+
run: mkdir documents
|
34
|
+
|
29
35
|
- name: Generate Annotated EXPRESS files
|
30
36
|
run: |
|
31
37
|
bundle exec stepmod-annotate-all \
|
32
38
|
--stepmod-dir ./iso-10303-stepmod-wg12 \
|
33
|
-
--
|
39
|
+
--schemas schemas \
|
40
|
+
--documents documents
|
34
41
|
|
35
42
|
- name: Generate Concept YAML files
|
36
43
|
working-directory: iso-10303-stepmod-wg12
|
data/exe/stepmod-annotate-all
CHANGED
@@ -25,13 +25,21 @@ OptionParser.new do |opts|
|
|
25
25
|
end
|
26
26
|
|
27
27
|
opts.on(
|
28
|
-
"--
|
28
|
+
"--schemas SRL_SCHEMAS_DIR",
|
29
29
|
String,
|
30
30
|
"Path to output SRL schemas",
|
31
31
|
) do |path|
|
32
32
|
options[:srl_output_schemas_dir] = path
|
33
33
|
end
|
34
34
|
|
35
|
+
opts.on(
|
36
|
+
"--documents SRL_DOCS_DIR",
|
37
|
+
String,
|
38
|
+
"Path to SRL documents (generated by stepmod2mn)",
|
39
|
+
) do |path|
|
40
|
+
options[:srl_output_docs_dir] = path
|
41
|
+
end
|
42
|
+
|
35
43
|
opts.on_tail("-h", "--help", "Show this message") do
|
36
44
|
puts opts
|
37
45
|
exit
|
@@ -48,9 +56,17 @@ end
|
|
48
56
|
log "STEPmod data path: `#{stepmod_dir}`"
|
49
57
|
|
50
58
|
srl_output_schemas_dir = options[:srl_output_schemas_dir]
|
51
|
-
raise StandardError.new("--
|
59
|
+
raise StandardError.new("--schemas directory for SRL schemas not set") unless srl_output_schemas_dir
|
52
60
|
log "SRL schemas output path: `#{srl_output_schemas_dir}`"
|
53
61
|
|
62
|
+
srl_output_docs_dir = options[:srl_output_docs_dir]
|
63
|
+
raise StandardError.new("--documents directory for SRL documents (generated by stepmod2mn) not set") unless srl_output_docs_dir
|
64
|
+
log "SRL documents path: `#{srl_output_docs_dir}`"
|
65
|
+
|
66
|
+
unless File.exist?(srl_output_docs_dir) && File.directory?(srl_output_docs_dir)
|
67
|
+
raise StandardError.new("--documents directory for SRL documents (generated by stepmod2mn) does not exist yet, please run stepmod2mn")
|
68
|
+
end
|
69
|
+
|
54
70
|
def all_express_files(stepmod_dir)
|
55
71
|
index_file = File.read(File.join(stepmod_dir, "repository_index.xml"))
|
56
72
|
index = Nokogiri::XML(index_file).root
|
@@ -113,6 +129,9 @@ files = all_express_files(stepmod_dir)
|
|
113
129
|
filename_cache = {}
|
114
130
|
|
115
131
|
FileUtils.mkdir_p(srl_output_schemas_dir)
|
132
|
+
srl_output_schemas_path = Pathname.new(srl_output_schemas_dir)
|
133
|
+
srl_output_docs_path = Pathname.new(srl_output_docs_dir)
|
134
|
+
|
116
135
|
|
117
136
|
files.each do |file|
|
118
137
|
puts "#{Thread.current.object_id}: `#{file}` processing..."
|
@@ -125,7 +144,6 @@ files.each do |file|
|
|
125
144
|
destination_rel_path = Pathname.new(file).dirname.relative_path_from(stepmod_path.join("data"))
|
126
145
|
directory_type = destination_rel_path.each_filename.to_a.first
|
127
146
|
|
128
|
-
srl_output_schemas_path = Pathname.new(srl_output_schemas_dir)
|
129
147
|
destination_path = srl_output_schemas_path.join(destination_rel_path)
|
130
148
|
FileUtils.mkdir_p(destination_path)
|
131
149
|
|
@@ -151,7 +169,7 @@ files.each do |file|
|
|
151
169
|
|
152
170
|
puts "#{Thread.current.object_id}: Copy image NOT FOUND at schema path: `#{source_file}`, trying glob..."
|
153
171
|
|
154
|
-
source_path = srl_output_schemas_path.glob("**/#{source_file}").first
|
172
|
+
source_path = (srl_output_schemas_path.glob("**/#{source_file}") + srl_output_docs_path.glob("**/#{source_file}")).first
|
155
173
|
if source_path
|
156
174
|
puts "EXISTS" if source_path.exist?
|
157
175
|
system_source_path = file_system_path(source_path.to_s, filename_cache)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stepmod-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|