Created
August 13, 2010 08:44
-
-
Save jrobertson/522559 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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