{"id":13438861,"url":"https://github.com/syohex/emacs-mruby-test","last_synced_at":"2025-05-06T00:33:21.915Z","repository":{"id":66979272,"uuid":"47500550","full_name":"syohex/emacs-mruby-test","owner":"syohex","description":"Emacs with mruby","archived":false,"fork":false,"pushed_at":"2016-02-20T05:51:40.000Z","size":21,"stargazers_count":29,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-19T12:42:37.239Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/syohex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-06T14:45:51.000Z","updated_at":"2024-01-19T10:20:36.000Z","dependencies_parsed_at":"2023-02-23T15:46:16.345Z","dependency_job_id":null,"html_url":"https://github.com/syohex/emacs-mruby-test","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/syohex%2Femacs-mruby-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syohex%2Femacs-mruby-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syohex%2Femacs-mruby-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syohex%2Femacs-mruby-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syohex","download_url":"https://codeload.github.com/syohex/emacs-mruby-test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252598869,"owners_count":21774310,"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-07-31T03:01:09.064Z","updated_at":"2025-05-06T00:33:21.896Z","avatar_url":"https://github.com/syohex.png","language":"C","readme":"# mruby.el\n\n**This is a test package of dynamic module feature which is implemented in Emacs 25.**\n\nmruby.el provides interface to mruby make interface to embed mruby into go.\n\n\n## Setup\n\nDynamic module feature is implemented only in emacs-25 branch. So you need to build Emacs which enables dynamic module feature.\n\n### Build Emacs\n\n```\n% git clone git://git.savannah.gnu.org/emacs.git\n% cd emacs\n% git checkout -b emacs-25 origin/emacs-25\n% ./configure --with-modules --prefix=installed_path # You must set --with-modules\n% make\n% make install\n```\n\n### Building this plugin\n\n```\n% cd modules\n% git clone --recursive https://github.com/syohex/emacs-mruby-test.git\n% make\n```\n\n\n## Evaluate mruby code\n\n```lisp\n(let ((mrb (mruby-init)))\n  (mruby-eval mrb \"ARGV.map {|x| x + 1}\" 1 2 3))\n;; =\u003e [2 3 4]\n\n\n(let ((mrb (mruby-init)))\n  (mruby-eval mrb\n              \"\ndef fizzbuzz(num)\n  (1..num).map do |n|\n    case\n    when n % 15 == 0 then \\\"fizzbuzz\\\"\n    when n % 5  == 0 then \\\"buzz\\\"\n    when n % 3  == 0 then \\\"fizz\\\"\n    else n\n    end\n  end\nend\n\nfizzbuzz(ARGV[0].to_i)\n\" 20))\n\n;; =\u003e [1 2 \"fizz\" 4 \"buzz\" \"fizz\" 7 8 \"fizz\" \"buzz\" 11 \"fizz\" 13 14 \"fizzbuzz\" 16 17 \"fizz\" 19 \"buzz\"]\n```\n\n\n## Call mruby function for elisp objects\n\n``` lisp\n;; Apply 'Fixnum#abs' for Emacs Lisp integer value\n(let ((mrb (mruby-init)))\n  (mruby-send mrb -10 'abs))\n;; 10\n\n;; Apply 'String#swapcase' for Emacs Lisp string value\n(let ((mrb (mruby-init)))\n  (mruby-send mrb \"hello WORLD\" 'swapcase))\n;; =\u003e \"HELLO world\"\n\n;; Apply 'Array#flatten' for Emacs Lisp vector value\n;; [NOTE] You must use vector instead of list for Ruby Array feature\n(let ((mrb (mruby-init)))\n  (mruby-send mrb [1 [2 3] [4 [5 6]]] 'flatten))\n;; =\u003e '[1 2 3 4 5 6]\n```\n\n\n## License\n\n- This software is released under the GPLv3+.\n- mruby is released under the [MIT License](https://github.com/mruby/mruby/blob/master/MITL).\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyohex%2Femacs-mruby-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyohex%2Femacs-mruby-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyohex%2Femacs-mruby-test/lists"}