cpee-instantiation 1.0.7 → 1.0.8

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: 9efdce12606b0b4a2dcc8edb56a511a8b4392afa1de52d55df1d89f7037ad96d
4
- data.tar.gz: b7ddc4881dadce16e7dfd2da9db9c0bd68c8b70dfe9dc8c8180a3cef75f1dcee
3
+ metadata.gz: 8bc55ea88a7ce4e1bc6ef44f168bf6da2b20b77e2959d6b52d6cbb1b218fc140
4
+ data.tar.gz: a696d35bf0d432a516fc41152c593fc4f673111d94f1312785024c2c233f50f4
5
5
  SHA512:
6
- metadata.gz: 4b65153017b9a2f2c7853e0d7ec658cba83b6e3eabe79425b3166ca818ae8a0f61ee36242c9b5cf080db41938b55c7652e6e37765c47b2fb282656fe25ad5ae6
7
- data.tar.gz: 7b1a05794b4f6df41298f01ade332459806e613989f70f35c58b9786b86b7e38d9added2762b1bafe432de625910d25625d3bf1c27860180afec09730cdaeea9
6
+ metadata.gz: 2e8d8ef73155472996b1069d274670b29934e9ac4c4873f7de23ed16201a58cc2e2d8b7d635a5c79de079054bf634ceeca4aa944ee1aba39160bbe2f15c193dd
7
+ data.tar.gz: 815e7fc7d79314b0da18c9f5e2dd7fa348453894784ef3b909698d1300d3da517d50398733d1a3ab9dbbe8aeb05719950ca16c15611e864d9289773b84cef0bb
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-instantiation"
3
- s.version = "1.0.7"
3
+ s.version = "1.0.8"
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', '~> 2.1'
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('/')
@@ -75,18 +76,25 @@ module CPEE
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
- )
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
90
98
  end
91
99
  end
92
100
  end
@@ -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/ })
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.7
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-05-19 00:00:00.000000000 Z
11
+ date: 2021-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: riddl
@@ -59,6 +59,9 @@ dependencies:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '2.1'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 2.1.4
62
65
  type: :runtime
63
66
  prerelease: false
64
67
  version_requirements: !ruby/object:Gem::Requirement
@@ -66,6 +69,9 @@ dependencies:
66
69
  - - "~>"
67
70
  - !ruby/object:Gem::Version
68
71
  version: '2.1'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 2.1.4
69
75
  description: see http://cpee.org
70
76
  email: juergen.mangler@gmail.com
71
77
  executables:
@@ -102,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
108
  - !ruby/object:Gem::Version
103
109
  version: '0'
104
110
  requirements: []
105
- rubygems_version: 3.1.4
111
+ rubygems_version: 3.1.6
106
112
  signing_key:
107
113
  specification_version: 4
108
114
  summary: Subprocess instantiation service for the cloud process execution engine (cpee.org)