cpee-model-management 1.0.3 → 1.0.8

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: 832d0061a73fc72f8263789e2b9c406ebfea4ac490d0089a58b23bb33021dfc6
4
- data.tar.gz: 1e77f187de0153e185aeeecfc02817b61cf0743c9eb3558d0f392964b48969ce
3
+ metadata.gz: 800b85d124c0e17d95c1ec8db33ba65f527c63c3612ad7e48eef6ffd52613a53
4
+ data.tar.gz: 6258a4c173733ad24e85b19b7fa7f0157292865b0311f6805689767ae0cc43f2
5
5
  SHA512:
6
- metadata.gz: c1e404b1335f21cb9a38b7e7e0d857b0db7dfce0fe53cb42b934a3a2096518f3f32a916a632a16fca60e2667edfb515a47394998be2a03881c78f12835432af3
7
- data.tar.gz: 38b8b75765e4536cbf3de3258ec268875915cd92f611b5d13e165a2172b5f130ade9a32c7e877cdccdb4374a15357aa2ab8c2391717c62974994ddcce3b5e201
6
+ metadata.gz: 26618e7be924364b745337b089a15ffbb9c01786e352a5db8d04b256ad8b070cdc45da9e520d360dd9d3d613c43e5caee12f304c61fda5540e61d147726cba60
7
+ data.tar.gz: 66c4bddc35f6fa5c3271d5dff4089fad8b53d68f9f825ca9cecb491f0fbbb47fdd03d8188df8c46c7b1a010d4b0bf2f57487803e642edba9c311ad9753d84b21
@@ -1,13 +1,13 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-model-management"
3
- s.version = "1.0.3"
3
+ s.version = "1.0.8"
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."
7
7
 
8
8
  s.description = "see http://cpee.org"
9
9
 
10
- s.files = Dir['{server/**/*,tools/**/*,lib/**/*}'] + %w(LICENSE Rakefile cpee-model-management.gemspec README.md AUTHORS)
10
+ s.files = Dir['{server/*,tools/**/*,lib/**/*}'] + %w(LICENSE Rakefile cpee-model-management.gemspec README.md AUTHORS)
11
11
  s.require_path = 'lib'
12
12
  s.extra_rdoc_files = ['README.md']
13
13
  s.bindir = 'tools'
@@ -4,11 +4,11 @@ author = ARGV[2]
4
4
 
5
5
  Dir.chdir(File.join(models,File.dirname(new)))
6
6
  new = File.basename(new)
7
- `git add "#{new}" 2>/dev/null`
8
- `git add "#{new}.active" 2>/dev/null`
9
- `git add "#{new}.active-uuid" 2>/dev/null`
10
- `git add "#{new}.author" 2>/dev/null`
11
- `git add "#{new}.creator" 2>/dev/null`
12
- `git add "#{new}.stage" 2>/dev/null`
13
- `git commit -m "#{author.gsub(/"/,"'")}"`
14
- `git push` rescue nil
7
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple add "#{new}" 2>/dev/null`
8
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple add "#{new}.active" 2>/dev/null`
9
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple add "#{new}.active-uuid" 2>/dev/null`
10
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple add "#{new}.author" 2>/dev/null`
11
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple add "#{new}.creator" 2>/dev/null`
12
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple add "#{new}.stage" 2>/dev/null`
13
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple commit -m "#{author.gsub(/"/,"'")}"`
14
+ `GIT_TERMINAL_PROMPT=0 git push` rescue nil
@@ -23,6 +23,7 @@ require 'riddl/client'
23
23
  require 'riddl/protocols/utils'
24
24
  require 'fileutils'
25
25
  require 'pathname'
26
+ require 'shellwords'
26
27
 
27
28
  module CPEE
28
29
  module ModelManagement
@@ -36,39 +37,39 @@ module CPEE
36
37
  p2 = Pathname.new(File.dirname(new))
37
38
  old = File.basename(old)
38
39
  new = File.join(p1.relative_path_from(p1).to_s,File.basename(new))
39
- `git mv "#{old}" "#{new}" 2>/dev/null`
40
- `git rm -rf "#{old + '.active'}" "#{new + '.active'}" 2>/dev/null`
41
- `git rm -rf "#{old + '.active-uuid'}" "#{new + '.active-uuid'}" 2>/dev/null`
42
- `git mv "#{old + '.author'}" "#{new + '.author'}" 2>/dev/null`
43
- `git mv "#{old + '.creator'}" "#{new + '.creator'}" 2>/dev/null`
44
- `git mv "#{old + '.stage'}" "#{new + '.stage'}" 2>/dev/null`
40
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple mv "#{old}" "#{new}" 2>/dev/null`
41
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{old + '.active'}" 2>/dev/null`
42
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{old + '.active-uuid'}" 2>/dev/null`
43
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple mv "#{old + '.author'}" "#{new + '.author'}" 2>/dev/null`
44
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple mv "#{old + '.creator'}" "#{new + '.creator'}" 2>/dev/null`
45
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple mv "#{old + '.stage'}" "#{new + '.stage'}" 2>/dev/null`
45
46
  Dir.chdir(cdir)
46
47
  end
47
48
  def self::git_rm(models,new)
48
49
  cdir = Dir.pwd
49
50
  Dir.chdir(File.join(models,File.dirname(new)))
50
51
  new = File.basename(new)
51
- `git rm -rf "#{new}" 2>/dev/null`
52
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{new}" 2>/dev/null`
52
53
  FileUtils.rm_rf(new)
53
- `git rm -rf "#{new}.active" 2>/dev/null`
54
- `git rm -rf "#{new}.active-uuid" 2>/dev/null`
55
- `git rm -rf "#{new}.author" 2>/dev/null`
56
- `git rm -rf "#{new}.creator" 2>/dev/null`
57
- `git rm -rf "#{new}.stage" 2>/dev/null`
54
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{new}.active" 2>/dev/null`
55
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{new}.active-uuid" 2>/dev/null`
56
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{new}.author" 2>/dev/null`
57
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{new}.creator" 2>/dev/null`
58
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{new}.stage" 2>/dev/null`
58
59
  Dir.chdir(cdir)
59
60
  end
60
61
  def self::git_shift(models,new)
61
62
  cdir = Dir.pwd
62
63
  Dir.chdir(File.join(models,File.dirname(new)))
63
64
  new = File.basename(new)
64
- `git rm -rf "#{new}.active" 2>/dev/null`
65
- `git rm -rf "#{new}.active-uuid" 2>/dev/null`
65
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{new}.active" 2>/dev/null`
66
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{new}.active-uuid" 2>/dev/null`
66
67
  Dir.chdir(cdir)
67
68
  end
68
69
  def self::git_commit(models,new,author)
69
- Process.fork do
70
- exec 'ruby', File.join(__dir__,'commit.rb'), File.realpath(models), new, author
71
- end
70
+ rp = File.realpath(models)
71
+ crb = File.join(__dir__,'commit.rb')
72
+ system 'ruby ' + crb + ' ' + [rp, new, author].shelljoin + ' &'
72
73
  end
73
74
  def self::fs_mv(models,old,new)
74
75
  fname = File.join(models,old)
@@ -186,14 +187,15 @@ module CPEE
186
187
  where = @a[0] == :main ? '' : Riddl::Protocols::Utils::unescape(@r.last)
187
188
  views = @a[1]
188
189
  models = @a[2]
189
- stage = @p[0]&.value || 'draft'
190
- stage = views[stage] if views && views[stage]
190
+ stage = [@p[0]&.value] || ['draft']
191
+ stage << views[stage[0]] if views && views[stage[0]]
192
+
191
193
 
192
194
  names = Dir.glob(File.join(models,where,'*.dir')).map do |f|
193
195
  { :type => :dir, :name => File.basename(f), :creator => File.read(f + '.creator'), :date => File.mtime(f).xmlschema }
194
196
  end.compact.uniq.sort_by{ |e| e[:name] } + Dir.glob(File.join(models,where,'*.xml')).map do |f|
195
197
  fstage = File.read(f + '.stage').strip rescue 'draft'
196
- { :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)
197
199
  end.compact.uniq.sort_by{ |e| e[:name] }
198
200
 
199
201
  Riddl::Parameter::Complex.new('list','application/json',JSON::pretty_generate(names))
@@ -203,14 +205,14 @@ module CPEE
203
205
  def response
204
206
  views = @a[0]
205
207
  models = @a[1]
206
- stage = @p[0]&.value || 'draft'
207
- stage = views[stage] if views && views[stage]
208
+ stage = [@p[0]&.value] || ['draft']
209
+ stage << views[stage[0]] if views && views[stage[0]]
208
210
 
209
211
  names = Dir.glob(File.join(models,'*.dir/*.xml')).map do |f|
210
212
  { :type => :file, :name => File.join(File.basename(File.dirname(f)),File.basename(f)), :creator => File.read(f + '.creator'), :date => File.mtime(f).xmlschema }
211
213
  end.compact.uniq.sort_by{ |e| e[:name] } + Dir.glob(File.join(models,'*.xml')).map do |f|
212
214
  fstage = File.read(f + '.stage').strip rescue 'draft'
213
- { :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)
214
216
  end.compact.uniq.sort_by{ |e| e[:name] }
215
217
 
216
218
  Riddl::Parameter::Complex.new('list','application/json',JSON::pretty_generate(names))
data/server/model.xml CHANGED
@@ -1,6 +1,6 @@
1
1
  <testset xmlns="http://cpee.org/ns/properties/2.0">
2
2
  <dataelements/>
3
- <handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
3
+ <executionhandler>ruby</executionhandler>
4
4
  <endpoints>
5
5
  <machine>machine</machine>
6
6
  <sensor>sensor</sensor>
data/server/testset.xml CHANGED
@@ -1,6 +1,6 @@
1
1
  <testset xmlns="http://cpee.org/ns/properties/2.0">
2
2
  <dataelements/>
3
- <handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
3
+ <executionhandler>ruby</executionhandler>
4
4
  <endpoints>
5
5
  <timeout>https://cpee.org/services/timeout.php</timeout>
6
6
  <subprocess>https://cpee.org/flow/start/url/</subprocess>
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.3
4
+ version: 1.0.8
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-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: riddl
@@ -56,12 +56,6 @@ files:
56
56
  - lib/cpee-model-management/moma.xml
57
57
  - lib/cpee-model-management/stages
58
58
  - server/model.xml
59
- - server/models/agar.xml
60
- - server/models/agar.xml.active
61
- - server/models/agar.xml.active-uuid
62
- - server/models/agar.xml.author
63
- - server/models/agar.xml.creator
64
- - server/models/agar.xml.stage
65
59
  - server/moma
66
60
  - server/moma.conf
67
61
  - server/testset.xml
@@ -1,25 +0,0 @@
1
- <testset xmlns="http://cpee.org/ns/properties/2.0">
2
- <dataelements/>
3
- <handlerwrapper>DefaultHandlerWrapper</handlerwrapper>
4
- <endpoints>
5
- <timeout>https://cpee.org/services/timeout.php</timeout>
6
- <subprocess>https://cpee.org/flow/start/url/</subprocess>
7
- </endpoints>
8
- <description>
9
- <description xmlns="http://cpee.org/ns/description/1.0"/>
10
- </description>
11
- <transformation>
12
- <description type="copy"/>
13
- <dataelements type="none"/>
14
- <endpoints type="none"/>
15
- </transformation>
16
- <attributes>
17
- <info>agar</info>
18
- <creator>Christine Ashcreek</creator>
19
- <author>Christine Ashcreek</author>
20
- <modeltype>CPEE</modeltype>
21
- <theme>extended</theme>
22
- <design_dir/>
23
- <design_stage>development</design_stage>
24
- </attributes>
25
- </testset>
@@ -1 +0,0 @@
1
- https://cpee.org/flow/engine/4842
@@ -1 +0,0 @@
1
- 6945f9e2-105a-4b14-84e6-3a4ca6921e93
@@ -1 +0,0 @@
1
- Christine Ashcreek
@@ -1 +0,0 @@
1
- Christine Ashcreek
@@ -1 +0,0 @@
1
- development