{"id":13646439,"url":"https://github.com/dgutov/robe","last_synced_at":"2025-05-15T11:08:28.357Z","repository":{"id":5515367,"uuid":"6716428","full_name":"dgutov/robe","owner":"dgutov","description":"Code navigation, documentation lookup and completion for Ruby","archived":false,"fork":false,"pushed_at":"2025-02-19T19:43:41.000Z","size":648,"stargazers_count":586,"open_issues_count":16,"forks_count":38,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-05-12T05:02:42.276Z","etag":null,"topics":["code-assist-tool","code-completion","emacs","emacs-lisp","ruby"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","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/dgutov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"github":"dgutov"}},"created_at":"2012-11-16T04:34:12.000Z","updated_at":"2025-04-21T08:20:18.000Z","dependencies_parsed_at":"2024-01-14T10:00:08.123Z","dependency_job_id":"1e6e4814-ec9e-4f04-b16f-fb4632a5ccf2","html_url":"https://github.com/dgutov/robe","commit_stats":{"total_commits":650,"total_committers":18,"mean_commits":"36.111111111111114","dds":"0.11384615384615382","last_synced_commit":"6bc8a07fc483407971de0966d367a11006b3ab80"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgutov%2Frobe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgutov%2Frobe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgutov%2Frobe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgutov%2Frobe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgutov","download_url":"https://codeload.github.com/dgutov/robe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328385,"owners_count":22052632,"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":["code-assist-tool","code-completion","emacs","emacs-lisp","ruby"],"created_at":"2024-08-02T01:02:55.681Z","updated_at":"2025-05-15T11:08:28.335Z","avatar_url":"https://github.com/dgutov.png","language":"Emacs Lisp","readme":"# Robe [![Build Status](https://github.com/dgutov/robe/actions/workflows/ci.yml/badge.svg)](https://github.com/dgutov/robe/actions/workflows/ci.yml) [![MELPA](http://melpa.org/packages/robe-badge.svg)](http://melpa.org/#/robe)\n\nRobe is a code assistance tool that uses a Ruby REPL subprocess with\nyour application or gem code loaded, to provide information about\nloaded classes and modules, and where each method is defined.\n\nGenerally, you'll want to start with `M-x inf-ruby-console-auto` or\nwith `M-x robe-start` (which will offer to call the former function as\nwell if there is no Ruby console running). Some interactive commands\nprovided by Robe will also offer to launch it first.\n\nThe exceptions are code completion and eldoc, which only work if the\nserver is already running. To launch it, type `M-x robe-start`.\n\nAs you change the code in your project, you'll want to update the\nrunning process. To load the current file, type \u003ckbd\u003eC-c C-l\u003c/kbd\u003e\n(`ruby-load-file`), see [inf-ruby](https://github.com/nonsequitur/inf-ruby/)\nfor more commands. When you're working on a Rails project, you can\ntype \u003ckbd\u003eC-c C-k\u003c/kbd\u003e instead to reload the whole environment at once.\n\n## Features\n\n* Jump to method definition\n* Jump to `super` or a constructor called at point\n* Jump to a module/class/constant definition\n* Display method documentation\n* Display information about method called at point using ElDoc\n* Method and constant name completion\n* Jumping and completion for instance and local variable names, using\n  simple regexp search in the current file\n\nTo see the available commands, type \u003ckbd\u003eM-x describe-package RET robe RET\u003c/kbd\u003e.\n\n## Details\n\nWhen performing one of the commands defined here, we either need to\nnarrow the method name at point down to a specific method in a specific\nmodule, or enumerate the possible method names or constants allowed at\npoint (for code completion).\n\nTo do that, we look at the contents of the buffer, and the context at\npoint: in which method it is, of which class, and if it's in singleton\nclass context. Then we look at the method call at point.\n\nIf the method call target is implicit (there's no target or the method\nis `super`), or the call target is obvious (`Foo.new`, `self.foo`),\nthen we first try to look for the definition in the inheritance\nhierarchy of the target class. Otherwise, or if the initial search\nyields no result, scan all defined classes and modules.\n\nDepending on the command, if the result is ambiguous, you're either\nprompted to resolve the ambiguity manually, or the results are merged\ntogether.\n\n## Install\n\nSet up [MELPA](https://melpa.org/#/getting-started) if you haven't already,\nthen type \u003ckbd\u003eM-x package-install RET robe RET\u003c/kbd\u003e.\n\nIn the init file:\n\n```emacs\n(add-hook 'ruby-mode-hook 'robe-mode)\n(add-hook 'ruby-ts-mode-hook 'robe-mode)\n```\n\nor\n\n```emacs\n(global-robe-mode)\n```\n\n## Dependencies\n\n* `pry` \u003e= 0.10\n* `pry-doc` \u003e= 0.6.0 (for stdlib docs on MRI; optional)\n* Ruby [must be](https://github.com/dgutov/robe/issues/148) compiled\n  with Readline support ([how to\n  check](https://github.com/dgutov/robe/wiki/How-to-check-that-Ruby-is-built-with-Readline-support)).\n* With Ruby 3.3, the gem `readline-ext` is [also\n  needed](https://github.com/dgutov/robe/issues/147).\n\nThe alternative to the last two items is to configure the app not to\nuse the Pry shell (at least when inside Emacs) while still keeping\n`pry` available for loading.\n\nNote that if your project is using `Bundler`, all dependencies have to be in the `Gemfile`.\n\n## Completion\n\n### [company-mode](https://company-mode.github.io/) ([screenshot](screenshots/company-robe.png)):\n\n```emacs\n(eval-after-load 'company\n  '(push 'company-robe company-backends))\n```\n\nBuilt-in completion (triggered with \u003ckbd\u003eC-M-i\u003c/kbd\u003e) is also supported,\nno extra setup required.\n\nBoth of the above work only when the connection to the Ruby subprocess has\nbeen established. To do that, either use one of the core Robe commands, or\ntype \u003ckbd\u003eM-x robe-start\u003c/kbd\u003e.\n\n## Integration with rvm.el\n\n[rvm.el](https://github.com/senny/rvm.el) may not have activated the\ncorrect project Ruby before `robe-start` runs.\n\nEither manually run \u003ckbd\u003eM-x rvm-activate-corresponding-ruby\u003c/kbd\u003e\nbefore starting Robe, or advise `inf-ruby-console-auto` to activate\nrvm automatically.\n\n```emacs\n(advice-add 'inf-ruby-console-auto :before #'rvm-activate-corresponding-ruby)\n```\n\n## Compatibility\n\n* Tested in Emacs 27.1+, with Ruby 2.3-3.4, on GNU/Linux.\n* But see the section [Dependencies](#dependencies) above.\n* Essential features work with JRuby, though the startup is longer.\n* Mostly works on MS Windows, with minor glitches.\n* Built-in `ruby-mode` or `ruby-ts-mode` (Emacs 29+) work best,\n  `enh-ruby-mode` is not recommended (it breaks the detection of the\n  current context, see [#47](https://github.com/dgutov/robe/issues/47)\n  and\n  [enhanced-ruby-mode#96](https://github.com/zenspider/enhanced-ruby-mode/issues/96)).\n\n## Notes\n\n* We can't jump to methods defined in C (such as most of the core classes).\n  To read their docs, install `pry-doc` or add it to your Gemfile.\n* We can't jump to lazily defined methods, such as `model.column` or `find_by_`\n  `ActiveRecord` methods, before they've been called. This is treatable, but low\n  priority.\n* Jumping to methods defined with `Module#delegate` just brings us to the place\n  where `delegate` is called, which is accurate, but often less than useful.\n* To work on several projects in the same Emacs session, you'll have\n  to create the Ruby console for each project after the first one\n  manually with `M-x inf-ruby-console-auto`. Otherwise, the first one\n  will be used for all Ruby files, with suboptimal results.\n* We may get the context wrong for code inside a block if the method\n  it's passed to uses `instance_eval` or `instance_exec`.\n\n## TODO\n\n* Handle `delegate` and `send`, `Class.new.method` and `self.class.method`.\n* For methods defined through macros, optionally jump to where the macro was\n  called, instead of its definition?\n* Apropos search for classes and methods.\n* Better type inference.\n\n## Copying\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 3, or (at your option)\nany later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with GNU Emacs; see the file COPYING.  If not, write to the\nFree Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\nBoston, MA 02110-1301, USA.\n","funding_links":["https://github.com/sponsors/dgutov"],"categories":["Emacs Lisp"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgutov%2Frobe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgutov%2Frobe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgutov%2Frobe/lists"}