cpee-model-management 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cpee-model-management.gemspec +1 -1
- data/lib/cpee-model-management/implementation.rb +7 -6
- 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: 7e0f8e33529278f8cf87df02f0b71e457f3b398a374ccb1ebd25e0819ea76d1b
|
4
|
+
data.tar.gz: a4407d50ade6af084b89c2b2760a0e6b3dbc506f87d609946af72e75bc741777
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7505da78dbaf10e6ce4cd085ccf5e1c8b786de6bbafd0c883a165c23d5d435ef069d4ca9006fd62ab333306f17438b8e6e923484a2810c09deedd00c54dfefff
|
7
|
+
data.tar.gz: 0036b1b3cd264e6fd88bc746785de160b3d9df9c99915eb00297da2d76844a85e6b1cc46b533c7c80ed9710e0d510f9bb7bd0d6344a19b159b8e1b95bdd63455
|
@@ -187,14 +187,15 @@ module CPEE
|
|
187
187
|
where = @a[0] == :main ? '' : Riddl::Protocols::Utils::unescape(@r.last)
|
188
188
|
views = @a[1]
|
189
189
|
models = @a[2]
|
190
|
-
stage = @p[0]&.value || 'draft'
|
191
|
-
stage
|
190
|
+
stage = [@p[0]&.value] || ['draft']
|
191
|
+
stage << views[stage[0]] if views && views[stage[0]]
|
192
|
+
|
192
193
|
|
193
194
|
names = Dir.glob(File.join(models,where,'*.dir')).map do |f|
|
194
195
|
{ :type => :dir, :name => File.basename(f), :creator => File.read(f + '.creator'), :date => File.mtime(f).xmlschema }
|
195
196
|
end.compact.uniq.sort_by{ |e| e[:name] } + Dir.glob(File.join(models,where,'*.xml')).map do |f|
|
196
197
|
fstage = File.read(f + '.stage').strip rescue 'draft'
|
197
|
-
{ :type => :file, :name => File.basename(f), :creator => File.read(f + '.creator'), :author => File.read(f + '.author'), :stage => fstage, :date => File.mtime(f).xmlschema } if fstage
|
198
|
+
{ :type => :file, :name => File.basename(f), :creator => File.read(f + '.creator'), :author => File.read(f + '.author'), :stage => fstage, :date => File.mtime(f).xmlschema } if stage.include?(fstage)
|
198
199
|
end.compact.uniq.sort_by{ |e| e[:name] }
|
199
200
|
|
200
201
|
Riddl::Parameter::Complex.new('list','application/json',JSON::pretty_generate(names))
|
@@ -204,14 +205,14 @@ module CPEE
|
|
204
205
|
def response
|
205
206
|
views = @a[0]
|
206
207
|
models = @a[1]
|
207
|
-
stage = @p[0]&.value || 'draft'
|
208
|
-
stage
|
208
|
+
stage = [@p[0]&.value] || ['draft']
|
209
|
+
stage << views[stage[0]] if views && views[stage[0]]
|
209
210
|
|
210
211
|
names = Dir.glob(File.join(models,'*.dir/*.xml')).map do |f|
|
211
212
|
{ :type => :file, :name => File.join(File.basename(File.dirname(f)),File.basename(f)), :creator => File.read(f + '.creator'), :date => File.mtime(f).xmlschema }
|
212
213
|
end.compact.uniq.sort_by{ |e| e[:name] } + Dir.glob(File.join(models,'*.xml')).map do |f|
|
213
214
|
fstage = File.read(f + '.stage').strip rescue 'draft'
|
214
|
-
{ :type => :file, :name => File.basename(f), :creator => File.read(f + '.creator'), :author => File.read(f + '.author'), :stage => fstage, :date => File.mtime(f).xmlschema } if fstage
|
215
|
+
{ :type => :file, :name => File.basename(f), :creator => File.read(f + '.creator'), :author => File.read(f + '.author'), :stage => fstage, :date => File.mtime(f).xmlschema } if stage.include?(fstage)
|
215
216
|
end.compact.uniq.sort_by{ |e| e[:name] }
|
216
217
|
|
217
218
|
Riddl::Parameter::Complex.new('list','application/json',JSON::pretty_generate(names))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cpee-model-management
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
8
8
|
autorequire:
|
9
9
|
bindir: tools
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: riddl
|