rsc 0.4.0 → 0.4.5

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 +5 -5
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/lib/rsc.rb +36 -32
  5. metadata +31 -27
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: abd05c2d664728dadb702b64f048d4464a3fcdae
4
- data.tar.gz: f3e3fecec0cc821b87bc448eed133fb7e789b07a
2
+ SHA256:
3
+ metadata.gz: b01f72dfa760e286914b6c423cbf9724deb0eb47edcf7fcb3ad110eb12a67922
4
+ data.tar.gz: bf1e28da451ab37f4708a7d1a96c02739752fdf8d2475a0c3c3674e9e03a53f4
5
5
  SHA512:
6
- metadata.gz: 668c6a4e39dc1a5c11aa6f55ec92c1cc30a42fbfd6568d4913b923cb3074eb727b84c074141d0f7104d4b9cb95e331a8a1f424453b92b29a653dd386b817890f
7
- data.tar.gz: f2dfbf1cf9d33c162754d33c0a06f105b43952431bc305d30ebf70b0ce48574110f99043e752ee8cb8ac819c70dfa1e2b92ffb518d5fce9f79e21b9b57b61985
6
+ metadata.gz: 1edee6d3f54ad895aaf0a6a87b0e078b6dc68f3ba5d9f31dc00e946d66878304af643c2acba4229cd8f9483002dabb3e59080e53032d838efc4dd32a5c380dc1
7
+ data.tar.gz: 18ca4264549c16234606ad3772c4fbfefe94baceb9b9b5a0f8e47a05c699277f883c63fbfdda5250d4fc3968b82cb8c4ae1b17261c8226dff48176bff4ab0751
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/rsc.rb CHANGED
@@ -7,55 +7,48 @@ require 'drb'
7
7
  require 'rexle'
8
8
 
9
9
 
10
- class Rse
10
+ class RseClient
11
11
 
12
- def self.call(x)
13
- RSC.new.get(x)
14
- end
12
+ def self.call(x) RSC.new.get(x) end
13
+ def self.get(x) RSC.new.get(x) end
14
+ def self.post(x, val) RSC.new.post(x, val) end
15
+ def self.delete(x) RSC.new.delete(x) end
16
+ def self.put(x, val) RSC.new.put(x, val) end
15
17
 
16
18
  end
17
19
 
18
20
  class RSC
21
+ using ColouredText
19
22
 
20
23
  class Package
24
+ using ColouredText
21
25
 
22
- def initialize(drb_obj, parent_url, package)
26
+ def initialize(drb_obj, package, debug: false)
27
+
28
+ @debug = debug
23
29
 
24
30
  @obj = drb_obj
31
+ drb_obj.package_methods(package).each do |method_name|
32
+
33
+ puts ('creating method ' + method_name).info if @debug
25
34
 
26
- @url = File.join(parent_url, package + '.rsf')
27
- doc = Rexle.new open(@url, 'UserAgent' => 'ClientRscript').read
28
- a = doc.root.xpath 'job/attribute::id'
29
-
30
- a.each do |attr|
31
- method_name = attr.value.gsub('-','_')
32
- method = "def %s(*args); run_job('%s', args) ; end" % \
33
- ([method_name] * 2)
34
- self.instance_eval(method)
35
+ methodx = "
36
+ def %s(*args, params: {})
37
+ @obj.run_job('%s','%s', params, args)
38
+ end" % [method_name, package, method_name]
39
+ self.instance_eval(methodx)
40
+
35
41
  end
36
42
 
37
43
  end
38
44
 
39
- private
40
-
41
- def run_job(method_name, *args)
42
-
43
- args.flatten!(1)
44
- params = args.pop if args.find {|x| x.is_a? Hash}
45
- a = ['//job:' + method_name, @url, args].flatten(1)
46
- params ? @obj.run(a, params) : @obj.run(a)
47
- end
48
-
49
45
  end
50
46
 
51
- def initialize(drb_hostname='rse', parent_url=nil, port: '61000')
47
+ def initialize(drb_hostname='rse', port: '61000', debug: false)
52
48
 
53
- @port = port
49
+ @port, @debug = port, debug
54
50
 
55
- if parent_url then
56
- @parent_url = parent_url
57
- drb_start(drb_hostname)
58
- end
51
+ drb_start(drb_hostname)
59
52
 
60
53
  end
61
54
 
@@ -71,7 +64,7 @@ class RSC
71
64
  s ? run_uri(s, :post, value: val) : @obj.post
72
65
  end
73
66
 
74
- def put(s)
67
+ def put(s=nil, val=nil)
75
68
  s ? run_uri(s, :put, value: val) : @obj.put
76
69
  end
77
70
 
@@ -88,7 +81,18 @@ class RSC
88
81
  end
89
82
 
90
83
  def method_missing(method_name, *args)
91
- Package.new @obj, @parent_url, method_name.to_s
84
+
85
+ if @debug then
86
+ puts 'method_missing'.info
87
+ puts ('method_name: ' + method_name.inspect).debug
88
+ end
89
+
90
+ begin
91
+ Package.new @obj, method_name.to_s, debug: @debug
92
+ rescue
93
+ # nil will be returned if there is no package by that name
94
+ end
95
+
92
96
  end
93
97
 
94
98
  def parse_uri(s)
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.0
4
+ version: 0.4.5
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
- NQSuZ7zyWeI96HlA2APuZGZqWdmDAqfXRVxp4RZDZ4L5hQNP3gOEKqUMinrZ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ZnGeNn0Bpr1N4lg547P
35
+ BxBwmRZJ2RVS09pLv4ZwZ9VG6pxhnhbGZhRvgwfpH8yzFxyix3K8FwNQcSUw+Qzs
36
+ sq6tf27j+XsE4ORGUcdVfJFm
32
37
  -----END CERTIFICATE-----
33
- date: 2018-06-02 00:00:00.000000000 Z
38
+ date: 2020-11-22 00:00:00.000000000 Z
34
39
  dependencies:
35
40
  - !ruby/object:Gem::Dependency
36
41
  name: rexle
@@ -38,20 +43,20 @@ dependencies:
38
43
  requirements:
39
44
  - - "~>"
40
45
  - !ruby/object:Gem::Version
41
- version: '1.0'
46
+ version: '1.5'
42
47
  - - ">="
43
48
  - !ruby/object:Gem::Version
44
- version: 1.4.12
49
+ version: 1.5.1
45
50
  type: :runtime
46
51
  prerelease: false
47
52
  version_requirements: !ruby/object:Gem::Requirement
48
53
  requirements:
49
54
  - - "~>"
50
55
  - !ruby/object:Gem::Version
51
- version: '1.0'
56
+ version: '1.5'
52
57
  - - ">="
53
58
  - !ruby/object:Gem::Version
54
- version: 1.4.12
59
+ version: 1.5.1
55
60
  description: formerly known as rcscript-client
56
61
  email: james@jamesrobertson.eu
57
62
  executables: []
@@ -78,8 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
83
  - !ruby/object:Gem::Version
79
84
  version: '0'
80
85
  requirements: []
81
- rubyforge_project:
82
- rubygems_version: 2.6.13
86
+ rubygems_version: 3.0.3
83
87
  signing_key:
84
88
  specification_version: 4
85
89
  summary: Objectifies remote calls to RSF packages and jobs which are run through a
metadata.gz.sig CHANGED
Binary file