{"id":19491042,"url":"https://github.com/quark-zju/rbprocessor","last_synced_at":"2026-05-13T22:33:07.488Z","repository":{"id":4598050,"uuid":"5740833","full_name":"quark-zju/rbprocessor","owner":"quark-zju","description":"RbProcessor is a CodeProcessor plug-in that use Ruby script to preprocess and postprocess code.","archived":false,"fork":false,"pushed_at":"2013-02-23T16:59:39.000Z","size":140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-25T19:43:38.818Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quark-zju.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-09T19:25:26.000Z","updated_at":"2014-04-26T00:56:02.000Z","dependencies_parsed_at":"2022-08-27T16:00:49.236Z","dependency_job_id":null,"html_url":"https://github.com/quark-zju/rbprocessor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/quark-zju/rbprocessor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quark-zju%2Frbprocessor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quark-zju%2Frbprocessor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quark-zju%2Frbprocessor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quark-zju%2Frbprocessor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quark-zju","download_url":"https://codeload.github.com/quark-zju/rbprocessor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quark-zju%2Frbprocessor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33002718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T21:15:24.744Z","updated_at":"2026-05-13T22:33:07.468Z","avatar_url":"https://github.com/quark-zju.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"RbProcessor is a CodeProcessor plug-in that use Ruby script to preprocess and postprocess code.\n\n[CodeProcessor](http://community.topcoder.com/contest/classes/CodeProcessor/CodeProcessor.jar) is a [TopCoder Arena plug-in](http://community.topcoder.com/tc?module=Static\u0026d1=applet\u0026d2=plugins).\n\nInstallation\n============\n1. Download `rbprocessor.jar` from [download page](/quark-zju/rbprocessor/downloads).\n2. Append `rbprocessor.jar` to CodeProcessor class path.\n   * Use ':' as separator in Linux.\n3. Configure CodeProcessor\n   * Use 'popsedit.EntryPoint' or Standard Editor as the Editor\n     * [Poopsedit](http://community.topcoder.com/contest/classes/PopsEdit/PopsEdit.jar) is a standalone plugin.\n     * Standard Editor's highlighting may not work. It seems it is caused by some bug of CodeProcessor.\n     * Use FileEdit if you known what happens.\n   *  Use 'rbprocessor.RbProcessor' as the CodeProcessor.\n4. Write `$HOME/.config/rbprocessor.rb` or `$HOME/.rbprocessor.rb`.\n \n\nrbprocessor.rb\n==============\n\nLocation\n--------\n`rbprocessor.rb` can be located at:\n\n* $PWD/rbprocessor.rb\n* $HOME/.config/rbprocessor.rb\n* $HOME/.rbprocessor.rb\n\nOther location is possible by editing `contestapplet.conf`, see below.\n\nBuiltin\n-------\nIf RbProcessor can not find any of above files, a builtin script will be used.\n\nNote: the builtin script is still a working-in-progress, may contain bugs.\n\nThe builtin script does:\n\n* Code templates for C++, C#, Java and VB\n    * Append problem description to code automatically. This can be disabled by\n      `NO_PROBLEMDESC=true`\n* Test code templates for C++, C#, Java and VB\n    * Colorful output by default, can be disabled by `USE_COLOR=false`\n* [Fileedit](http://community.topcoder.com/contest/classes/FileEdit/FileEdit.htm)-like external editor support\n    * Can be disabled by `NO_CODE_DIR=true`. Do this if you use internal\n      editor.\n    * Code will be saved to `/tmp/tc/` by default, can be changed by `CODE_DIR`\n      environment variable.\n    * Do not overwrite code by default, set `CODE_OVERWRITE=true` to\n      always overwrite external code.\n* Postprocessor code (remove code between $BEGINCUT$ and $ENDCUT$)\n\nIt is recommended to read [the source](/quark-zju/rbprocessor/blob/master/lib/rbprocessor.rb) to see how it works.\n\n\nReload\n------\n`rbprocessor.rb` will be reloaded on the fly if change detected.\n\nContent\n------\n`rbprocessor.rb` is Ruby 1.9 script, and should have two methods:\n\n```ruby\ndef preprocess(src, lang, prob, render)\n    # $src, $lang, $prob, $render are available too\n\n    # Makes $HELLO$ tag available\n    user_tags     = { hello: 'world' }\n\n    # If you want to use FileEdit's code template,\n    # set processed_src to ''\n    processed_src = \"main() {\\n\\n}\"\n\n    [processed_src, user_tags]\nend\n\ndef postprocess(src, lang)\n    processed_src = src.gsub(/^\\s+$/, '')\n\n    # postprocess only process code, no user tags\n    processed_src\nend\n```\n\nSee [CodeProcess Documentation](http://community.topcoder.com/contest/classes/CodeProcessor/How%20to%20use%20CodeProcessor%20v2.htm) for details.\n\n\ncontestapplet.conf\n==================\nYou can change some options by editing this file:\n\n* `rbprocessor.scriptpath=/path/to/rbprocessor.rb`: Load `rbprocessor.rb` from alternative path.\n* `rbprocessor.poweredby=false`: Hide \"Powered by\" line.\n* `rbprocessor.debug=true`: Print debug messages to stderr.\n\n\nDependencies\n============\nCommon\n------\n* Java 1.7\n* Topcoder Arena 6.5\n\nUse\n---\n* CodeProcessor Arena plug-in\n\nBuild\n-----\n* JRuby 1.7 jruby-complete.jar\n\n\nBuilding from Source\n====================\n`make` and you will get `rbprocessor.jar`. \n\nLinks in `Makefile` may expire, in that case you may need to manually find `jruby-complete.jar` and `ContestApplet.jar`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquark-zju%2Frbprocessor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquark-zju%2Frbprocessor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquark-zju%2Frbprocessor/lists"}