{"id":21456256,"url":"https://github.com/anowell/servur-ruby","last_synced_at":"2025-03-17T03:26:13.488Z","repository":{"id":27036082,"uuid":"30501096","full_name":"anowell/servur-ruby","owner":"anowell","description":"Runs arbitrary ruby libraries behind a simple web server","archived":false,"fork":false,"pushed_at":"2015-02-16T07:38:31.000Z","size":160,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T13:14:42.652Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anowell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-08T18:37:50.000Z","updated_at":"2015-02-16T07:38:33.000Z","dependencies_parsed_at":"2022-09-01T02:01:42.030Z","dependency_job_id":null,"html_url":"https://github.com/anowell/servur-ruby","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anowell%2Fservur-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anowell%2Fservur-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anowell%2Fservur-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anowell%2Fservur-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anowell","download_url":"https://codeload.github.com/anowell/servur-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243966863,"owners_count":20376134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-23T05:14:57.028Z","updated_at":"2025-03-17T03:26:13.469Z","avatar_url":"https://github.com/anowell.png","language":"Ruby","readme":"# servur-ruby\nProof-of-concept ruby runner for [servur](https://github.com/anowell/servur)\n\n# Basic idea\n\n- Servur is a simple web service in a container that takes data POSTed to /data and hands it to a \"runner\" as stdin\n- arunner.rb is a ruby implementation of a \"runner\" that does some basic transformation of stdin data and calls any arbitrary ruby \"executor\" with it\n- A ruby \"executor\" is any class that implements `self.execute(input)`\n  - the filename should currently be the snake_case name of the class which should be CamelCased\n  - `input` is currently a ruby Hash for JSON data, otherwise simply a raw string\n\n# Usage\n\nTo run the [anowell/servur-ruby](https://registry.hub.docker.com/u/anowell/servur-ruby/) docker image, you must bind mount an executor to /home/arunner/executor/ and set EXEC_NAME\n\n    $ export EXEC_NAME=count_by_letter\n    $ docker run -p 8080:8080 -e EXEC_NAME -v `pwd`/examples/$EXEC_NAME:/home/arunner/executor:ro anowell/servur-ruby\n    $ curl -s localhost:8080/data -XPOST -d\"hello world\"\n    /bin/arunner.rb output: ----- Executor Output -----\n    {\"h\"=\u003e1, \"e\"=\u003e1, \"l\"=\u003e3, \"o\"=\u003e2, \"w\"=\u003e1, \"r\"=\u003e1, \"d\"=\u003e1}\n\nAny dependencies specified in a Gemfile will be installed when the container first starts. See [build_stem_set](examples/build_stem_set) for an example with dependencies.\n\n# Testing standalone\n\nPut an example in the executor directory (relative to cwd), set EXEC_NAME, and pipe data into arunner.rb\n\n    $ ln -s examples/count_by_letter executor\n    $ echo \"hello world\" | EXEC_NAME=\"count_by_letter\" ./arunner.rb\n    ----- Executor Output -----\n    {\"h\"=\u003e1, \"e\"=\u003e1, \"l\"=\u003e3, \"o\"=\u003e2, \"w\"=\u003e1, \"r\"=\u003e1, \"d\"=\u003e1}\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanowell%2Fservur-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanowell%2Fservur-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanowell%2Fservur-ruby/lists"}