rsc 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/lib/rsc.rb +22 -27
  5. metadata +26 -21
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32a3501e874a7170be794f90e377ede84f4cd52f2a6a284759ae5ebd66e1740c
4
- data.tar.gz: 84c4badc222866c2976cfb7897bce0c9e6abda347b5af8589f65d83b4976db25
3
+ metadata.gz: 115749bd16f1af955ea0e43418bba405759717e0c79dd01fad8949d6a347d919
4
+ data.tar.gz: e69fdafceb96dccd9e5cd28293bbc34945d434c0dbcebfdf42372e9eed9b8b79
5
5
  SHA512:
6
- metadata.gz: dfed63413ef2d00507098b073fcc5797165914913ffb2bf2cf66411d4170bf3b34d43d6e1738eeda78e2f30f5bbdf314a003167106f5b3359434cbc2332a8068
7
- data.tar.gz: fc75a7228b2abc899c7942971b28078393a7b8cc096f7fea8cb5e97b7a6e8dcb780471c220f17ebb12a127071594d79c67c88d43988303e62bf122b16b26b033
6
+ metadata.gz: d79d6a669490acf00d80fda396a921aa8999f17e37210ba479085aa0592c05221479475d165eae3b2b27ce60d684261bf141f3d3446b18f5aee59e1545b360ba
7
+ data.tar.gz: a9da5d5628a9241ae958294122ea5ab24bd2cedb0f2bfb3710a1612fb13ee761dd2249ae0792dbe1a5f3b54f488e7238378bab5feb7d7c6565907f0413bd2f3a
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/rsc.rb CHANGED
@@ -18,47 +18,37 @@ class Rse
18
18
  end
19
19
 
20
20
  class RSC
21
+ using ColouredText
21
22
 
22
23
  class Package
24
+ using ColouredText
23
25
 
24
- def initialize(drb_obj, parent_url, package)
26
+ def initialize(drb_obj, package, debug: false)
27
+
28
+ @debug = debug
25
29
 
26
30
  @obj = drb_obj
31
+ drb_obj.package_methods(package).each do |method_name|
32
+
33
+ puts ('creating method ' + method_name).info if @debug
27
34
 
28
- @url = File.join(parent_url, package + '.rsf')
29
- doc = Rexle.new open(@url, 'UserAgent' => 'ClientRscript').read
30
- a = doc.root.xpath 'job/attribute::id'
31
-
32
- a.each do |attr|
33
- method_name = attr.value.gsub('-','_')
34
- method = "def %s(*args); run_job('%s', args) ; end" % \
35
- ([method_name] * 2)
36
- self.instance_eval(method)
35
+ methodx = "
36
+ def %s(*args)
37
+ @obj.run_job('%s','%s', args)
38
+ end" % [method_name, package, method_name]
39
+ self.instance_eval(methodx)
37
40
 
38
41
  end
39
42
 
40
43
  end
41
44
 
42
- private
43
-
44
- def run_job(method_name, *args)
45
-
46
- args.flatten!(1)
47
- params = args.pop if args.find {|x| x.is_a? Hash}
48
- a = ['//job:' + method_name, @url, args].flatten(1)
49
- params ? @obj.run(a, params) : @obj.run(a)
50
- end
51
-
52
45
  end
53
46
 
54
- def initialize(drb_hostname='rse', parent_url=nil, port: '61000')
47
+ def initialize(drb_hostname='rse', port: '61000', debug: false)
55
48
 
56
- @port = port
49
+ @port, @debug = port, debug
57
50
 
58
- if parent_url then
59
- @parent_url = parent_url
60
- drb_start(drb_hostname)
61
- end
51
+ drb_start(drb_hostname)
62
52
 
63
53
  end
64
54
 
@@ -91,9 +81,14 @@ class RSC
91
81
  end
92
82
 
93
83
  def method_missing(method_name, *args)
84
+
85
+ if @debug then
86
+ puts 'method_missing'.info
87
+ puts ('method_name: ' + method_name.inspect).debug
88
+ end
94
89
 
95
90
  begin
96
- Package.new @obj, @parent_url, method_name.to_s
91
+ Package.new @obj, method_name.to_s, debug: @debug
97
92
  rescue
98
93
  # nil will be returned if there is no package by that name
99
94
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -10,27 +10,32 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDXjCCAkagAwIBAgIBATANBgkqhkiG9w0BAQUFADAsMSowKAYDVQQDDCFnZW1t
14
- YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTgwMzIyMTE1OTEyWhcN
15
- MTkwMzIyMTE1OTEyWjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
16
- cnRzb24vREM9ZXUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIHgN1
17
- uIkVDcT1aZ5MJTDaLtAljRnojAKWiabiMrVxFxd1ub8nC24p9CExttTKYE8IrGH0
18
- 3MjvXlZhRhk3MQopSziiqji0BvrQjjPLA57QRxSIbfsJs6++2XlYcwsCNO6i56W6
19
- Anp0qYWqwH5OEMAgKywpQ4f4kUocOy5zYJga2WvAOOhLcGIq8eiwzo9IlnGIg8sk
20
- S73EBod3OO2TBnlvvWbHmNjv/sr+2g2CzSfrHVL2XAPCNIosntDE/Ocq0Myi3Q4c
21
- NQSuZ7zyWeI96HlA2APuZGZqWdmDAqfXRVxp4RZDZ4L5hQNP3gOEKqUMinrZl1rd
22
- TgFcSS5K+inoYRavAgMBAAGjgYowgYcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
23
- HQYDVR0OBBYEFPYYE4Xh0Ws9wEWVrTVigOfwCtXkMCYGA1UdEQQfMB2BG2dlbW1h
24
- c3RlckBqYW1lc3JvYmVydHNvbi5ldTAmBgNVHRIEHzAdgRtnZW1tYXN0ZXJAamFt
25
- ZXNyb2JlcnRzb24uZXUwDQYJKoZIhvcNAQEFBQADggEBAKedVycTGeHIPJwYSPtr
26
- gr8NVUYArb0iRCgr+Ly9C6elzhBEfe9sYoVT0qUpq8sCq3rDwZuZyQR7oH04tmZR
27
- znLaXpqRagRWM7mJ4yV2kCTbR0Dev+KTqxNYd/qL3TH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AaOBijCBhzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUkXxB0m9n
26
+ QjQF2pEcLWjIJQQ17OAwJgYDVR0RBB8wHYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0
27
+ c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1hc3RlckBqYW1lc3JvYmVydHNvbi5ldTAN
28
+ BgkqhkiG9w0BAQsFAAOCAYEAX6HnR+X7C+gvITIFX1Phr1q3aQQHdWgkksD28FNz
29
+ OhReWeEjgGB30Aj2ckvLVfJ90SLMCPG5DgtJH3Fs9XjzhlIGupu7Yvv+0fD8rCYZ
30
+ Gza8xDRFM9Gau6cg+ffSe0BxgMMrIPc20ZH6Zy2r6veeX1CYGuEI7fwIiCZAJINC
31
+ 42q/+nGi212BAbgFsP/2m/w1jHY5dL9QMfYAcsf99TRkBakk0OUvSa4/uE2M6W4O
32
+ bmhpLpNRFjGf7DUFBsNvuwsFh69u0BpswPK4rLoHWzvF0PbXPOYdmgGZnSc+Z4nB
33
+ Yg6KG/j568bsHRPhZdkT47XLkPg0phTCLKdnucv/7ShMuo+H+9pl+5QzrgxQiGCY
34
+ G0TsddNJlQ7BSvbrcCc/Bj+6DdDNmXcFsb3A1f4f/mOq6BoLjgtZ/BQcF6skvI7i
35
+ ErJFIoeyeVsFvSBnm5kPCZAp6NFkohs59rEEMVKkj4ZlAkFLyOHJ3sUyedByJwqE
36
+ zW8gffb/eYXJOnj754Mmtpb4
32
37
  -----END CERTIFICATE-----
33
- date: 2019-03-08 00:00:00.000000000 Z
38
+ date: 2019-03-26 00:00:00.000000000 Z
34
39
  dependencies:
35
40
  - !ruby/object:Gem::Dependency
36
41
  name: rexle
metadata.gz.sig CHANGED
Binary file