cpee-instantiation 1.0.4 → 1.0.10

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: e836e978f135897ec280bfd67a6a0f84c915d4df2d4a36f619faa6956be5835f
4
- data.tar.gz: 224d5d7ae75c3bbce7d3292b12e2f1ad8970d3150695b5891c647b567017a5d9
3
+ metadata.gz: 4d4f2d6bb294992580a51fe2e5f4c5c122506fe31a327fcbae1e88845964e02f
4
+ data.tar.gz: f2046e8bc78d8ff5d69feed0ba54ffc23d35da3afba9f58bf6417fe8963e01a2
5
5
  SHA512:
6
- metadata.gz: 2abaa7f262242504de44349c7112d6295a834811473035e046c00380ce7b338abd91973e6d3f774c7a5128958fe1ab4bf96ebcaf9ad812152806d690508f696e
7
- data.tar.gz: 54ed9445a640706d6d587e86ed2b135839ece3e088454e56c0ffedf0a97b5670d5fc9518fca4f52396d88ac27f3b4563409aa70afe611746aaa9b5d5ada073ea
6
+ metadata.gz: 316d7c396535c85ba2030750591c3152e15a99142120925ed3b6758d0f755a1276e1b3da6c074caab507ae38f8159fdcd5843d556a7417a408e12396b72564e8
7
+ data.tar.gz: 96dfd842fd444518894bc782c48eb6ca69bca06bb02077c64a1af503843f1bec454bfc4bbdb666b2477ae4bbbc040862586e02e6a3f5cb4a12205c1a8ace949d
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-instantiation"
3
- s.version = "1.0.4"
3
+ s.version = "1.0.10"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "Subprocess instantiation service for the cloud process execution engine (cpee.org)"
@@ -23,5 +23,5 @@ Gem::Specification.new do |s|
23
23
  s.add_runtime_dependency 'riddl', '~> 0.99'
24
24
  s.add_runtime_dependency 'json', '~> 2.1'
25
25
  s.add_runtime_dependency 'redis', '~> 4.1'
26
- s.add_runtime_dependency 'cpee', '~> 1', '>= 1.5'
26
+ s.add_runtime_dependency 'cpee', '~> 2.1', '>= 2.1.4'
27
27
  end
@@ -36,6 +36,7 @@ module CPEE
36
36
  XML::Smart.string(tdoc) do |doc|
37
37
  doc.register_namespace 'desc', 'http://cpee.org/ns/description/1.0'
38
38
  doc.register_namespace 'prop', 'http://cpee.org/ns/properties/2.0'
39
+ doc.register_namespace 'sub', 'http://riddl.org/ns/common-patterns/notifications-producer/2.0'
39
40
 
40
41
  srv = Riddl::Client.new(cpee, File.join(cpee,'?riddl-description'))
41
42
  res = srv.resource('/')
@@ -70,24 +71,31 @@ module CPEE
70
71
 
71
72
  inp = XML::Smart::string('<properties xmlns="http://cpee.org/ns/properties/2.0"/>')
72
73
  inp.register_namespace 'prop', 'http://cpee.org/ns/properties/2.0'
73
- %w{handlerwrapper positions dataelements endpoints attributes description transformation}.each do |item|
74
+ %w{executionhandler positions dataelements endpoints attributes description transformation}.each do |item|
74
75
  ele = doc.find("/*/prop:#{item}")
75
76
  inp.root.add(ele.first) if ele.any?
76
77
  end
77
78
  res = srv.resource("/#{ins}/properties").put Riddl::Parameter::Complex.new('properties','application/xml',inp.to_s)
78
- doc.find('/*/prop:handlers/prop:handler').each do |han|
79
- url = han.attributes['url']
80
- inp = 'url=' + URI.encode_www_form_component(url)
81
- inp = inp + '&topic=' + han.children.first.attributes['topic']
82
- inp = inp + '&' + han.children.first.qname.to_s + '=' + han.children.first.to_s
83
- status,body = Riddl::Client::new(cpee+ins+'/notifications/subscriptions/').post(
84
- [
85
- Riddl::Parameter::Simple.new('url',han.attributes['url']),
86
- Riddl::Parameter::Simple.new('topic',han.children.first.attributes['topic']),
87
- Riddl::Parameter::Simple.new(han.children.first.qname.to_s,han.children.first.to_s)
88
- ]
89
- )
90
- end
79
+ # TODO new versions
80
+ doc.find('/*/sub:subscriptions/sub:subscription').each do |s|
81
+ parts = []
82
+ if id = s.attributes['id']
83
+ parts << Riddl::Parameter::Simple.new('id', id)
84
+ end
85
+ parts << Riddl::Parameter::Simple.new('url', s.attributes['url'])
86
+ s.find('sub:topic').each do |t|
87
+ p s.find('sub:event').map{ |e| e.text }
88
+ if (evs = t.find('sub:event').map{ |e| e.text }.join(',')).length > 0
89
+ parts << Riddl::Parameter::Simple.new('topic', t.attributes['id'])
90
+ parts << Riddl::Parameter::Simple.new('events', evs)
91
+ end
92
+ if (vos = t.find('sub:vote').map{ |e| e.text }.join(',')).length > 0
93
+ parts << Riddl::Parameter::Simple.new('topic', t.attributes['id'])
94
+ parts << Riddl::Parameter::Simple.new('votes', vos)
95
+ end
96
+ end
97
+ status,body = Riddl::Client::new(cpee+ins+'/notifications/subscriptions/').post parts
98
+ end rescue nil # in case just no subs are there
91
99
  end
92
100
  end
93
101
  [ins, uuid]
@@ -54,7 +54,7 @@
54
54
  <parameter name="endpoints" type="string"/>
55
55
  </optional>
56
56
  <optional>
57
- <parameter name="stream" type="string"/>
57
+ <parameter name="customization" type="string"/>
58
58
  </optional>
59
59
  </message>
60
60
  <message name="git">
@@ -76,7 +76,7 @@
76
76
  <parameter name="endpoints" type="string"/>
77
77
  </optional>
78
78
  <optional>
79
- <parameter name="stream" type="string"/>
79
+ <parameter name="customization" type="string"/>
80
80
  </optional>
81
81
  </message>
82
82
  <message name="instance">
@@ -30,7 +30,7 @@ ARGV.options { |opt|
30
30
  opt.on("Options:")
31
31
  opt.on("--help", "-h", "This text") { puts opt; exit }
32
32
  opt.on("")
33
- opt.on(wrap("[DIR] scaffolds a sample instantiation service. Post a testset to a model to keep going in one operation."))
33
+ opt.on(wrap("[DIR] scaffolds a sample instantiation service. Post a testset to a model to keep going in one operation."))
34
34
  opt.parse!
35
35
  }
36
36
  if (ARGV.length != 1)
@@ -40,8 +40,10 @@ else
40
40
  p1 = ARGV[0]
41
41
  end
42
42
 
43
+ insta = "#{curpath}/../server/"
43
44
  if !File.exists?(p1)
44
- FileUtils.cp_r("#{curpath}/../server/",p1)
45
+ FileUtils.cp_r(insta,p1)
45
46
  else
46
- puts 'Directory already exists.'
47
+ FileUtils.cp_r(Dir.glob(File.join(insta,'*')).delete_if{|e| e =~ /\.conf/ },p1,remove_destination: true)
48
+ puts 'Directory already exists, updating ...'
47
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee-instantiation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.10
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-01-20 00:00:00.000000000 Z
11
+ date: 2021-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: riddl
@@ -58,20 +58,20 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1'
61
+ version: '2.1'
62
62
  - - ">="
63
63
  - !ruby/object:Gem::Version
64
- version: '1.5'
64
+ version: 2.1.4
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
69
  - - "~>"
70
70
  - !ruby/object:Gem::Version
71
- version: '1'
71
+ version: '2.1'
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: '1.5'
74
+ version: 2.1.4
75
75
  description: see http://cpee.org
76
76
  email: juergen.mangler@gmail.com
77
77
  executables:
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.1.4
111
+ rubygems_version: 3.1.6
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Subprocess instantiation service for the cloud process execution engine (cpee.org)