rcscript-client 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rcscript-client.rb +4 -2
- metadata +3 -3
data/lib/rcscript-client.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'open-uri'
|
2
|
+
require 'cgi'
|
2
3
|
require 'rexml/document'
|
3
4
|
|
4
5
|
class RScriptClient
|
@@ -31,7 +32,8 @@ class RScriptClient
|
|
31
32
|
private
|
32
33
|
|
33
34
|
def jobs_to_methods(package)
|
34
|
-
url = "http://rorbuilder.info/r/heroku/%s.rsf" % package
|
35
|
+
#url = "http://rorbuilder.info/r/heroku/%s.rsf" % package
|
36
|
+
url = "http://%s/view-source/%s" % [@hostname, package]
|
35
37
|
puts 'url : ' + url
|
36
38
|
doc = Document.new(open(url, 'UserAgent' => 'ClientRscript').read)
|
37
39
|
a = XPath.match(doc.root, 'job/attribute::id')
|
@@ -72,7 +74,7 @@ class RScriptClient
|
|
72
74
|
def query_method(method, params={})
|
73
75
|
base_url = "http://#{@hostname}/do/#{@package}/"
|
74
76
|
param_list = params.to_a.map{|x| x.join('=')}.join('&')
|
75
|
-
url = "%s%s?%s" % [base_url, method.gsub('_','-'), param_list]
|
77
|
+
url = "%s%s?%s" % [base_url, method.gsub('_','-'), CGI.escape(param_list)]
|
76
78
|
response = open(url, 'UserAgent' => 'RScriptClient')
|
77
79
|
@result = response.read
|
78
80
|
@return_type[response.content_type].call
|
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.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors: []
|
7
7
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-03-13 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -50,6 +50,6 @@ rubyforge_project:
|
|
50
50
|
rubygems_version: 1.3.5
|
51
51
|
signing_key:
|
52
52
|
specification_version: 3
|
53
|
-
summary: RCscript-client is a utility for
|
53
|
+
summary: RCscript-client is a utility for executing S-Rscript services
|
54
54
|
test_files: []
|
55
55
|
|