rcscript-client 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data/lib/rcscript-client.rb +15 -6
- data.tar.gz.sig +0 -0
- metadata +30 -24
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 77c0b880a7ad3a0cf456d0c1e973619b170599a47bad90b1fa2833ea13c07bde
|
4
|
+
data.tar.gz: 6fd566cb7154146f41c27b5c2aef8084ef10c09afff43facf59720e4d94fe8ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72f79aa75926612bb6c3d64ea69d2fdb95f3f3a19d9cd5c61bacfb54f975cdb7d905c1ad374da25e4781e826e4e36b6e67dc0339f613ec0923781d50445251b5
|
7
|
+
data.tar.gz: bf5ba617e96ac2f0192f12594d437169e70474821ac50823f0e77340d2eee94d57a19894ecdbdb568a1f09eff3220baa2860339caae31893d5bd578c90c41375
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/rcscript-client.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# file: rcscript-client.rb
|
4
|
+
|
1
5
|
require 'open-uri'
|
2
6
|
require 'cgi'
|
3
7
|
require 'rexml/document'
|
4
8
|
|
5
|
-
class
|
9
|
+
class RCScriptClient
|
6
10
|
include REXML
|
7
11
|
|
8
12
|
attr_reader :doc, :result, :text
|
@@ -10,9 +14,11 @@ class RScriptClient
|
|
10
14
|
|
11
15
|
def initialize(opts={})
|
12
16
|
|
13
|
-
o = {:hostname => 'rscript.heroku.com', :package => ''}
|
17
|
+
o = {:hostname => 'rscript.heroku.com', :package => '', https: false}\
|
18
|
+
.merge(opts)
|
14
19
|
@hostname = o[:hostname]
|
15
20
|
@package = o[:package]
|
21
|
+
@protocol = o[:https] ? 'https' : 'http'
|
16
22
|
|
17
23
|
if @package.length > 0 then
|
18
24
|
jobs_to_methods(@package)
|
@@ -32,10 +38,12 @@ class RScriptClient
|
|
32
38
|
private
|
33
39
|
|
34
40
|
def jobs_to_methods(package)
|
35
|
-
#url = "http://
|
36
|
-
url = "
|
41
|
+
#url = "http://a0.jamesrobertson.me.uk/rorb/r/heroku/%s.rsf" % package
|
42
|
+
url = "%s://%s/source/%s" % [@protocol, @hostname, package]
|
37
43
|
puts 'url : ' + url
|
38
|
-
|
44
|
+
buffer = URI.open(url, 'UserAgent' => 'ClientRscript').read
|
45
|
+
puts 'buffer: ' + buffer.inspect
|
46
|
+
doc = Document.new(buffer)
|
39
47
|
a = XPath.match(doc.root, 'job/attribute::id')
|
40
48
|
a.each do |attr|
|
41
49
|
method_name = attr.value.to_s.gsub('-','_')
|
@@ -96,7 +104,8 @@ EOF
|
|
96
104
|
base_url = "http://#{@hostname}/do/#{@package}/"
|
97
105
|
param_list = params.to_a.map{|param, value| "%s=%s" % [param, CGI.escape(value)]}.join('&')
|
98
106
|
url = "%s%s?%s" % [base_url, method.gsub('_','-'), param_list]
|
99
|
-
|
107
|
+
puts 'url: ' + url.inspect
|
108
|
+
response = URI.open(url, 'UserAgent' => 'RScriptClient')
|
100
109
|
@result = response.read
|
101
110
|
@return_type[response.content_type].call
|
102
111
|
return self
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rcscript-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,29 +10,36 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
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Ge0hjGM550umkp2B6t3veAK
|
26
|
+
8SbopQIDAQABo4GKMIGHMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
|
27
|
+
BBQRlK2zX8TebOXtdgN/NSSoK0spajAmBgNVHREEHzAdgRtnZW1tYXN0ZXJAamFt
|
28
|
+
ZXNyb2JlcnRzb24uZXUwJgYDVR0SBB8wHYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0
|
29
|
+
c29uLmV1MA0GCSqGSIb3DQEBCwUAA4IBgQAsY5n3LECN8k1kfmhOwDVegBPK0yTJ
|
30
|
+
g0cOB3t/atgjvzfner5UI4Em8sbR+5vEFutDiedNJNhWYHpJQkWPXApx5Qb4nxqO
|
31
|
+
0ZJdMkw8zfS//MWLlmkWUt0uZvtN4OQlj4GBoViDYNRp71q/GbXnyKkEIxynl5yO
|
32
|
+
9VF6waYEMoX5Gw8FeVf2ysMLxg3gXr9HCEhVxUYKntwUmqaZdfjUuV3YhOFH2QB1
|
33
|
+
uU11JXrCWIpqBuOi6qJ6wfDlslHGdc78ohCwgD56ploSrZx/DMFeNqHHfS4IpXfM
|
34
|
+
SY1xIACWElmoYRsQtVXnYI23hNRtRU9Cs4H8vgarJu7kGD8eXJ0iNSx5ya1yVFiT
|
35
|
+
l//QmNN1PnsgftCvlpeZ61/AIGoGt+8/Gph01TRtHOA9VsgDrlSTqLUUQ7V6R/we
|
36
|
+
VO6qa1oMueCjGfwrKLuGIvYkeTUeMrgxMmfvXeJ/jgj2XAI5Q84Q6UbSPY5EN76d
|
37
|
+
QTK5gYMz0dEaWen2t+dvqlPJ9cFUAKsf5M8=
|
31
38
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
39
|
+
date: 2023-03-13 00:00:00.000000000 Z
|
33
40
|
dependencies: []
|
34
41
|
description:
|
35
|
-
email:
|
42
|
+
email: digital.robertson@gmail.com
|
36
43
|
executables: []
|
37
44
|
extensions: []
|
38
45
|
extra_rdoc_files: []
|
@@ -48,17 +55,16 @@ require_paths:
|
|
48
55
|
- lib
|
49
56
|
required_ruby_version: !ruby/object:Gem::Requirement
|
50
57
|
requirements:
|
51
|
-
- -
|
58
|
+
- - ">="
|
52
59
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
60
|
+
version: 2.1.2
|
54
61
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
62
|
requirements:
|
56
|
-
- -
|
63
|
+
- - ">="
|
57
64
|
- !ruby/object:Gem::Version
|
58
65
|
version: '0'
|
59
66
|
requirements: []
|
60
|
-
|
61
|
-
rubygems_version: 2.0.0.rc.2
|
67
|
+
rubygems_version: 3.4.4
|
62
68
|
signing_key:
|
63
69
|
specification_version: 4
|
64
70
|
summary: RCscript-client is a utility for remotely executing Ruby Scripting Files
|
metadata.gz.sig
CHANGED
Binary file
|