cpee-model-management 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/cpee-model-management.gemspec +1 -1
- data/lib/cpee-model-management/implementation.rb +7 -7
- data/tools/cpee-moma +14 -15
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4430fd225a84ddf6d4023c904490a86c25297a0843bd033a88e78007fb9df8bc
|
4
|
+
data.tar.gz: 193403968732591b1dc2274f6106041efecc8da3440efe50540fc175031ac7df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86d21dfba406d9f4a4ad52d1b05de835cb58ee21c1779901057e3f0e637c42bbf7d6bf862ba96db1d0246c6ebfc2cc24199af3469d4eacb3c59f6e6a00847dcb
|
7
|
+
data.tar.gz: 52b53c7da24cbcd8ebc45bfce9860763befbaa62b5a130ddc350e32380b0b0d7b11d8e698a30751699770bb1bf86890ea94bf60f46a57799e055718cda1aa8fb
|
@@ -272,7 +272,7 @@ module CPEE
|
|
272
272
|
fnname = File.join(models,where,nname + '.xml')
|
273
273
|
counter = 0
|
274
274
|
stage = 'draft'
|
275
|
-
while File.
|
275
|
+
while File.exist?(fnname)
|
276
276
|
counter += 1
|
277
277
|
fnname = File.join(models,where,nname + counter.to_s + '.xml')
|
278
278
|
end
|
@@ -309,7 +309,7 @@ module CPEE
|
|
309
309
|
fname = File.join(models,name + '.dir')
|
310
310
|
fnname = File.join(models,nname + '.dir')
|
311
311
|
counter = 0
|
312
|
-
while File.
|
312
|
+
while File.exist?(fnname)
|
313
313
|
counter += 1
|
314
314
|
fnname = File.join(models,nname + counter.to_s + '.dir')
|
315
315
|
end
|
@@ -348,7 +348,7 @@ module CPEE
|
|
348
348
|
|
349
349
|
fname = File.join(models,name + '.dir')
|
350
350
|
counter = 0
|
351
|
-
while File.
|
351
|
+
while File.exist?(fname)
|
352
352
|
counter += 1
|
353
353
|
fname = File.join(models,name + counter.to_s + '.dir')
|
354
354
|
end
|
@@ -391,7 +391,7 @@ module CPEE
|
|
391
391
|
stage = views[stage] if views && views[stage]
|
392
392
|
|
393
393
|
counter = 0
|
394
|
-
while File.
|
394
|
+
while File.exist?(fname)
|
395
395
|
counter += 1
|
396
396
|
fname = File.join(models,where,name + counter.to_s + '.xml')
|
397
397
|
end
|
@@ -440,7 +440,7 @@ module CPEE
|
|
440
440
|
models = @a[1]
|
441
441
|
name = File.basename(@r[-1],'.xml')
|
442
442
|
fname = File.join(models,where,name + '.xml')
|
443
|
-
if File.
|
443
|
+
if File.exist? fname
|
444
444
|
Riddl::Parameter::Complex.new('content','application/xml',File.read(fname))
|
445
445
|
else
|
446
446
|
@status = 400
|
@@ -462,7 +462,7 @@ module CPEE
|
|
462
462
|
|
463
463
|
inst = nil
|
464
464
|
begin
|
465
|
-
inst = if File.
|
465
|
+
inst = if File.exist?(fname + '.active') && File.exist?(fname + '.active-uuid') && !force
|
466
466
|
t = {
|
467
467
|
'CPEE-INSTANCE-URL' => File.read(fname + '.active'),
|
468
468
|
'CPEE-INSTANCE-UUID' => File.read(fname + '.active-uuid')
|
@@ -569,7 +569,7 @@ module CPEE
|
|
569
569
|
|
570
570
|
fname = File.join(models,where,name + '.xml')
|
571
571
|
|
572
|
-
if File.
|
572
|
+
if File.exist?(fname)
|
573
573
|
author = dn['GN'] + ' ' + dn['SN']
|
574
574
|
attrs = {}
|
575
575
|
XML::Smart.string(cont) do |doc|
|
data/tools/cpee-moma
CHANGED
@@ -80,7 +80,7 @@ p2 = ARGV[2]
|
|
80
80
|
ui = "#{curpath}/../ui/"
|
81
81
|
|
82
82
|
if command == 'cpui'
|
83
|
-
if !File.
|
83
|
+
if !File.exist?(p1)
|
84
84
|
FileUtils.cp_r(ui,p1)
|
85
85
|
else
|
86
86
|
FileUtils.cp_r(Dir.glob(File.join(ui,'*')),p1,remove_destination: true)
|
@@ -178,8 +178,8 @@ elsif command == 'convert'
|
|
178
178
|
end
|
179
179
|
Dir['*.dir'].each do |f|
|
180
180
|
attrs = JSON::load File.open(f + '.attrs') rescue {}
|
181
|
-
attrs['creator'] = File.read(f + '.creator') if File.
|
182
|
-
attrs['author'] = File.read(f + '.author') if File.
|
181
|
+
attrs['creator'] = File.read(f + '.creator') if File.exist?(f + '.creator')
|
182
|
+
attrs['author'] = File.read(f + '.author') if File.exist?(f + '.author')
|
183
183
|
File.write(f + '.attrs',JSON::pretty_generate(attrs))
|
184
184
|
|
185
185
|
File.unlink(f + '.creator') rescue nil
|
@@ -193,10 +193,12 @@ elsif command == 'consistent'
|
|
193
193
|
redis.lrange(instances,0,-1).each do |i|
|
194
194
|
prefix = File.join(engine,i.to_s)
|
195
195
|
url = redis.get(File.join(prefix,'instance-url'))
|
196
|
-
res = Typhoeus.get(url, :followlocation => true)
|
197
|
-
|
198
|
-
|
199
|
-
|
196
|
+
res = Typhoeus.get(File.join(url,'properties','state'), :followlocation => true)
|
197
|
+
parent = redis.get(File.join(prefix,'parent'))
|
198
|
+
oldstate = redis.get(File.join(prefix,'state'))
|
199
|
+
children = redis.lrange(File.join(prefix,'children'),0,-1)
|
200
|
+
if res.success? && res.response_body != 'finished' && res.response_body != 'abandoned'
|
201
|
+
case res.response_body
|
200
202
|
when 'ready'
|
201
203
|
s_ready += 1
|
202
204
|
when 'running'
|
@@ -205,9 +207,6 @@ elsif command == 'consistent'
|
|
205
207
|
s_stopped += 1
|
206
208
|
end
|
207
209
|
else
|
208
|
-
parent = redis.get(File.join(prefix,'parent'))
|
209
|
-
oldstate = redis.get(File.join(prefix,'state'))
|
210
|
-
children = redis.lrange(File.join(prefix,'children'),0,-1)
|
211
210
|
redis.multi do |multi|
|
212
211
|
multi.decr(File.join(engine,oldstate)) rescue nil
|
213
212
|
multi.incr(File.join(engine,'total_abandoned'))
|
@@ -242,12 +241,12 @@ elsif command == 'consistent'
|
|
242
241
|
end
|
243
242
|
end
|
244
243
|
elsif command == 'new'
|
245
|
-
if !File.
|
244
|
+
if !File.exist?(p1)
|
246
245
|
FileUtils.mkdir(File.join(p1)) rescue nil
|
247
|
-
FileUtils.cp_r("#{curpath}/../server/moma",p1) unless File.
|
248
|
-
FileUtils.cp_r("#{curpath}/../server/moma.conf",p1) unless File.
|
249
|
-
FileUtils.cp_r("#{curpath}/../server/testset.xml",p1) unless File.
|
250
|
-
FileUtils.cp_r("#{curpath}/../server/model.xml",p1) unless File.
|
246
|
+
FileUtils.cp_r("#{curpath}/../server/moma",p1) unless File.exist?(File.join('p1','moma'))
|
247
|
+
FileUtils.cp_r("#{curpath}/../server/moma.conf",p1) unless File.exist?(File.join('p1','moma.conf'))
|
248
|
+
FileUtils.cp_r("#{curpath}/../server/testset.xml",p1) unless File.exist?(File.join('p1','testset.xml'))
|
249
|
+
FileUtils.cp_r("#{curpath}/../server/model.xml",p1) unless File.exist?(File.join('p1','model.xml'))
|
251
250
|
FileUtils.mkdir(File.join(p1,'models')) rescue nil
|
252
251
|
else
|
253
252
|
puts 'Directory already exists.'
|
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.1.
|
4
|
+
version: 1.1.4
|
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:
|
11
|
+
date: 2023-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: riddl
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
requirements: []
|
113
|
-
rubygems_version: 3.
|
113
|
+
rubygems_version: 3.4.6
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: "(Lifecycle) manage your process models in a directory or git repo."
|