{"id":46392233,"url":"https://github.com/mrubyedge/sheetruby","last_synced_at":"2026-03-05T09:07:48.065Z","repository":{"id":338768668,"uuid":"1159081799","full_name":"mrubyedge/sheetruby","owner":"mrubyedge","description":"mruby VM in your spreadsheet","archived":false,"fork":false,"pushed_at":"2026-03-01T13:11:07.000Z","size":2246,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-01T14:58:46.983Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrubyedge.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-16T09:43:53.000Z","updated_at":"2026-03-01T13:11:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mrubyedge/sheetruby","commit_stats":null,"previous_names":["mrubyedge/sheetruby"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrubyedge/sheetruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrubyedge%2Fsheetruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrubyedge%2Fsheetruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrubyedge%2Fsheetruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrubyedge%2Fsheetruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrubyedge","download_url":"https://codeload.github.com/mrubyedge/sheetruby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrubyedge%2Fsheetruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30117537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T08:19:04.902Z","status":"ssl_error","status_checked_at":"2026-03-05T08:17:37.148Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":"2026-03-05T09:07:47.616Z","updated_at":"2026-03-05T09:07:48.051Z","avatar_url":"https://github.com/mrubyedge.png","language":"JavaScript","readme":"# sheetruby\n\nRun Ruby code in Google Sheets using [mruby/edge](https://github.com/mrubyedge/mrubyedge)\n\n## What is sheetruby?\n\nsheetruby embeds the [mruby/edge](https://github.com/mrubyedge/mrubyedge) VM into Google Apps Script, allowing you to execute Ruby code directly in your spreadsheets. It compiles to WebAssembly and runs entirely within Google Sheets' Apps Script environment.\n\n## How to Use\n\n1. Open your Google Spreadsheet\n2. Go to **Extensions** → **Apps Script**\n3. Copy the contents of `combined.js` and paste it into the script editor\n4. Save the script\n5. Return to your spreadsheet - the `EVAL_RUBY_SCRIPT()` function is now available!\n\n## `EVAL_RUBY_SCRIPT()` Function Specification\n\n```javascript\nEVAL_RUBY_SCRIPT(ruby_code, [arg1], [arg2], [arg3])\n```\n\n### Parameters\n\n- **First argument (required)**: Ruby script code\n  - Can be a string literal or reference to a cell\n- **Arguments 2-4 (optional)**: Data to pass to the Ruby script\n  - Can reference cells or ranges\n  - Accessible in Ruby as global variables `$arg1`, `$arg2`, `$arg3`\n  - Currently supports up to 3 arguments\n\n### Type Handling\n\n- **Single cell**: Type is automatically inferred (number, string, boolean)\n- **Multiple cells**: Passed as a 2D array (Array of Arrays)\n- **Return value**: Type is automatically inferred from Ruby result via JSON serialization\n\n### Examples\n\n**Basic calculation:**\n```ruby\n=EVAL_RUBY_SCRIPT(\"1 + 2\")\n# =\u003e 3\n```\n\n**Using cell references:**\n```ruby\n=EVAL_RUBY_SCRIPT(\"$arg1 * 2\", A1)\n# If A1 = 21, returns 42\n```\n\n**Array processing:**\n```ruby\n=EVAL_RUBY_SCRIPT(\"$arg1.map { |x| x * $arg2 }\", A1:A3, B1)\n# If A1:A3 = [[1], [2], [3]] and B1 = 10\n# Returns [10, 20, 30]\n```\n\n**Multiple arguments:**\n```ruby\n=EVAL_RUBY_SCRIPT(\"$arg1 + $arg2 + $arg3\", A1, B1, C1)\n# Sum of three cells\n```\n\n**String manipulation:**\n```ruby\n=EVAL_RUBY_SCRIPT(\"$arg1.upcase\", A1)\n# If A1 = \"hello\", returns \"HELLO\"\n```\n\n**Math functions (with mrubyedge-math):**\n```ruby\n=EVAL_RUBY_SCRIPT(\"Math.sqrt($arg1)\", 16)\n# =\u003e 4.0\n```\n\n## Building from Source\n\n### Prerequisites\n\n1. Install [Emscripten SDK](https://emscripten.org/docs/getting_started/downloads.html)\n   ```bash\n   git clone https://github.com/emscripten-core/emsdk.git\n   cd emsdk\n   ./emsdk install latest\n   ./emsdk activate latest\n   source ./emsdk_env.sh\n   ```\n\n2. Install Rust with the `wasm32-unknown-emscripten` target:\n   ```bash\n   rustup target add wasm32-unknown-emscripten\n   ```\n\n3. Set the `BINDGEN_EXTRA_CLANG_ARGS` environment variable:\n   ```bash\n   export BINDGEN_EXTRA_CLANG_ARGS=\"--sysroot=$EMSDK/upstream/emscripten/cache/sysroot\"\n   ```\n\n### Build\n\n```bash\nmake build\n```\n\nThis will generate `combined.js` in the project root.\n\n## Contributing\n\nBug reports and contributions are welcome! Please feel free to:\n\n- Report issues on [GitHub Issues](https://github.com/mrubyedge/sheetruby/issues)\n- Submit pull requests\n- Share your use cases and feedback\n\n## License\n\nSee [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrubyedge%2Fsheetruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrubyedge%2Fsheetruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrubyedge%2Fsheetruby/lists"}