cpee-model-management 1.0.2 → 1.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7bb70d01ebeeb6576722a378ec65514aa3118432737caf27d979c54ac3f4d73e
4
- data.tar.gz: a69e9dc695583d226724283e2364c03a51978d488c8f718cb088708ec29468e8
3
+ metadata.gz: e0dba813806b528c9a04f3852938e621b74e736f813c73796ac05560ed47975e
4
+ data.tar.gz: 066f46470ecd3f580f742bba5596e20f8737f3c3e0c02d3cedf4b1470461b3af
5
5
  SHA512:
6
- metadata.gz: 00aa163e4d9be3bc7e55d37116e33c4e99f47e3d8dad2a570d24648993c1a5016f79385c5fdbdf3cbd62783023441a93d073f3be40ebef2da75bdbd058b43917
7
- data.tar.gz: 8ae2de3be4e438df6d5e0f99223d25bab844fc2663b79c42f465bada4bd9916eec111258eed21a2fda6e6c61db19d3b742f9087cb67cffcc230bb4d7c2073a45
6
+ metadata.gz: 9da118eb3836c211aa4ddafff4c5bc8c066f5ad059b80ae03c6b0d2913216836cdef391327378153e90285c48cc6fcca998a3e4e1f77f33701d7ec5e45c1c866
7
+ data.tar.gz: 9a0a983fb62d4b30c06eaf054661fdb98fe450f359ab26536619df6e0e0a174833c257b1ca544c521f6c6d29ba6af53f6a2599540295454f45f8f3ff3253b4ba
@@ -1,13 +1,13 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-model-management"
3
- s.version = "1.0.2"
3
+ s.version = "1.0.7"
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'
@@ -0,0 +1,14 @@
1
+ models = ARGV[0]
2
+ new = ARGV[1]
3
+ author = ARGV[2]
4
+
5
+ Dir.chdir(File.join(models,File.dirname(new)))
6
+ new = File.basename(new)
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))
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.2
4
+ version: 1.0.7
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
@@ -51,16 +51,11 @@ files:
51
51
  - README.md
52
52
  - Rakefile
53
53
  - cpee-model-management.gemspec
54
+ - lib/cpee-model-management/commit.rb
54
55
  - lib/cpee-model-management/implementation.rb
55
56
  - lib/cpee-model-management/moma.xml
56
57
  - lib/cpee-model-management/stages
57
58
  - server/model.xml
58
- - server/models/agar.xml
59
- - server/models/agar.xml.active
60
- - server/models/agar.xml.active-uuid
61
- - server/models/agar.xml.author
62
- - server/models/agar.xml.creator
63
- - server/models/agar.xml.stage
64
59
  - server/moma
65
60
  - server/moma.conf
66
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