Created
July 28, 2010 02:28
-
-
Save jwang/493199 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| john-wangs-macbook-pro:dubious jwang392$ ./script/build.sh | |
| testing/SimpleJava.java:3: package javax.servlet.http does not exist | |
| import javax.servlet.http.*; | |
| ^ | |
| testing/SimpleJava.java:4: package com.google.apphosting.api does not exist | |
| import com.google.apphosting.api.ApiProxy; | |
| ^ | |
| testing/SimpleJava.java:5: package com.google.apphosting.api.ApiProxy does not exist | |
| import com.google.apphosting.api.ApiProxy.Environment; | |
| ^ | |
| testing/SimpleJava.java:7: cannot find symbol | |
| symbol: class HttpServlet | |
| public class SimpleJava extends HttpServlet { | |
| ^ | |
| testing/SimpleJava.java:9: cannot find symbol | |
| symbol : class HttpServletRequest | |
| location: class testing.SimpleJava | |
| public void doGet(HttpServletRequest req, HttpServletResponse resp) | |
| ^ | |
| testing/SimpleJava.java:9: cannot find symbol | |
| symbol : class HttpServletResponse | |
| location: class testing.SimpleJava | |
| public void doGet(HttpServletRequest req, HttpServletResponse resp) | |
| ^ | |
| testing/SimpleJava.java:11: cannot find symbol | |
| symbol : class Environment | |
| location: class testing.SimpleJava | |
| Environment env = ApiProxy.getCurrentEnvironment(); | |
| ^ | |
| testing/SimpleJava.java:11: cannot find symbol | |
| symbol : variable ApiProxy | |
| location: class testing.SimpleJava | |
| Environment env = ApiProxy.getCurrentEnvironment(); | |
| ^ | |
| 8 errors | |
| testing/SimpleDuby.duby:1: Class 'javax.servlet.http.HttpServlet' not found. | |
| import javax.servlet.http.HttpServlet | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| testing/SimpleDuby.duby:2: Class 'com.google.apphosting.api.ApiProxy' not found. | |
| import com.google.apphosting.api.ApiProxy | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| testing/SimpleDuby.duby:3: Class 'java.lang.HttpServlet' not found. | |
| ^ | |
| class SimpleDuby < HttpServlet | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ^ | |
| def doGet(req, resp) | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
| env = ApiProxy.getCurrentEnvironment | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| raw_ver = env.getVersionId | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| version = raw_ver.substring(0, raw_ver.lastIndexOf(".")) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| # print out some stuff | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| message = <<EOF | |
| ^^^^^^^^^^^^^^^^^^^^ | |
| app_id: #{env.getAppId} | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| version: #{version} | |
| ^^^^^^^^^^^^^^^^^^^^^ | |
| domain: #{env.getAuthDomain} | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ^ | |
| RequestURI: #{req.getRequestURI} | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| PathInfo: #{req.getPathInfo || "nil"} | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ServletPath: #{req.getServletPath} | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| EOF | |
| ^^^^ | |
| resp.setContentType("text/plain") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| resp.getWriter.println(message) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| end | |
| ^^^ | |
| dubious/ScopedParameterMap.java:5: package javax.servlet.http does not exist | |
| import javax.servlet.http.HttpServletRequest; | |
| ^ | |
| dubious/ScopedParameterMap.java:12: cannot find symbol | |
| symbol : class HttpServletRequest | |
| location: class dubious.ScopedParameterMap | |
| public static Map params(HttpServletRequest req, String model) { | |
| ^ | |
| 2 errors | |
| dubious/params.duby:1: Class 'javax.servlet.http.HttpServletRequest' not found. | |
| import javax.servlet.http.HttpServletRequest | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| dubious/params.duby:6: Class 'java.lang.HttpServletRequest' not found. | |
| def initialize(request:HttpServletRequest) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @request = request | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
| path_info = request.getPathInfo || "/" | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| uri_parts = path_info.substring(1, path_info.length).split('/') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @controller = request.getServletPath | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @action = @id = "" # initialize as String | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| if uri_parts.length == 0 | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| # index | |
| ^^^^^^^^^^^^^^ | |
| elsif uri_parts[0].matches("^\\d+$") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @id = uri_parts[0] | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| if uri_parts.length > 1 | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @action = uri_parts[1] | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| else | |
| ^^^^^^^^^^^ | |
| @action = 'show' | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^^^^^ | |
| else | |
| ^^^^^^^^^^ | |
| @action = uri_parts[0] | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^^^ | |
| end | |
| ^^^^^ | |
| dubious/form_helper.duby:6: Class 'java.lang.Params' not found. | |
| def initialize(model:Model, params:Params) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @a = model.properties | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @kind = model.kind.toLowerCase | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @params = params | |
| ^^^^^^^^^^^^^^^^^^^^^ | |
| @method = params.action.equals('edit') ? 'put' : 'post' | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @action = params.action.equals('edit') ? params.show : params.index | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @token = '123456' | |
| ^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^ | |
| dubious/action_controller.duby:2: Class 'javax.servlet.ServletConfig' not found. | |
| import javax.servlet.ServletConfig | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| dubious/action_controller.duby:7: Class 'dubious.Params' not found. | |
| import dubious.Params | |
| ^^^^^^^^^^^^^^^^^^^^^ | |
| dubious/action_controller.duby:8: Class 'dubious.FormHelper' not found. | |
| import dubious.FormHelper | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| dubious/action_controller.duby:11: Class 'javax.servlet.http.HttpServlet' not found. | |
| ^ | |
| class ActionController < HttpServlet | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ^ | |
| # expect URI, String or Integer | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def index; Object(Integer.valueOf(404)); end | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def show; Object(Integer.valueOf(404)); end | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def new; Object(Integer.valueOf(404)); end | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def edit; Object(Integer.valueOf(404)); end | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def delete; Object(Integer.valueOf(404)); end | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def create; Object(Integer.valueOf(404)); end | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def update; Object(Integer.valueOf(404)); end | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ^ | |
| def set_params(params:Params); returns :void | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @params_obj = params | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def params; returns Params | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @params_obj | |
| ^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def set_flash_notice(content:String); returns :void | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @flash_str = content | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def flash_notice | |
| ^^^^^^^^^^^^^^^^^^^ | |
| @flash_str || "" | |
| ^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| # for simplicity, we split on this token | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def yield_body; "@@_YIELD_BODY_@@"; end | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ^ | |
| def render(content:String, layout:String); returns String | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| wrapper = layout.split(yield_body) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| if wrapper.length == 2 | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| wrapper[0] + content + wrapper[1] | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| else | |
| ^^^^^^^^^ | |
| layout + "\n\n<!-- Oops, yield_body missing -->" | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def render(content:String); returns String | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| content | |
| ^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def redirect_to(link:String); returns URI | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| URI.new(link) | |
| ^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| # accepts various types, and creates the appropriate response | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def action_response(response:HttpServletResponse, payload:Object) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| returns :void | |
| ^^^^^^^^^^^^^^^^^^ | |
| if payload.kind_of?(URI) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| location = payload.toString | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| if location.startsWith('http') or location.startsWith('/') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| response.sendRedirect(location); nil | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| else | |
| ^^^^^^^^^^^ | |
| response.setStatus(500) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| response.getWriter.write("Invalid redirect location") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^^^^^ | |
| elsif payload.kind_of?(String) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| response.setContentType("text/html; charset=UTF-8") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| response.getWriter.write(payload.toString) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| elsif payload.kind_of?(Integer) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| response.setStatus(Integer(payload).intValue) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| response.sendRedirect("#{payload}.html"); nil | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| else | |
| ^^^^^^^^^ | |
| response.setStatus(500) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| response.getWriter.write("Unsupported Response Type") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| # route request to the approprite action | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def action_request(request:HttpServletRequest, method:String); returns Object | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| set_params Params.new(request) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| method = request.getParameter('_method') || method | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| if method.equals('get') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| if params.action.equals("") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| index | |
| ^^^^^^^^^^^^^^ | |
| elsif params.action.equals('show') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| show | |
| ^^^^^^^^^^^^^ | |
| elsif params.action.equals('new') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| new | |
| ^^^^^^^^^^^^ | |
| elsif params.action.equals('edit') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| edit | |
| ^^^^^^^^^^^^^ | |
| else | |
| ^^^^^^^^^^^ | |
| Object(Integer.valueOf(404)) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^^^^^ | |
| else | |
| ^^^^^^^^^ | |
| if invalid_authenticity_token request.getParameter('authenticity_token') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| Object(Integer.valueOf(422)) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| elsif method.equals('delete') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| delete | |
| ^^^^^^^^^^^^^^^ | |
| elsif method.equals('post') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| create | |
| ^^^^^^^^^^^^^^^ | |
| elsif method.equals('put') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| update | |
| ^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^^^^^ | |
| end | |
| ^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| private | |
| ^^^^^^^^^^ | |
| ^ | |
| def invalid_authenticity_token(token:String) # TODO | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| token.equals("") ? true : false | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| public | |
| ^^^^^^^^^ | |
| ^ | |
| def form_for(model:Model) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| FormHelper.new(model, params) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| # ActionView::Helpers::TagHelper | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| # | |
| ^^^^ | |
| # cdata_section | |
| ^^^^^^^^^^^^^^^^^^ | |
| # escape_once | |
| ^^^^^^^^^^^^^^^^ | |
| ^ | |
| # tag() and content_tag() are now the same method | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| # pass nil (instead of an empty string) to get tag() | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def _tag(name:String, value:String, options:HashMap, | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| open:boolean, escape:boolean) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| sb = StringBuilder.new("<#{name}") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| keys = options.keySet.toArray; Arrays.sort(keys) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| keys.each { |k| sb.append(" #{k}=\"#{options.get(k)}\"") } | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| if value.nil? | |
| ^^^^^^^^^^^^^^^^^^ | |
| sb.append(open ? ">" : " />") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| else | |
| ^^^^^^^^^ | |
| sb.append(">#{escape ? h(value) : value}</#{name}>") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^^^ | |
| sb.toString | |
| ^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def tag(name:String, options:HashMap, | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| open:boolean, escape:boolean) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| _tag(name, nil, options, open, escape) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def tag(name:String, options:HashMap, open:boolean) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| _tag(name, nil, options, open, true) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def tag(name:String, options:HashMap) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| _tag(name, nil, options, false, true) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def tag(name:String) | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
| _tag(name, nil, HashMap.new, false, true) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def content_tag(name:String, value:String, options:HashMap, | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| open:boolean, escape:boolean) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| _tag(name, value, options, open, escape) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def content_tag(name:String, value:String, options:HashMap, open:boolean) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| _tag(name, value, options, open, true) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def content_tag(name:String, value:String, options:HashMap) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| _tag(name, value, options, false, true) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def content_tag(name:String, value:String) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| _tag(name, value, HashMap.new, false, true) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def content_tag(name:String) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| _tag(name, "", HashMap.new, false, true) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| # ActionView::Helpers::UrlHelper | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| # | |
| ^^^^ | |
| # button_to | |
| ^^^^^^^^^^^^^^ | |
| # current_page? | |
| ^^^^^^^^^^^^^^^^^^ | |
| # link_to_if | |
| ^^^^^^^^^^^^^^^ | |
| # link_to_unless | |
| ^^^^^^^^^^^^^^^^^^^ | |
| # link_to_unless_current | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| # mail_to | |
| ^^^^^^^^^^^^ | |
| # url_for | |
| ^^^^^^^^^^^^ | |
| ^ | |
| def link_to(value:String, options:HashMap, html_options:HashMap) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| # TODO: parse options (:confirm, :popup, :method) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| content_tag("a", value, html_options, false, false) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def link_to(value:String, options:HashMap) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| link_to(value, options, HashMap.new) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def link_to(value:String, url:String, html_options:HashMap) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| html_options.put("href", url) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| link_to(value, html_options, html_options) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def link_to(value:String, url:String) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| link_to(value, url, HashMap.new) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| # "<a #{href_attr}#{tag_options}>#{name || url}</a>".html_safe | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ^ | |
| # ActionView::Helpers::AssetTagHelper | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| # | |
| ^^^^ | |
| # cache_asset_timestamps | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| # cache_asset_timestamps= | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| # auto_discovery_link_tag | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| # path_to_image | |
| ^^^^^^^^^^^^^^^^^^ | |
| # path_to_javascript | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
| # path_to_stylesheet | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
| # register_javascript_expansion | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| # register_javascript_include_default | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| # register_stylesheet_expansion | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ^ | |
| # always use AssetTimestampsCache | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def add_asset_timestamp(source:String) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @asset_timestamps_cache.get(source) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def image_path(source:String) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| source = "/images/#{source}" unless source.startsWith('/') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| add_asset_timestamp(source) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def javascript_path(source:String) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| source += ".js" unless source.endsWith(".js") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| source = "/javascripts/#{source}" unless source.startsWith('/') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| add_asset_timestamp(source) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def stylesheet_path(source:String) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| source += ".css" unless source.endsWith(".css") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| source = "/stylesheets/#{source}" unless source.startsWith('/') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| add_asset_timestamp(source) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def image_tag(source:String, options:HashMap) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| source = source.startsWith('http') ? source : image_path(source) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| options.put("src", source) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| options.put("alt", "") unless options.containsKey("alt") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| if options.containsKey("size") && | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| String(options.get("size")).matches("\\d+x\\d+") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| values = String(options.get("size")).split("x") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| options.put("width", values[0]) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| options.put("height", values[1]) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| options.remove("size") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^^^ | |
| tag("img", options) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def image_tag(source:String) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| image_tag(source, HashMap.new) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def javascript_include_tag(text:String) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| text = javascript_path(text) unless text.startsWith("http") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| options = HashMap.new | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| options.put("src", text) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| options.put("type", "text/javascript") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| content_tag("script", "", options) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def stylesheet_link_tag(text:String) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| text = stylesheet_path(text) unless text.startsWith("http") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| options = HashMap.new | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| options.put("href", text) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| options.put("rel", "stylesheet") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| options.put("type", "text/css") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| options.put("media", "screen") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| tag("link", options) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| # init the servlet | |
| ^^^^^^^^^^^^^^^^^^^^^ | |
| ^ | |
| def init(config:ServletConfig) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @asset_timestamps_cache = AssetTimestampsCache.new | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| # escape special characters | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ^ | |
| def self.initialize; returns :void | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @escape_pattern = Pattern.compile("[<>&'\"]") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @escaped = HashMap.new | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @escaped.put("<", "<") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @escaped.put(">", ">") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @escaped.put("&", "&") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @escaped.put("\"", """) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @escaped.put("'", "'") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def self.html_escape(text:String) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| return "" unless text | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| matcher = @escape_pattern.matcher(text) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| buffer = StringBuffer.new | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| while matcher.find | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
| replacement = String(@escaped.get(matcher.group)) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| matcher.appendReplacement(buffer, replacement) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^^^ | |
| matcher.appendTail(buffer) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| return buffer.toString | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def self.html_escape(o:Object) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| return "" unless o | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
| html_escape(o.toString) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def h(text:String) | |
| ^^^^^^^^^^^^^^^^^^^^^ | |
| ActionController.html_escape(text) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def h(o:Object) | |
| ^^^^^^^^^^^^^^^^^^ | |
| ActionController.html_escape(o) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| end | |
| ^^^ | |
| Inference Error: | |
| models/contacts.duby:6: Class 'com.google.appengine.api.datastore.Text' not found. | |
| property 'summary', Text | |
| ^^^^ | |
| models/contacts.duby:7: Class 'com.google.appengine.api.datastore.Link' not found. | |
| property 'url', Link | |
| ^^^^ | |
| models/contacts.duby:8: Class 'com.google.appengine.api.datastore.PostalAddress' not found. | |
| property 'address', PostalAddress | |
| ^^^^^^^^^^^^^ | |
| models/contacts.duby:9: Class 'com.google.appengine.api.datastore.PhoneNumber' not found. | |
| property 'phone', PhoneNumber | |
| ^^^^^^^^^^^ | |
| models/contacts.duby:5: undefined method `body=' for ErrorNode:Duby::AST::ErrorNode | |
| property 'title', String | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| controllers/application_controller.duby:2: Class 'dubious.ActionController' not found. | |
| ^ | |
| class ApplicationController < ActionController | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ^ | |
| end | |
| ^^^ | |
| controllers/shout_controller.duby:1: Class 'com.google.appengine.api.datastore.Text' not found. | |
| import com.google.appengine.api.datastore.Text | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| controllers/shout_controller.duby:9: Class 'java.lang.ApplicationController' not found. | |
| ^ | |
| class ShoutController < ApplicationController | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ^ | |
| # GET /shout | |
| ^^^^^^^^^^^^^^^ | |
| def doGet(request, response) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @shouts = Shout.all.run | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @page_title = 'Shout' | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @page_content = list_erb | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| response.setContentType("text/html; charset=UTF-8") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| response.getWriter.write(main_erb) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| # POST /shout | |
| ^^^^^^^^^^^^^^^^ | |
| def doPost(request, response) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| shout = Shout.new | |
| ^^^^^^^^^^^^^^^^^^^^^^ | |
| shout.title = request.getParameter('title') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| shout.body = request.getParameter('body') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| shout.save | |
| ^^^^^^^^^^^^^^^ | |
| doGet(request, response) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def_edb(list_erb, 'views/shout/list.html.erb') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def_edb(main_erb, 'views/layouts/application.html.erb') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^ | |
| controllers/source_controller.duby:5: Class 'java.lang.ApplicationController' not found. | |
| ^ | |
| class SourceController < ApplicationController | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ^ | |
| # GET /source/* | |
| ^^^^^^^^^^^^^^^^^^ | |
| def doGet(request, response) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @base = request.getRequestURI | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @base += '/' unless @base.endsWith('/') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @path = request.getPathInfo || "" | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| node = File.new(System.getProperty('user.dir') + @path) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| if node.isDirectory | |
| ^^^^^^^^^^^^^^^^^^^^^^^^ | |
| @entries = Array.sort(node.listFiles) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| response.getWriter.write(list_erb) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| else | |
| ^^^^^^^^^ | |
| if @path.matches "^\/public\/.+\.(ico|gif|jpe?g|png)$" | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| response.sendRedirect @path.substring(7, @path.length); nil | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| else | |
| ^^^^^^^^^^^ | |
| @content = node.isFile ? Io.read(node) : 'Sorry, no file' | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| response.getWriter.write(show_erb) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^^^^^ | |
| end | |
| ^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def_edb(show_erb, 'views/source/show.html.erb') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def_edb(list_erb, 'views/source/list.html.erb') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^ | |
| controllers/info_properties_controller.duby:1: Class 'com.google.apphosting.api.ApiProxy' not found. | |
| import com.google.apphosting.api.ApiProxy; | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| controllers/info_properties_controller.duby:6: Class 'java.lang.ApplicationController' not found. | |
| ^ | |
| class InfoPropertiesController < ApplicationController | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ^ | |
| # GET /info/properties | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def doGet(request, response) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| rows = tr 'Mirah version', build_info('mirah') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| rows += tr 'Bitescript version', build_info('bitescript') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| rows += tr 'Dubious version', build_info('dubious') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| rows += tr 'MirahModel version', build_info('model') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| rows += tr 'Java version', prop('java.specification.version'), | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| prop('java.vm.version') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| rows += tr 'Java vm name', prop('java.vm.name') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| rows += tr 'Environment', prop('runtime.environment').toLowerCase | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| rows += tr 'Runtime version', prop('runtime.version') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| rows += tr 'Auth domain', ApiProxy.getCurrentEnvironment.getAuthDomain | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| rows += tr 'App id', prop('application.id') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| rows += tr 'App version', prop('application.version') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| response.getWriter.write("<table><tbody>#{rows}</tbody></table>") | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^^ | |
| ^ | |
| def build_info(tool:String) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| out = String[2] | |
| ^^^^^^^^^^^^^^^^^^^^ | |
| props = Properties.new | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| begin | |
| ^^^^^^^^^^ | |
| props.load(FileInputStream.new("config/build.properties")) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| out[0] = props.getProperty("#{tool}.version.commit").substring(0,7) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| out[1] = props.getProperty("#{tool}.version.time").substring(0,10) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| rescue | |
| ^^^^^^^^^^^ | |
| out[0] = 'unknown'; out[1] = "" | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^^^ | |
| out | |
| ^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def prop(s:String) | |
| ^^^^^^^^^^^^^^^^^^^^^ | |
| s = "com.google.appengine.#{s}" unless s.startsWith('java.') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| System.getProperty(s) || "" | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def tr(key:String, val:String) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| "<tr><td>#{key}</td><td colspan='2'>#{val}</td></tr>" | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def tr(key:String, val:String, ext:String) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| "<tr><td>#{key}</td><td class='mono'>#{val}</td><td>#{ext}</td></tr>" | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def tr(key:String, val:String[]) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| tr(key, val[0], val[1]) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| end | |
| ^^^ | |
| controllers/contacts_controller.duby:3: Class 'models.ApplicationController' not found. | |
| ^ | |
| class ContactsController < ApplicationController | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ^ | |
| # GET /contacts | |
| ^^^^^^^^^^^^^^^^^^ | |
| def index | |
| ^^^^^^^^^^^^ | |
| @contacts = Contact.all.run | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| render index_erb, main_erb | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| # GET /contacts/1 | |
| ^^^^^^^^^^^^^^^^^^^^ | |
| def show | |
| ^^^^^^^^^^^ | |
| @contact = Contact.get(params.id) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| render show_erb, main_erb | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| # GET /contacts/new | |
| ^^^^^^^^^^^^^^^^^^^^^^ | |
| def new | |
| ^^^^^^^^^^ | |
| @contact = Contact.new | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| render new_erb, main_erb | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| # GET /contacts/1/edit | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def edit | |
| ^^^^^^^^^^^ | |
| @contact = Contact.get(params.id) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| render edit_erb, main_erb | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| # DELETE /contacts/1 | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
| def delete | |
| ^^^^^^^^^^^^^ | |
| Contact.delete(Contact.get(params.id).key) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| redirect_to params.index | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| # POST /contacts | |
| ^^^^^^^^^^^^^^^^^^^ | |
| def create | |
| ^^^^^^^^^^^^^ | |
| Contact.new.update(params.for('contact')).save | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| redirect_to params.index | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| # PUT /contacts/1 | |
| ^^^^^^^^^^^^^^^^^^^^ | |
| def update | |
| ^^^^^^^^^^^^^ | |
| Contact.get(params.id).update(params.for('contact')).save | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| redirect_to params.show | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def doGet(request, response) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| action_response(response, action_request(request, 'get')) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| def doPost(request, response) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| action_response(response, action_request(request, 'post')) | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^^^^ | |
| ^ | |
| # render templates | |
| ^^^^^^^^^^^^^^^^^^^^^ | |
| def_edb(index_erb, 'views/contacts/index.html.erb') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def_edb(show_erb, 'views/contacts/show.html.erb') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def_edb(new_erb, 'views/contacts/new.html.erb') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def_edb(edit_erb, 'views/contacts/edit.html.erb') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| def_edb(main_erb, 'views/layouts/contacts.html.erb') | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| end | |
| ^^^ | |
| models/* : no such file or directory | |
| controllers/* : no such file or directory | |
| testing/* : no such file or directory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment