Skip to content

Commit

Permalink
moved load_rsf_jobs to r.rsf
Browse files Browse the repository at this point in the history
  • Loading branch information
James Robertson committed Oct 21, 2009
1 parent 5696931 commit a080717
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions sinatra_rscript.rb
Expand Up @@ -111,28 +111,7 @@ def run_rcscript(rsf_url, jobs, arg='')
rs.run(args)
end

def load_rsf_job(package_id, job, extension='.html')
jobs = "//job:" + job
url = "%s%s.rsf" % [@@url_base, package_id]

result = run_rcscript(url, jobs)

# get the code
code = [result].flatten.join("\n")
proc1 = Proc.new {|params, args|
h = {'.xml' => 'text/xml','.html' => 'text/html','.txt' => 'text/plain'}
@content_type = h[extension]

out = eval(code)

[out, @content_type]
}
route = "%s/%s" % [package_id, job]
@@routes[route] = {:route => :get, :proc => proc1}
content_type 'text/plain', :charset => 'utf-8' if defined? content_type

'job loaded'
end
end

# projectx request
Expand Down

0 comments on commit a080717

Please sign in to comment.