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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f3295b4e18362f1dd8fd40e6b5ee3c11a4870d034b31ce14e8334cbdf893c21
4
- data.tar.gz: cd5ad559a93cce749fc86226324563ead5bd7ac8357e4a72ce04014ad834d4b8
3
+ metadata.gz: 2cd819806f4a458659043fdc38a40a25c32f6f15a66cb1bfc01a87f5fe8c6497
4
+ data.tar.gz: 19b7384f350e1f2ca9bfb09e74f191ec4a59b51f28e3753241bd506c831e1346
5
5
  SHA512:
6
- metadata.gz: 110099a3dbcfd6f6b81ed03662ef60ee8d245a3bc612a623388f1ed08431c9bf6d500698452ffc26da74a4376283015d90023828dcede094c08be1bbbda99413
7
- data.tar.gz: 59ce7f17319da3153bef072bd4adbc802290eb421ff5513ec40c9a4ece5e3fb817e913813b6aa0f87954b955c20c7b5c223d91be2fd6af551b7646963182586f
6
+ metadata.gz: 64aedfc889982e3153ccc5a6871a1f14c4848bdcc6c130047a0f0cb5543acead72aa91d8fc7110f635c3ec0e19a3df4db93d3e2fc4ce8baa4e8b9121641e6518
7
+ data.tar.gz: d31711894bd0ed72e6d0258346e85a5ce637d37182e58deef657ee629202a7d5205b51cdc6272b6a80020fec729b7e3f2f1e1e1d5819fbec0ba82011bddd3aa1
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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: 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
- doc = Rexle.new open(@url,
37
- 'UserAgent' => 'RSFServices::Package reader').read
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
- package_path: ("%s/%s.rsf" % [@package_basepath, package]))
143
+ def run_job(package, jobs, params={}, *qargs)
144
+
145
+ puts 'inside run_job' #if @debug
133
146
 
134
- if @log then
135
- @log.info 'RSFServices/run job: ' +
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
- c, args = read(a)
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.8.2
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-----
13
13
  MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
14
- YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTkwMzA1MTU1MzUxWhcN
15
- MjAwMzA0MTU1MzUxWjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
16
- cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDlYGvg
17
- qZvJhIVpFp3bf26jf3rf4pDQBpT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Dnysj1W6WNc4T4qxomWkSLhWro07+9Kwj
36
- C8jWoNPtodHbGSeGdryPP4JV
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: 2019-03-27 00:00:00.000000000 Z
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.1
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