rsf_services 0.4.0 → 0.5.0

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
  SHA1:
3
- metadata.gz: 86c7559b8e69b8266787d83bd0378ab7e198c1e0
4
- data.tar.gz: 22c70de4cbd32a0278bb3bfda4208a56ae8e6d1c
3
+ metadata.gz: 7428288bc852d1cde1da829f034930c961059f1a
4
+ data.tar.gz: 84c065cc30157c9d8d1465852220ef9e3aedf81e
5
5
  SHA512:
6
- metadata.gz: 9654023482d63cb27d8e97c2ee6059a84b80dcec523da5ebadf5223df696ef90355e8798cd7e88a7e4c575cbfffa48439f060f179672377b854e7c20383a8201
7
- data.tar.gz: 5fc026b0d893139ca3b36e57f0f35fe1a0ac03681cf290cd3f706526bbe9d52ed54c49ebc33246ca5e8459cf748d06f51bf905173ced3332ddb03a4211edfadf
6
+ metadata.gz: 73e69b2c2516e87eca8d30ee79d7793245fde81289f4ec7ef0a9d7e62b44a747b48a99378c7698a0259f4960430dc9cac20cbc26c6359c08a14a27abf291acbf
7
+ data.tar.gz: 1ff1a463115cb3c321e75ad0c5c47c63267322f150661e3bc3695c5b114363d42e6110d283dc111dde46ecfde135de711cd8496a78be900e0448944f6c334891
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/rsf_services.rb CHANGED
@@ -6,7 +6,57 @@ require 'rscript'
6
6
  require 'dws-registry'
7
7
 
8
8
 
9
- class RSFServices < RScript
9
+ class RScriptRW < RScript
10
+
11
+ def read(args=[], type: :get)
12
+
13
+ @log.info 'RScript/read: args: ' + args.inspect if @log
14
+
15
+ threads = []
16
+
17
+ if args.to_s[/\/\/job:/] then
18
+
19
+ ajob = []
20
+
21
+ args.each_index do |i|
22
+ if args[i].to_s[/\/\/job:/] then
23
+ ajob << "@id='#{$'}' and @type='#{type.to_s}'"; args[i] = nil
24
+ end
25
+ end
26
+
27
+ args.compact!
28
+
29
+ out = read_rsf(args) do |doc|
30
+
31
+ doc.root.xpath('//job').each do |x|
32
+ x.attributes[:type] = type.to_s unless x.attributes[:type]
33
+ end
34
+
35
+ if @log then
36
+ @log.info 'RScriptRW/read: code: ' + doc.xml.inspect
37
+ end
38
+
39
+ doc.root.xpath("//job[#{ajob.join(' or ')}]").map do |job|
40
+ job.xpath('script').map {|s| read_script(s)}.join("\n")
41
+ end.join("\n")
42
+ end
43
+
44
+ raise "job not found" unless out.length > 0
45
+ out
46
+
47
+ else
48
+ out = read_rsf(args) {|doc| doc.root.xpath('//script').map {|s| read_script(s)}}.join("\n")
49
+ end
50
+
51
+ @log.info 'RScript/read: code: ' + out.inspect if @log
52
+
53
+ [out, args]
54
+
55
+ end
56
+
57
+ end
58
+
59
+ class RSFServices < RScriptRW
10
60
 
11
61
  class Package
12
62
 
@@ -30,7 +80,7 @@ class RSFServices < RScript
30
80
 
31
81
  private
32
82
 
33
- def run_job(method_name, *args)
83
+ def run_job(method_name, *args, type: :get)
34
84
 
35
85
  args.flatten!(1)
36
86
  params = args.pop if args.find {|x| x.is_a? Hash}
@@ -121,4 +171,4 @@ class RSFServices < RScript
121
171
  Package.new self, @package_basepath, method_name.to_s
122
172
  end
123
173
 
124
- end
174
+ end
data.tar.gz.sig CHANGED
Binary file
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.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  fMXSqexhUAZIyk80TuvEsqUgRCN81F92e6Yq47RQ0oKhCG9Xor/NhJodXh91NhRW
32
32
  zAgihHevT4OTsg==
33
33
  -----END CERTIFICATE-----
34
- date: 2017-11-07 00:00:00.000000000 Z
34
+ date: 2018-03-21 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rscript
metadata.gz.sig CHANGED
Binary file