Skip to content

Instantly share code, notes, and snippets.

@jrobertson
Created August 13, 2010 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrobertson/522559 to your computer and use it in GitHub Desktop.
Save jrobertson/522559 to your computer and use it in GitHub Desktop.
require 'hashcache'
require 'rscript'
require 'rexml/document'
include REXML
@@get_routes = {}; @@post_routes = {}
@@services = {}
@@templates = {}
@content_type = 'text/html'
@rsf_cache = HashCache.new(cache: 5)
def set(a, h)
end
def run_rcscript(rsf_url, jobs, arg='')
ajobs = jobs.split(/\s/)
args = [rsf_url, ajobs, arg].flatten
unless rsf_url[/nocache=1$/] then
@rsf_cache.read(args.join) {RScript.new().read(args)}
else
@rsf_cache.reset
RScript.new().read(args)
end
end
def run(url, jobs, qargs='')
result, args = run_rcscript(url, jobs, qargs)
eval(result)
end
url_base = 'http://rorbuilder.info/r/heroku/' #
@@url_base = 'http://rorbuilder.info/r/heroku/' #
doc = Document.new(File.open('server.xml','r').read)
server_name = XPath.first(doc.root, 'summary/name/text()').to_s
#url = url_base + 'startup.rsf'
url = url_base + 'startup-level1.rsf'
run(url, '//job:bootstrap', server_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment