stepmod-utils 0.3.26 → 0.3.27

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: b9ad52321cd8307aae7754edc2b9e45f2e20d372aceca95c667befce3717fae2
4
- data.tar.gz: c86cb0fb6e7a7c8e654571cbc0eb31792e760be7069402e04d05c17db8e13e14
3
+ metadata.gz: b4bb366577c4b43d545ccbdf77ea88e46ece9f0bbefe5ca493769131e18ccaed
4
+ data.tar.gz: 9811424a834ad40699bfd1c2ed900762469407d764adbe714a5ccf47bc792ed7
5
5
  SHA512:
6
- metadata.gz: 4e19c30c54c9f4b8d6b32fbdf998ac7b741f5fb81193552e991c3e3daa194dc2bd37c1a3277245e8954672cb64d0c1260a070509e1e3daa199628acd993c89cf
7
- data.tar.gz: a3601da30f90d16a8bb6c53a17950af15ca761379ded0f7ebb0a25607822944221e8d2d79c32a78c752ba470badc68b69ce3d047a30452201fbd78dfb28a1664
6
+ metadata.gz: 38fe3f3a2292c0f4e891bcb29997165ff5550aa2c4e95d5997afda0a77b01bd037642b8f412cd84fa4b01ffd90c70a12dea7a29acb532376984259ed7522a39d
7
+ data.tar.gz: 2644087f0c877378d0d1e2fc417e74157906a0c00121f0504a0df3475d0d40de5b94a9ed542385ab3977b573e134747cb6f5bd2478d7ae41bb5a43fd9ce8622a
@@ -142,7 +142,7 @@ end
142
142
  part_resources.each do |(_bibdata, current_part_resources)|
143
143
  current_part_resources.save_to_files(output_dir)
144
144
  end
145
- log "INFO: part_resources written to yaml files"
145
+ log "INFO: part_resources written to YAML files in #{output_dir}"
146
146
 
147
147
  part_modules.sort_by do |(bibdata, _part_modules_arm, _part_modules_mim)|
148
148
  bibdata.part.to_i
@@ -159,7 +159,7 @@ end.each do |(_bibdata, part_modules_arm, part_modules_mim)|
159
159
  end
160
160
  end
161
161
  end
162
- log "INFO: part_modules written to yaml files"
162
+ log "INFO: part_modules written to YAML files in #{output_dir}"
163
163
 
164
164
  resource_concepts.save_to_files(output_dir)
165
- log "INFO: resource_concepts written to yaml files"
165
+ log "INFO: resource_concepts written to YAML files in #{output_dir}"
@@ -66,29 +66,53 @@ module Stepmod
66
66
  end
67
67
  end
68
68
 
69
+ def published_part_numbers
70
+ docs_xml = Nokogiri::XML(File.read(@stepmod_path.join('library/docs.xml')))
71
+ docs_xml.xpath("//doc").map do |x|
72
+ x['part']
73
+ end.uniq.sort
74
+ end
75
+
69
76
  def call
70
77
  log "INFO: STEPmod directory set to #{stepmod_dir}."
71
78
  log "INFO: Detecting paths..."
72
79
 
73
- # Run `cvs status` to find out version
74
80
  log "INFO: Detecting Git SHA..."
75
81
  Dir.chdir(stepmod_path) do
76
82
  @git_rev = `git rev-parse HEAD` || nil
77
83
  end
78
84
 
85
+ published_part_nos = published_part_numbers
79
86
  repo_index = Nokogiri::XML(File.read(@index_path)).root
80
87
 
81
88
  files = []
82
89
 
83
90
  # add module paths
84
91
  repo_index.xpath("//module").each do |x|
85
- next if x['status'] == WITHDRAWN_STATUS
92
+ unless published_part_nos.include? x['part']
93
+ log "INFO: skipping module #{x['name']} as part #{x['part']} is not published in `docs.xml`."
94
+ next
95
+ end
86
96
 
87
- arm_path = Pathname.new("#{stepmod_dir}/modules/#{x['name']}/arm_annotated.exp")
88
- mim_path = Pathname.new("#{stepmod_dir}/modules/#{x['name']}/mim_annotated.exp")
97
+ if x['status'] == WITHDRAWN_STATUS
98
+ log "INFO: skipping module #{x['name']} as it is withdrawn."
99
+ next
100
+ end
89
101
 
90
- files << arm_path if File.exist? arm_path
91
- files << mim_path if File.exist? mim_path
102
+ arm_path = @stepmod_path.join("modules/#{x['name']}/arm_annotated.exp")
103
+ mim_path = @stepmod_path.join("modules/#{x['name']}/mim_annotated.exp")
104
+
105
+ if File.exist? arm_path
106
+ files << arm_path
107
+ else
108
+ log "INFO: skipping module ARM for #{x['name']} as it does not exist at #{arm_path}."
109
+ end
110
+
111
+ if File.exist? mim_path
112
+ files << mim_path
113
+ else
114
+ log "INFO: skipping module MIM for #{x['name']} as it does not exist at #{mim_path}."
115
+ end
92
116
  end
93
117
 
94
118
  # Should ignore these because the `<resource_docs>` elements do not provide any EXPRESS schemas
@@ -102,10 +126,27 @@ module Stepmod
102
126
 
103
127
  # add resource paths
104
128
  repo_index.xpath("//resource").each do |x|
105
- next if x["status"] == WITHDRAWN_STATUS || x["name"] == "iso13584_expressions_schema"
129
+ unless published_part_nos.include? x['part']
130
+ log "INFO: skipping resource #{x['name']} as part #{x['part']} is not published in `docs.xml`."
131
+ next
132
+ end
133
+
134
+ if x['status'] == WITHDRAWN_STATUS
135
+ log "INFO: skipping resource #{x['name']} as it is withdrawn."
136
+ next
137
+ end
106
138
 
107
- path = Pathname.new("#{stepmod_dir}/resources/#{x['name']}/#{x['name']}_annotated.exp")
108
- files << path if File.exist? path
139
+ if x["name"] == "iso13584_expressions_schema"
140
+ log "INFO: skipping resource #{x['name']} as the ISO 13584 series is out of scope."
141
+ next
142
+ end
143
+
144
+ path = @stepmod_path.join("resources/#{x['name']}/#{x['name']}_annotated.exp")
145
+ if File.exist? path
146
+ files << path
147
+ else
148
+ log "INFO: skipping resource #{x['name']} as it does not exist at #{path}."
149
+ end
109
150
  end
110
151
 
111
152
  # Should ignore these because we are skiping Clause 3 terms
@@ -1,5 +1,5 @@
1
1
  module Stepmod
2
2
  module Utils
3
- VERSION = "0.3.26".freeze
3
+ VERSION = "0.3.27".freeze
4
4
  end
5
5
  end
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.3.26
4
+ version: 0.3.27
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-07-05 00:00:00.000000000 Z
11
+ date: 2023-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby