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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2301d22c5a02dcace2fa736c3b41b88d02866c2cb2f3b68b2554e0766224486e
4
- data.tar.gz: d8f20b6c8c5c620dab0f582566a3445f6b48498cecd36ea7670096d80319166c
3
+ metadata.gz: 7e0f8e33529278f8cf87df02f0b71e457f3b398a374ccb1ebd25e0819ea76d1b
4
+ data.tar.gz: a4407d50ade6af084b89c2b2760a0e6b3dbc506f87d609946af72e75bc741777
5
5
  SHA512:
6
- metadata.gz: c8de486ecdffc9c0cf93a7ca043e0d1363210d679223528270f9aa02e97aa2106386bb9a0240237f0c115321ea58127e13d0c24e33e414695ee1896676e88fa7
7
- data.tar.gz: 711f92a0d044bd8bfc77cb56cd899df56343fd9fe80f9bc92170f4d86b0c5cced06edfd95f273879dbc59f59a27deaa7be4a25b5e572668621c062df7b9d82bd
6
+ metadata.gz: 7505da78dbaf10e6ce4cd085ccf5e1c8b786de6bbafd0c883a165c23d5d435ef069d4ca9006fd62ab333306f17438b8e6e923484a2810c09deedd00c54dfefff
7
+ data.tar.gz: 0036b1b3cd264e6fd88bc746785de160b3d9df9c99915eb00297da2d76844a85e6b1cc46b533c7c80ed9710e0d510f9bb7bd0d6344a19b159b8e1b95bdd63455
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-model-management"
3
- s.version = "1.0.5"
3
+ s.version = "1.0.6"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "(Lifecycle) manage your process models in a directory or git repo."
@@ -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 = views[stage] if views && views[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 == stage
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 = views[stage] if views && views[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 == stage
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.5
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-03-27 00:00:00.000000000 Z
11
+ date: 2021-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: riddl