A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/nonsequitur/inf-ruby below:

GitHub - nonsequitur/inf-ruby

inf-ruby provides a REPL buffer connected to a Ruby subprocess.

package.el is the built-in package manager in Emacs 24+. On Emacs 23 you will need to get package.el yourself if you wish to use it.

inf-ruby is available on both major package.el community maintained repos: Marmalade and MELPA.

If you're not already using one of them, follow their installation instructions: Marmalade, MELPA.

And then you can install inf-ruby with the following command:

M-x package-install [RET] inf-ruby [RET]

or by adding this bit of Emacs Lisp code to your Emacs initialization file (.emacs or init.el):

(unless (package-installed-p 'inf-ruby)
  (package-install 'inf-ruby))

If the installation doesn't work try refreshing the package list:

M-x package-refresh-contents [RET]

el-get is another popular package manager for Emacs. If you're an el-get user just do M-x el-get-install.

If you're installing manually, you'll need to:

(autoload 'inf-ruby-minor-mode "inf-ruby" "Run an inferior Ruby process" t)
(add-hook 'ruby-mode-hook 'inf-ruby-minor-mode)

Or, for enh-ruby-mode:

(add-hook 'enh-ruby-mode-hook 'inf-ruby-minor-mode)

Installation via package.el interface does the above for you automatically.

Additionally, consider adding

(add-hook 'compilation-filter-hook 'inf-ruby-auto-enter)

or

(add-hook 'compilation-filter-hook 'inf-ruby-auto-enter-and-focus)

to your init file to automatically switch from common Ruby compilation modes to interact with a debugger. The latter snippet will also select the compilation window and move point to the breakpoint prompt.

If you wish to add other interpreter prompt patterns, see the description in the wiki.

inf-ruby comes bundled in Emacs Prelude. If you're a Prelude user you can start using it right away.

A simple IRB process can be fired up with M-x inf-ruby.

To launch a REPL with project-specific console instead, type M-x inf-ruby-console-auto. It recognizes several project types, including Rails, gems and anything with racksh in their Gemfile.

To run the project specific console in a Docker (or Podman or other) container, or in another shell or host, set inf-mode-wrapper-command which will be passed to format to produce the command for launching the console, so it must include %s. For instance, one can add the following to a .dir-locals.el file at the root of a project:

((ruby-mode . ((inf-ruby-wrapper-command . "docker exec -i container_name %s"))))

When entered, this mode runs comint-mode-hook and inf-ruby-mode-hook (in that order).

To see the list of the keybindings defined by inf-ruby-minor-mode, type M-x describe-function [RET] inf-ruby-minor-mode [RET].

IRB.conf[:USE_MULTILINE] = false if ENV['INSIDE_EMACS']
IRB.conf[:USE_READLINE] = false if ENV['INSIDE_EMACS']

For most projects that inf-ruby-console-auto can recognize, we try to apply this flag automatically (using command line arguments rather than .irbrc), but some cases remain where the users will have to do it manually.

IRB 1.2.x broke the --noreadline support (#137, IRB#127). Upgrade to IRB 1.3.0 or newer for better experience.

Please report problems at http://github.com/nonsequitur/inf-ruby/issues.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4