rsf_services 0.8.2 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rsf_services.rb +47 -13
- metadata +25 -25
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cd819806f4a458659043fdc38a40a25c32f6f15a66cb1bfc01a87f5fe8c6497
|
4
|
+
data.tar.gz: 19b7384f350e1f2ca9bfb09e74f191ec4a59b51f28e3753241bd506c831e1346
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64aedfc889982e3153ccc5a6871a1f14c4848bdcc6c130047a0f0cb5543acead72aa91d8fc7110f635c3ec0e19a3df4db93d3e2fc4ce8baa4e8b9121641e6518
|
7
|
+
data.tar.gz: d31711894bd0ed72e6d0258346e85a5ce637d37182e58deef657ee629202a7d5205b51cdc6272b6a80020fec729b7e3f2f1e1e1d5819fbec0ba82011bddd3aa1
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rsf_services.rb
CHANGED
@@ -7,7 +7,6 @@ require 'app-mgr'
|
|
7
7
|
require 'dws-registry'
|
8
8
|
|
9
9
|
|
10
|
-
|
11
10
|
class RSFServices < RScriptRW
|
12
11
|
|
13
12
|
class PackageMethod
|
@@ -28,13 +27,24 @@ class RSFServices < RScriptRW
|
|
28
27
|
|
29
28
|
class Package
|
30
29
|
|
31
|
-
def initialize(obj, package, debug:
|
30
|
+
def initialize(obj, package, debug: false)
|
32
31
|
|
32
|
+
|
33
|
+
puts 'inside Package#initialize' if debug
|
34
|
+
|
33
35
|
@obj, @package, @debug = obj, package, debug
|
34
36
|
|
35
37
|
@url = File.join(@obj.package_basepath, package + '.rsf')
|
36
|
-
|
37
|
-
|
38
|
+
|
39
|
+
puts 'before Rexle' if @debug
|
40
|
+
puts '@url: ' + @url.inspect if @debug
|
41
|
+
|
42
|
+
s, _ = RXFHelper.read(@url)
|
43
|
+
puts 's: ' + s.inspect if @debug
|
44
|
+
|
45
|
+
doc = Rexle.new s
|
46
|
+
puts 'before xpath' if @debug
|
47
|
+
|
38
48
|
a = doc.root.xpath 'job/attribute::id'
|
39
49
|
|
40
50
|
a.each do |attr|
|
@@ -79,9 +89,11 @@ class RSFServices < RScriptRW
|
|
79
89
|
|
80
90
|
puts 'inside RSF_services' if @debug
|
81
91
|
|
82
|
-
super(log: log)
|
92
|
+
super(log: log, debug: debug)
|
83
93
|
|
84
94
|
@package_basepath, @services = package_basepath, {}
|
95
|
+
|
96
|
+
@initialized = {}
|
85
97
|
|
86
98
|
if reg then
|
87
99
|
|
@@ -128,28 +140,48 @@ class RSFServices < RScriptRW
|
|
128
140
|
PackageMethod.new self, type: :post
|
129
141
|
end
|
130
142
|
|
131
|
-
def run_job(package, jobs, params={}, *qargs
|
132
|
-
|
143
|
+
def run_job(package, jobs, params={}, *qargs)
|
144
|
+
|
145
|
+
puts 'inside run_job' #if @debug
|
133
146
|
|
134
|
-
|
135
|
-
|
147
|
+
package_path = "%s/%s.rsf" % [@package_basepath, package]
|
148
|
+
|
149
|
+
if @log or @debug then
|
150
|
+
msg = 'RSFServices/run job: ' +
|
136
151
|
("package: %s jobs: %s params: %s qargs: %s " + \
|
137
152
|
" package_path: %s" % [package, jobs, params, qargs, package_path])
|
153
|
+
@log.info msg if @log
|
154
|
+
puts msg if @debug
|
138
155
|
end
|
139
156
|
|
140
157
|
yield(params) if block_given?
|
141
158
|
|
142
|
-
a = [package_path, jobs.split(/\s/).map{|x| "//job:%s" % x} ,qargs].flatten
|
143
|
-
|
144
|
-
|
159
|
+
a = [package_path, jobs.split(/\s/).map{|x| "//job:%s" % x} ,qargs].flatten(2)
|
160
|
+
|
161
|
+
puts 'a: ' + a.inspect if @debug
|
145
162
|
|
163
|
+
c, args, _ = read(a)
|
164
|
+
puts 'c: ' + c.inspect if @debug
|
146
165
|
rws, reg, app = self, @registry, @app
|
147
166
|
|
148
167
|
begin
|
149
168
|
|
150
169
|
@log.info 'RSFServices/run job: code: ' + c if @log and c.is_a? String
|
151
170
|
|
171
|
+
# if there is a job id called *initialize* then execute if it hasn't
|
172
|
+
# already been executed
|
173
|
+
|
174
|
+
if self.jobs(package_path).include? :initialize and
|
175
|
+
!@initialized[package_path] and jobs != 'initialize' then
|
176
|
+
run_job(package, 'initialize')
|
177
|
+
@initialized[package_path] = true
|
178
|
+
end
|
179
|
+
|
152
180
|
r = eval c
|
181
|
+
puts 'r: ' + r.inspect if @debug
|
182
|
+
#thread = Thread.new {Thread.current[:v] = eval c}
|
183
|
+
#thread.join
|
184
|
+
#r = thread[:v]
|
153
185
|
|
154
186
|
@log.info 'RSFServices/run job: result: ' + r if @log and r.is_a? String
|
155
187
|
|
@@ -162,7 +194,7 @@ class RSFServices < RScriptRW
|
|
162
194
|
@log.debug 'RSFServices/run_job/error: ' + err_label if @log
|
163
195
|
|
164
196
|
end
|
165
|
-
|
197
|
+
|
166
198
|
end
|
167
199
|
|
168
200
|
def package_methods(package)
|
@@ -176,6 +208,8 @@ class RSFServices < RScriptRW
|
|
176
208
|
private
|
177
209
|
|
178
210
|
def method_missing(method_name, *args)
|
211
|
+
|
212
|
+
puts 'inside method_missing' if @debug
|
179
213
|
self.type = :get
|
180
214
|
Package.new self, method_name.to_s, debug: @debug
|
181
215
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsf_services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -11,31 +11,31 @@ cert_chain:
|
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
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
26
|
+
XGcB19WXnvY8bjqVIFIwJgYDVR0RBB8wHYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0
|
27
27
|
c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1hc3RlckBqYW1lc3JvYmVydHNvbi5ldTAN
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
28
|
+
BgkqhkiG9w0BAQsFAAOCAYEAqfwg7zu3Btv6tGegDZ8tLTHf4WsswPXoOgh4iKyh
|
29
|
+
cFndGfA5c2cZEc9eTv9duBvTzmp4+uKhhCM4jkzBeRdrN+l9vnV4NZ2OjWiA9M3c
|
30
|
+
PpYG3LR4PaM9syzMLATGWctofw6EhsT7NbdSMBJ9nAuJbcFYXshWIJr11CgrSekM
|
31
|
+
66idwveobI9GeVzWHWI9KmnM6r7Th2dK4lS5y42y4pACzRSTacBVF2lylu2/X8oS
|
32
|
+
nzHN7yMdXRhdvboDI3Etq10pLs+e7cmB/6MkWV9Ba6kOMbJeeXokdjo6A03w/CXW
|
33
|
+
kSCp6ydjpEAtQhXpTOOWQfMXwafnNXvcVyh5mtQvSluCdVy0Qf5dHZuMaF+iIdtM
|
34
|
+
mS6T6oPPYAVaC+9DHMD5+hJRIo/U5sb+ZUQaHaME8XNCuHGxPbL2WmZr92iKZVCu
|
35
|
+
MxhWn7Vf3TxD/7nwBz7wR+H2ONNwWRWmRA7g+Os9YvLEB6LNsJfo+Tyer6bVsSBz
|
36
|
+
EOn2RvkdKH17/N7rqiDFRtI2
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2020-07-01 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: dws-registry
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.0.
|
106
|
+
rubygems_version: 3.0.3
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Runs within a DRb server to run RSF jobs, as well as other services.
|
metadata.gz.sig
CHANGED
Binary file
|