rscript-server 0.1.2 → 0.1.3

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.
Files changed (2) hide show
  1. data/lib/rscript-server.rb +6 -12
  2. metadata +1 -1
@@ -18,6 +18,7 @@ class RScriptServer
18
18
  params = {}
19
19
  @app = AppRoutes.new(params)
20
20
  application(params)
21
+ @rscript = RScript.new()
21
22
 
22
23
  @content_type = 'text/html'
23
24
 
@@ -53,7 +54,6 @@ class RScriptServer
53
54
 
54
55
  jobs = "//job:" + job
55
56
  url = "%s%s.rsf" % [@url_base, package]
56
-
57
57
  run(url, jobs, params)
58
58
  end
59
59
 
@@ -63,7 +63,6 @@ class RScriptServer
63
63
  raw_args = params[:splat]
64
64
  args = raw_args.join.split('/')[1..-1]
65
65
  url = "%s%s.rsf" % [@url_base, package]
66
-
67
66
  run(url, jobs, params, args)
68
67
  end
69
68
 
@@ -71,7 +70,6 @@ class RScriptServer
71
70
 
72
71
  url = "%s%s.rsf" % [@url_base, package]
73
72
  @content_type = 'text/plain'
74
- puts 'url : ' + url
75
73
  open(url, "UserAgent" => 'RscriptServer').read
76
74
  end
77
75
 
@@ -92,21 +90,17 @@ class RScriptServer
92
90
  @app.get(arg, &block)
93
91
  end
94
92
 
95
- def run_rcscript(rsf_url, jobs, arg='')
96
- ajobs = jobs.split(/\s/)
97
- args = [rsf_url, ajobs, arg].flatten
98
- rs = RScript.new()
99
- rs.run(args)
93
+ def run_rcscript(rsf_url, jobs, raw_args=[])
94
+ @rscript.read([rsf_url, jobs.split(/\s/), raw_args].flatten)
100
95
  end
101
96
 
102
- def run(url, jobs, params={}, qargs=[])
97
+ def run(url, jobs, *qargs)
103
98
  result, args = run_rcscript(url, jobs, qargs)
104
-
99
+
105
100
  begin
106
- eval(result)
101
+ eval result
107
102
  rescue
108
103
  "rws error: " + ($!).to_s
109
104
  end
110
105
  end
111
-
112
106
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rscript-server
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.2
5
+ version: 0.1.3
6
6
  platform: ruby
7
7
  authors: []
8
8