cpee-model-management 1.0.6 → 1.0.11

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: 7e0f8e33529278f8cf87df02f0b71e457f3b398a374ccb1ebd25e0819ea76d1b
4
- data.tar.gz: a4407d50ade6af084b89c2b2760a0e6b3dbc506f87d609946af72e75bc741777
3
+ metadata.gz: 4c7144bdbca2c93817e6acdbac14bc06df366017a3ba5546c50d39ff6d42d6b9
4
+ data.tar.gz: 287318a851e666f4442d88b75b87bc13cfd5983a2aa2bdb2fe1c8a980d24cacc
5
5
  SHA512:
6
- metadata.gz: 7505da78dbaf10e6ce4cd085ccf5e1c8b786de6bbafd0c883a165c23d5d435ef069d4ca9006fd62ab333306f17438b8e6e923484a2810c09deedd00c54dfefff
7
- data.tar.gz: 0036b1b3cd264e6fd88bc746785de160b3d9df9c99915eb00297da2d76844a85e6b1cc46b533c7c80ed9710e0d510f9bb7bd0d6344a19b159b8e1b95bdd63455
6
+ metadata.gz: db79d873a4ba7466a855b9271d0f08089d691ad5486d682ce852bbca7454d2d494c5d11cd2c9567295acffc90b2fb8cbabbbd31f97e80a55ec8bc232ee54f8aa
7
+ data.tar.gz: 2a7317f8fd20c26558b515937a42f4770c8d0d6c2be19e5e798865bec455ff1e3adcf3df9525690e6be50b4a0d9a628f1109be4c0a630483fbe1cd5fcb2dfa01
@@ -1,13 +1,13 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-model-management"
3
- s.version = "1.0.6"
3
+ s.version = "1.0.11"
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'
@@ -35,36 +35,39 @@ module CPEE
35
35
  Dir.chdir(File.join(models,File.dirname(old)))
36
36
  p1 = Pathname.new(File.dirname(old))
37
37
  p2 = Pathname.new(File.dirname(new))
38
- old = File.basename(old)
39
- new = File.join(p1.relative_path_from(p1).to_s,File.basename(new))
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`
38
+ told = File.basename(old)
39
+ tnew = File.join(p1.relative_path_from(p1).to_s,File.basename(new))
40
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple mv "#{told}" "#{tnew}" 2>/dev/null`
41
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{told + '.active'}" 2>/dev/null`
42
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{told + '.active-uuid'}" 2>/dev/null`
43
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple mv "#{told + '.author'}" "#{tnew + '.author'}" 2>/dev/null`
44
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple mv "#{told + '.creator'}" "#{tnew + '.creator'}" 2>/dev/null`
45
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple mv "#{told + '.stage'}" "#{tnew + '.stage'}" 2>/dev/null`
46
46
  Dir.chdir(cdir)
47
+ CPEE::ModelManagement::fs_mv(models,old,new) # fallback
47
48
  end
48
49
  def self::git_rm(models,new)
49
50
  cdir = Dir.pwd
50
51
  Dir.chdir(File.join(models,File.dirname(new)))
51
- new = File.basename(new)
52
- `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{new}" 2>/dev/null`
53
- FileUtils.rm_rf(new)
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`
52
+ tnew = File.basename(new)
53
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{tnew}" 2>/dev/null`
54
+ FileUtils.rm_rf(tnew)
55
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{tnew}.active" 2>/dev/null`
56
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{tnew}.active-uuid" 2>/dev/null`
57
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{tnew}.author" 2>/dev/null`
58
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{tnew}.creator" 2>/dev/null`
59
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{tnew}.stage" 2>/dev/null`
59
60
  Dir.chdir(cdir)
61
+ CPEE::ModelManagement::fs_rm(models,new) # fallback
60
62
  end
61
63
  def self::git_shift(models,new)
62
64
  cdir = Dir.pwd
63
65
  Dir.chdir(File.join(models,File.dirname(new)))
64
- new = File.basename(new)
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
+ nnew = File.basename(new)
67
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{nnew}.active" 2>/dev/null`
68
+ `git -c user.name='Christine Ashcreek' -c user.email=dev@null.com -c push.default=simple rm -rf "#{nnew}.active-uuid" 2>/dev/null`
67
69
  Dir.chdir(cdir)
70
+ CPEE::ModelManagement::fs_shift(models,new) # fallback
68
71
  end
69
72
  def self::git_commit(models,new,author)
70
73
  rp = File.realpath(models)
@@ -74,7 +77,7 @@ module CPEE
74
77
  def self::fs_mv(models,old,new)
75
78
  fname = File.join(models,old)
76
79
  fnname = File.join(models,new)
77
- FileUtils.mv(fname,fnname)
80
+ FileUtils.mv(fname,fnname) rescue nil
78
81
  File.delete(fname + '.active',fnname + '.active') rescue nil
79
82
  File.delete(fname + '.active-uuid',fnname + '.active-uuid') rescue nil
80
83
  FileUtils.mv(fname + '.author',fnname + '.author') rescue nil
@@ -104,7 +107,6 @@ module CPEE
104
107
  fname = File.join(models,new)
105
108
  File.delete(fname + '.active') rescue nil
106
109
  File.delete(fname + '.active-uuid') rescue nil
107
- Dir.chdir(cdir)
108
110
  end
109
111
 
110
112
  def self::git_dir(models,file)
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>
data/tools/cpee-moma CHANGED
@@ -5,6 +5,7 @@ require 'optparse'
5
5
  require 'fileutils'
6
6
  require 'xml/smart'
7
7
  require 'zip'
8
+ require 'typhoeus'
8
9
 
9
10
  def wrap(s, width=78, indent=18)
10
11
  lines = []
@@ -24,6 +25,29 @@ def wrap(s, width=78, indent=18)
24
25
  return lines.join "\n"
25
26
  end
26
27
 
28
+ def js_libs(cockpit)
29
+ res = Typhoeus.get('https://cpee.org/js_libs/js_libs.zip')
30
+ if res.success?
31
+ File.write(File.join(cockpit,'js_libs.zip'),res.response_body)
32
+ Zip::File.open(File.join(cockpit,'js_libs.zip')) do |zip_file|
33
+ zip_file.each do |entry|
34
+ case entry.ftype
35
+ when :directory
36
+ Dir.mkdir(File.join(cockpit,entry.name)) rescue nil
37
+ when :file
38
+ File.write(File.join(cockpit,entry.name),entry.get_input_stream.read)
39
+ when :symlink
40
+ FileUtils.ln_s(File.join('.',entry.get_input_stream.read),File.join(cockpit,entry.name), force: true)
41
+ end
42
+ end
43
+ end
44
+ true
45
+ else
46
+ puts 'Internet access required to download javascript libs from "http://cpee.org/js_libs/js_libs.zip".'
47
+ false
48
+ end
49
+ end
50
+
27
51
  ARGV.options { |opt|
28
52
  opt.summary_indent = ' ' * 2
29
53
  opt.summary_width = 15
@@ -66,6 +90,19 @@ elsif command == 'convert'
66
90
  name = File.basename(f,'.xml')
67
91
  creator = author = design_dir = design_stage = nil
68
92
 
93
+ if doc.find('/x:testset/x:attributes').length == 0
94
+ n = doc.root.add('x:attributes')
95
+ end
96
+
97
+ if doc.find('/x:testset/x:attributes/x:theme').length == 0
98
+ n = doc.find('/x:testset/x:attributes').first
99
+ n.add('x:theme','extended')
100
+ end
101
+ if doc.find('/x:testset/x:attributes/x:info').length == 0
102
+ n = doc.find('/x:testset/x:attributes').first
103
+ n.add('x:info',name)
104
+ end
105
+
69
106
  if (dt = doc.find('/x:testset/x:attributes/x:creator')).length > 0
70
107
  dt.each do |e|
71
108
  creator = e.text
@@ -102,12 +139,14 @@ elsif command == 'convert'
102
139
  end
103
140
  File.write(f + '.stage',design_stage)
104
141
 
142
+ dd = ENV['PWD'] || Dir.pwd
143
+ ma = dd.scan(/\/([^\/]+\.dir)/)
144
+ design_dir = ma.join('/')
105
145
  if (dt = doc.find('/x:testset/x:attributes/x:design_dir')).length > 0
106
146
  dt.each do |e|
107
- design_dir = e.text
147
+ e.text = design_dir
108
148
  end
109
149
  else
110
- design_dir = Dir.pwd.sub(/^.*?models\/?/,'')
111
150
  doc.find('/x:testset/x:attributes').each do |e|
112
151
  e.add('x:design_dir',design_dir)
113
152
  end
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.6
4
+ version: 1.0.11
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-05-18 00:00:00.000000000 Z
11
+ date: 2021-05-27 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
@@ -85,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
79
  - !ruby/object:Gem::Version
86
80
  version: '0'
87
81
  requirements: []
88
- rubygems_version: 3.1.4
82
+ rubygems_version: 3.1.6
89
83
  signing_key:
90
84
  specification_version: 4
91
85
  summary: "(Lifecycle) manage your process models in a directory or git repo."
@@ -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