Git Product home page Git Product logo

inf-ruby's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inf-ruby's Issues

Emacs 25 hangs on indented end

Emacs 25 (either pretest or current master; Emacs 24.5 works fine)
inf-ruby 2.4.0

Reproduction steps:

Start a Ruby shell with M-x inf-ruby, then enter the following code:

irb(main):001:0> class Foo
irb(main):002:1>   def bar
irb(main):003:2>     5
irb(main):004:2>   en

When hitting d there, Emacs freezes. Backtrace after toggle-debug-on-quit:

Debugger entered--Lisp error: (quit)
  forward-comment(100)
  ruby-smie--implicit-semi-p()
  #[nil "`^X\304`[!\210^H\305 V\203^[^@\306 \203^[^@\307\310w\210\311\202\351^@$
  smie-next-sexp(#[nil "`^X\304`[!\210^H\305 V\203^[^@\306 \203^[^@\307\310w\21$
  smie-backward-sexp(halfsexp)
  smie-forward-sexp-command(-1)
  forward-sexp(-1)
  blink-matching-open()
  smie-blink-matching-open()
  self-insert-command(1)
  funcall-interactively(self-insert-command 1)
  call-interactively(self-insert-command nil nil)
  command-execute(self-insert-command)

This seems to be related to commit dbfbedd3 in Emacs.

How to integrate with rbenv?

I use rbenv to manage Ruby versions, and add eval "$(rbenv init -)" in .zshrc, however, Emacs does not read .zshrc when starting. As a result, inf-ruby uses wrong irb. How to solve this problem?

Process ruby segmentation fault with rvm and ruby >= 2.2.1

M-x rvm-use
Ruby Version: 2.2.3
Gemset: <RET>
Ruby: 2.2.3 Gemset:
M-x inf-ruby
Process ruby segmentation fault (core dumped)

This is the same for Ruby 2.2.2 and 2.2.1
It works only for Ruby 2.2.0

irb(main):001:0> RUBY_VERSION
=> "2.2.0"

It works for Ruby 2.1.5 too.
This in turn breaks rspec-mode because the Ruby interpreter can't start.

M-x package-list-packages
inf-ruby     Version: 20150926.1454
rvm          Version: 20150402.742


GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2014-02-22 on king, modified by Debian

Autoloading failed to define function inf-ruby-minor-mode

Error output from $ emacs --debug-init

Debugger entered--Lisp error: (error "Autoloading failed to define function inf-ruby-minor-mode")
  inf-ruby-minor-mode()
  run-hooks(change-major-mode-after-body-hook prog-mode-hook ruby-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook ruby-mode-hook))
  run-mode-hooks(ruby-mode-hook)
  ruby-mode()
  set-auto-mode-0(ruby-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer test.rb> "~/Code/learning/Ruby/test.rb" nil nil "~/Code/learning/Ruby/test.rb" (9475081 2056))
  find-file-noselect("~/Code/learning/Ruby/test.rb" nil nil nil)
  find-file("~/Code/learning/Ruby/test.rb")
  eval-buffer(#<buffer  *load*-935289> nil "/home/stardiviner/.emacs.d/init/init-my-startup.el" nil t)  ; Reading at buffer position 4868
  load-with-code-conversion("/home/stardiviner/.emacs.d/init/init-my-startup.el" "/home/stardiviner/.emacs.d/init/init-my-startup.el" nil t)
  require(init-my-startup)
  eval-buffer(#<buffer  *load*> nil "/home/stardiviner/.emacs.d/init.el" nil t)  ; Reading at buffer position 5606
  load-with-code-conversion("/home/stardiviner/.emacs.d/init.el" "/home/stardiviner/.emacs.d/init.el" t t)
  load("/home/stardiviner/.emacs.d/init" t t)
  #[0 "�\205\262

And my Emacs version GNU Emacs 24.3.50.1 (Which is an emacs-snapshot PPA source for Ubuntu)

And here is my init-ruby settings:

(require 'ruby-mode)

;; Stupidly the non-bundled ruby-mode isn't a derived mode of
;; prog-mode: we run the latter's hooks anyway in that case.
(add-hook 'ruby-mode-hook
          (lambda ()
            (unless (derived-mode-p 'prog-mode)
              (run-hooks 'prog-mode-hook))

            ;; TODO: modify those colors.
            ;; Words prefixed with $ are global variables,
            ;; prefixed with @ are instance variables.
            (modify-syntax-entry ?$ "w") ; global variable
            (modify-syntax-entry ?@ "w") ; instance variable
            ;; FIXME: (modify-syntax-entry ?@@ "w") ; class variable
            (modify-syntax-entry ?? "w")
            (modify-syntax-entry ?! "w")
            (modify-syntax-entry ?: ".")

            (define-key ruby-mode-map (kbd "RET") 'reindent-then-newline-and-indent)
            ;; (define-key ruby-mode-map (kbd "TAB") 'indent-for-tab-command)

            (define-key ruby-mode-map (kbd "C-.") 'insert-arrow)

            ;; hs-minor-mode
            (add-to-list 'hs-special-modes-alist
                         '(ruby-mode
                           "\\(class\\|def\\|do\\|if\\)" "\\(end\\)" "#"
                           (lambda (arg) (ruby-end-of-block)) nil))

            (electric-indent-local-mode 1)
            (setq ruby-deep-indent-paren '(?\( ?\[ ?\] t)
                  ruby-deep-indent-paren-style 'space)
            ))


;;; [ yari ] -- Yet Another Ri Interface
;; yari.el provides an Emacs frontend to Ruby's `ri' documentation tool. It offers lookup and completion.
(require 'yari)

(dolist (hook '(ruby-mode-hook
                ))
  (add-hook hook (lambda ()
                   (setq yari-ri-program-name "ri")

                   ;; (local-set-key (kbd "C-h d") 'yari)
                   ;; or with my-help-document-prefix-map prefix.
                   (define-key my-help-document-prefix-map (kbd "d") 'yari)
                   (define-key my-help-document-prefix-map (kbd "D") 'yari-helm)
                   )))

;;; [ inf-ruby / Inferior Ruby ]

(autoload 'inf-ruby-minor-mode "inf-ruby" "Run an inferior Ruby process" t)
(eval-after-load 'ruby-mode
  '(add-hook 'ruby-mode-hook 'inf-ruby-minor-mode))
(autoload 'inf-ruby-setup-keybindings "inf-ruby" "" t)
(eval-after-load 'ruby-mode
  '(add-hook 'ruby-mode-hook 'inf-ruby-setup-keybindings))

;; to your init file to easily switch from common Ruby compilation modes to
;; interact with a debugger.
(add-hook 'after-init-hook 'inf-ruby-switch-setup)

(setq inf-ruby-default-implementation "pry"
      ;; inf-ruby-implementations '(("ruby" . "irb --inf-ruby-mode -r irb/completion")
      ;;                            ("pry"  . "pry")
      ;;                            ("jruby" . "jruby -S irb -r irb/completion")
      ;;                            ("rubinius" . "rbx -r irb/completion")
      ;;                            ("yarv" . "irb1.9 --inf-ruby-mode -r irb/completion")
      ;;                            ("macruby" . "macirb -r irb/completion"))
      ;; inf-ruby-prompt-format
      )

;; integrate with rvm.el
(defadvice inf-ruby-console-auto (before activate-rvm-for-robe activate)
  (rvm-activate-corresponding-ruby))

;;; Generally, you'll want to start with `M-x inf-ruby-console-auto'. If there's
;;; no Ruby console running, most interactive commands provided by Robe will
;;; offer to launch it automatically.
(inf-ruby)
;; FIXME: (inf-ruby-console-auto)


;;; [ ac-inf-ruby ]

;; (require 'ac-inf-ruby)

;; ;;; for Ruby buffers. {Ruby}
;; (add-hook 'ruby-mode-hook
;;           (lambda ()
;;             (eval-after-load 'auto-complete
;;               (add-to-list 'ac-sources 'ac-source-inf-ruby))
;;             (add-hook 'inf-ruby-minor-mode-hook 'ac-inf-ruby-enable)
;;             ))

;; ;;; for inf-ruby buffer. (Inf-Ruby)
;; (eval-after-load 'auto-complete
;;   (add-to-list 'ac-modes 'inf-ruby-mode))
;; (add-hook 'inf-ruby-mode-hook 'ac-inf-ruby-enable)
;; (eval-after-load 'inf-ruby
;;   (define-key inf-ruby-mode-map (kbd "TAB") 'auto-complete))


;;; [ auto-complete-ruby ]

(require 'auto-complete-ruby)


;;; [ Robe ] -- Code navigation, documentation lookup and completion for Ruby.

(require 'robe)

(add-hook 'ruby-mode-hook 'robe-mode)

(eval-after-load 'robe
  (robe-start))

;;; [ completion ]

;;; for auto-complete
(add-hook 'robe-mode-hook
          (lambda ()
            (ac-robe-setup)
            (add-to-list 'ac-sources 'ac-source-robe)

            ;;; color for auto-complete candidate.
            ;; (set-face-attribute 'ac-??? )
            ))

;;; for company-mode
;; (push 'company-robe company-backends)

;;; [ ruby-compilation ]

;; FIXME: I require 'ruby-compilation, will lead ruby-compilation bind [p] key to (previous-error-no-select) directly. from Emacs default code `simple.el'.
(add-hook 'ruby-mode-hook
          (lambda ()
            (require 'ruby-compilation)
            ))


;;; [ ruby-block ]

(require 'ruby-block)

(setq ruby-block-delay 0)
(setq ruby-block-highlight-toggle t)
(ruby-block-mode t)

;;; [ ruby-electric ]

(require 'ruby-electric)

(add-hook 'ruby-mode-hook
          (lambda ()
            (autopair-mode -1) ; conflict with ruby-electric.
            ))

;;; [ rvm ] -- integrates Emacs with the rvm (Ruby Version Manager)

(require 'rvm)
(autoload 'rvm "rvm" "RVM" t)

(rvm-use-default)        ; use rvm's default ruby for the current Emacs session.

;; (add-hook 'ruby-mode-hook
;;        (lambda () (rvm-activate-corresponding-ruby)))

;;; [ Rinari ] -- A Ruby on Rails minor mode for Emacs

(require 'rinari)

(add-hook 'rinari-minor-mode-hook
          '(lambda ()
             (setq yas-extra-modes (cons 'rails-mode yas-extra-modes))))

(setq rinari-tags-file-name "TAGS")

(global-rinari-mode t)

;; (add-hook 'ruby-mode-hook
;;           (lambda ()
;;             (defadvice ruby-mode-set-encoding
;;                 (around ruby-mode-set-encoding-disable activate) nil)))


(define-key rinari-minor-mode-map (kbd "C-.") 'insert-arrow)


;;; [ projectile-rails ]

;;; Usage:
;;; - <prefix> -> [C-c r] + [key]

(require 'projectile-rails)

(setq projectile-rails-add-keywords t)  ; highlight rails keywords.
(setq projectile-rails-expand-snippet t) ; yasnippet expand skeleton class snippet.

(add-hook 'projectile-mode-hook 'projectile-rails-on)

Inf-ruby-console-auto always fails with missing rake gem error

I try to run inf-ruby-console-auto in my .rb file inside rails application, which is set upon rvm and .ruby-gemset and .ruby-version files are in root directory. I'm getting an error:

Could not find rake-11.1.2 in any of the sources
Run `bundle install` to install missing gems.

Process rails exited abnormally with code 7

But I installed rake, and in terminal in that directory I do able to run bundle exec rails c successfully. I found error that looks as mine only in that blog post, but since I know no chinese, all I get is using rvm.el - which I tried by invoking rvm-activate-corresponding-ruby that looks like set mine ruby and gemset version correctly, but invoking inf-ruby-console-auto after does not fixes mine problem with missing rake gem.

What am I doing wrongly, someone had the same issue?

Prompt is not read-only

I noticed that the inf-ruby REPL prompt is editable (as opposed to read-only), which is kind of problematic. For instance - if you delete something from the prompt and press RET, the REPL gets confused that it's dealing with an incomplete expression:

screen shot 2013-11-08 at 9 04 34 pm

inf-ruby discards first possible completion when tab-completing

Hi!

In inf-ruby.el, inf-ruby-completions contains the line:

(setq completions (cdr (butlast (split-string kept "\r?\n") 2)))

which seems to strip out the first completion for me. For example, if I tab-complete "Kernel::=" in the ruby buffer, I get:

Possible completions are:
Kernel::===
Kernel::=~

Whereas if the line is changed to:

(setq completions (butlast (split-string kept "\r?\n") 2))

I get:

Possible completions are:
Kernel::==
Kernel::===
Kernel::=~

Is there usually a garbage line at the top of [kept] that I'm not getting for some reason?


Linux 2.6.32-38-server #83-Ubuntu SMP Wed Jan 4 11:26:59 UTC 2012 x86_64 GNU/Linux
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
irb 0.9.5(05/04/13)

Default Rails environment setting?

I wish there was a way to always force development rails environment selection, for there to be a setting for such default environment. Is there a way to do that somehow and I missing it?

Searching for program: no such file or directory, irb

I install ruby by rbenv.Then irb path is ~/.rbenv/shims/irb.So the inf-ruby can find the irb(This is my guess).

When I want fire up inf-ruby in emacs,it gives me the error" Searching for program: no such file or directory, irb".

How to fix it?

Missing tags for latest version

Please can you tag the recent releases? Without version tags, MELPA Stable won't build stable packages of the corresponding code.

installation via el-get results in warnings

installation via el-get results in warnings:

Warning (emacs): `inf-ruby-setup-keybindings' is deprecated, please don't use it anymore.
Warning (emacs): If you're using `inf-ruby' from Git, please look up the new usage instructions.

This is with 2.3.2.

Leading line garbage with Pry

If I tell inf-ruby to use Pry as Ruby implementation, the very first line I get is ^[[0G[1] pry(main)>. All subsequent ones remain untouched. Looks like ANSI color codes from its startup. I'm using Emacs 24.3.1, Pry 0.1.2, Ruby 2.1.2 and inf-ruby built from Git.

Pry has changed their completion syntax.

Hi, I'm not quite familiar enough with your code (or pry) to offer a fix but here's what I've found:

  • modern versions of pry no longer have build_completion_proc as a method.
  • build_completion_proc is called from inf-ruby here (I think)
  • Simply changing this line from .build_completion_proc( ...) to .call(...) and hoping that it will work somehow, does not work and results in
NoMethodError: undefined method `[]' for #<Pry:0x000000025a6610>

(I was feeling optimistic but not foolhardy enough to jump much further into the pry source code)

  • The commit in pry that seems to contain most of the refactoring of the completion library is here

Using different interpreter OS X

Hi!

I'm a Mac user and want to set up Emacs for Ruby development. Unfortunately inf-ruby activate system's default Ruby version, but I use Ruby installed from Homebrew, located at /usr/local/bin. I tried to set up PATH variable inside ~/.emacs so this dir would be first in the PATH list, but with no luck.
Any ideas how I can change default interpreter?

Best,
Eugene

autoload of minor mode fails

When i try to open a ruby file i get this error:

Debugger entered--Lisp error: (error "Autoloading failed to define function inf-ruby-minor-mode")
  inf-ruby-minor-mode()
  run-hooks(change-major-mode-after-body-hook prog-mode-hook ruby-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook ruby-mode-hook))
  run-mode-hooks(ruby-mode-hook)
  ruby-mode()
  set-auto-mode-0(ruby-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer air_travel.rb> "~/src/Yellowen/iran_mosafer/app/models/permissions/air_travel.rb" nil nil "~/src/Yellowen/iran_mosafer/app/models/permissions/air_travel.rb" (11544041 2051))
  find-file-noselect("/home/lxsameer/src/Yellowen/iran_mosafer/app/models/permissions/air_travel.rb" nil nil)
  ido-file-internal(raise-frame)
  ido-find-file()
  call-interactively(ido-find-file nil nil)

my configuration is like:

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

Upload inf-ruby 2.2.2 to Marmalade repo

Version 2.2.1 there is unusable due to the missing ruby-mode 1.1.0 dependency. I noticed that you've removed the dep, but you haven't updated the package there and since you own it - nobody else can.

Thanks in advance for your help!

Warning when using pry

When I use pry as the backenf for inf-ruby I get a warning after each command:

pry(main)> 'hello'
'hello'
WARNING: terminal is not fully functional
-  (press RETURN)
=> "hello"

M-p skips the first entry in the input ring

Or does it?

It indeed shows not every input, but looks like it's because of inf-ruby-filter-regexp, which throws out 1 and 2-character inputs, which, I think, is more confusing than helpful.

Especially when you're just checking input history function to see how it works.

How about we revert to the default comint-input-filter? It just throws out whitespace.

ruby-program-name is not used

In the definition of run-ruby, the docstring mentions that the ruby-program-name can be changed to run another ruby program than the system default. However, this doesn't seem to be the case. I have done (defvar ruby-program-name "/Users/ke/.rbenv/shims/ruby") at the top of my .emacs file, but when I run run-ruby and type RbConfig.ruby, I am getting "/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby"

There doesn't seem to be any other mention of ruby-program-name in the inf-ruby code.

Switching back to Ruby source from inf

#1 How do I switch from the inf buffer back to the Ruby source buffer?
#2 I have the following in ~/.emacs:

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

Including the following:
(add-hook 'after-init-hook 'inf-ruby-switch-setup)

produces the message:

"symbol's value as variable is void ruby-compilation-mode-map"

Using Emacs 24.3-13 on Fedora 20 (x86_64).

Rails console prompt never shows up on Windows, plain C-c C-s works fine

Upon M-x inf-ruby-console-auto in Rails folder, the following shows up in __rails** buffer

DL is deprecated, please use Fiddle
DL is deprecated, please use Fiddle
Loading development environment (Rails 4.1.6)
Switch to inspect mode.

And that is it. M-x inf-ruby brings up irb console just fine. I'm using GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601) of 2013-03-17 on MARVIN.
I tried to put IRB.conf[:USE_READLINE] = false in ~/.irbrc but that makes no difference.

using inf-ruby with pry hangs emacs in windows

Using inf-ruby on Windows causes an immediate freeze.

Emacs Version: 24.5 (both)
Ruby Version: ruby 2.2.2p95 (2015-04-13 revision 50295) [x64-mingw32].
Windows version installed with the Ruby installer from Ruby website.
Also has DevKit installed.

I have pry set default as follows:

(require 'inf-ruby)
(add-to-list 'inf-ruby-implementations' ("pry". "Pry"))
(setq inf-ruby-default-implementation "pry")

Steps to reproduce:

Open Emacs (runemacs in mingw terminal or runemacs.exe from NTEmacs)

M-x, inf-ruby
(In Pry) puts "Hello"
Emacs should freeze here

Using toggle-debug-on-quit and pressing C-g after freezing produces the following trace:

Debugger entered--Lisp error: (quit)
accept-process-output(#)
comint-send-input()

(comint-send-input nil nil)

ad-Advice-call-interactively(# comint-send-input nil nil)
apply(ad-Advice-call-interactively # (comint-send-input nil nil))
call-interactively(comint-send-input nil nil)
command-execute(comint-send-input)

Using pry from cmd.exe works fine:

cmd.exe:
pry
[1] pry(main)> puts "Hi"
Hi
=> nil

inf-ruby buffer doesn't get response

When I open inf-ruby buffer and switch to it with [C-c C-s].
input puts "hi".
The process doesn't give response with anything.

Is there a way to debug this?

I tried with emacs -Q and emacs -q.
And load inf-ruby.
repeat upper same steps, still no response.

status of inf-ruby

Hi,

Are you the active maintainer of this fork of inf-ruby.el from http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/misc/ ?

There is a lot of confusion due to the various versions floating around. Are you one of the 2 authors involved in the header? Yukihiro Matsumoto, Nobuyoshi Nakada If not, can you update the header with the proper information?

I have a couple of fixes, if you are still actively maintaining it.

Thanks.

inf-ruby-auto-enter on compilation-filter-hook doesn't guarantee disabling read only mode

When I set (add-hook 'compilation-filter-hook #'inf-ruby-auto-enter)
as per the docs in my init and I hit a breakpoint in my compilation buffer,
it properly converts the buffer to inf-ruby-mode, but the buffer
remains read only.

In this scenario if I toggle (inf-ruby-maybe-switch-to-compilation) twice,
the buffer is then writable at the prompt.

This seems to be due to the ordering/execution of all
filter functions that might be set to compilation-filter-hook. If I
solely set this filter at the end of my init it toggles read only correctly:

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

My current solution is to delay the execution of the function until
the next tick within the filter hook:

(add-hook 'compilation-filter-hook
          (lambda ()
            (run-with-idle-timer 0 nil #'inf-ruby-auto-enter)))

Given this slight delay seems to address a possible issue within
inf-ruby-auto-exit
,
I’m wondering if it would be valid to include this similar delay to
the calling of (inf-ruby-switch-from-compilation).

Custom prompt prevents history navigation

Hello.

When running pry with a custom prompt and trying to navigate (M-p, M-n) or search my input history (M-r), I get the following error:

Search failed: "\\(^>> *\\)\\|\\(^(rdb:1) *\\)\\|\\(^(byebug) *\\)\\|\\(^\\(irb([^)]+)\\|\\([[0-9]+] \\)?[Pp]ry ?([^)]+)\\|\\(jruby-\\|JRUBY-\\)?[1-9]\\.[0-9]\\.[0-9]+\\(-?p?[0-9]+\\)?\\|^rbx-head\\) ?[0-9:]* ?> *\\)"

To reproduce, try adding this to your .pryrc:

Pry.config.prompt_name = "test"

I'm usually setting it to File.basename(Dir.pwd) in order to easily differentiate between projects, but it seems that anything other than the default prompt will result in Search failed.

rbenv and "(wrong-type-argument stringp nil)" error

I just switched over to rbenv and something is stopping M-x inf-ruby from starting the REPL. It must be something with my configuration, but I can't see what.

My Ruby setup in Emacs is here and as far as I can tell rbenv is set up pretty normally:

https://github.com/wdenton/.emacs.d/blob/master/setup/setup-ruby.el

(getenv "PATH") shows rbenv the way it should.

When I run M-x inf-ruby (with debugging on) I get this, but I can't figure out where the problem is.

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  expand-file-name(nil)
  inf-ruby-buffer()
  run-ruby("irb --prompt default --noreadline -r irb/completion" "ruby")
  inf-ruby("ruby")
  funcall-interactively(inf-ruby "ruby")
  #<subr call-interactively>(inf-ruby record nil)
  ad-Advice-call-interactively(#<subr call-interactively> inf-ruby record nil)
  apply(ad-Advice-call-interactively #<subr call-interactively> (inf-ruby record nil))
  call-interactively(inf-ruby record nil)
  command-execute(inf-ruby record)
  execute-extended-command(nil "inf-ruby")
  smex-read-and-run(("inf-ruby" "inf-ruby-console-auto" "R" "S" "cd" "5x5" "arp" "S+" "S+3" "S+6" "SAS" "dbx" "dig" "erc" "ert" "eww" "ftp" "gdb" "irc" "jdb" "man" "mpc" "pdb" "pwd" "rsh" "sdb" "xdb" "calc" "diff" "dirs" "ffap" "gnus" "grep" "help" "ielm" "info" "life" "mail" "mpuz" "ping" "pong" "smex" "talk" "term" "undo" "yank" "zone" "align" "chmod" "debug" ...))
  smex()
  funcall-interactively(smex)
  #<subr call-interactively>(smex nil nil)
  ad-Advice-call-interactively(#<subr call-interactively> smex nil nil)
  apply(ad-Advice-call-interactively #<subr call-interactively> (smex nil nil))
  call-interactively(smex nil nil)
  command-execute(smex)


thingatpt

Is it possible that inf-ruby needs this library loaded?

I was trying the autocomplete feature (pressing TAB) and didn't work claiming that Symbol's function definition is void: beginning-of-thing.

I tried emacs -q and loading inf-ruby by load-library and the same until I loaded thingatpt.

Using emacs 24.2.1.

Cheers!

inf-ruby-completions sometimes returns the ruby completion command

Using ac-inf-ruby, I intermittently see a single completion returned from inf-ruby-completions which looks like if defined?(Pry.config) then ... etc. This seems to happen when there are no completions for the given expression.

I'm guessing it's somehow because the process filter which collects the completion output from the inf-ruby buffer is seeing and collecting the sent string, but it's not clear to me why that would be the case, or the best way to fix it. :-/

Multiple irb prompt strings in send-region output

On executing ruby-send-region, the output contains a large number of completely unnecessary irb prompt strings.

image

Check the image for an example.

Kindly advise how to resolve this. Thanks!

Using

  • GNU Emacs 23.3.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.10) of 2013-05-17 on panlong, modified by Debian
  • ruby : (through rvm): ruby-1.9.3-p545 Gemset: global
  • rvm.el : Version: 20140109.319 (Melpa), X-Original-Version: 1.3.0
  • inf-ruby.el : Version: 20140306.1941 (Melpa), X-Original-Version: 2.3.2
  • ruby-mode.el : Version 1.1 (Marmalade)

ruby-send-region fails with pry

In a rinari-console with pry, sending a region from a corresponding ruby buffer results in this error:

[10] pry(main)> 
eval <<'--inf-ruby-1cf02810a66e386e-21114-13173-468487--', IRB.conf[:MAIN_CONTEXT].workspace.binding, "/some/path/rg_data.rb", 37
    customers_table = RGCustomer.arel_table
    orders_table = RGOrder.arel_table

--inf-ruby-1cf02810a66e386e-21114-13173-468487--
[10] pry(main)* NoMethodError: undefined method `workspace' for nil:NilClass
from (pry):10:in `__pry__'
[11] pry(main)> 

I don't have any pry- or irb-specific configuration which might be likely to affect this.

TAB completion does not work in ruby 1.8.7 (irb 0.9.5)

inf-ruby version 2.3.2 from marmalade

While I have no problem on the tab completion with ruby 1.9.x, tab completion shows nothing to complete if I use ruby 1.8.7 (irb 0.9.5).

I dug a bit, and found that in the inf-ruby-completions, IRB::InputCompletor::CompletionProc accept only one argument in ruby 1.8.7 (irb 0.9.5).

ruby 1.8.7 (irb 0.9.5)

irb> s = "text"
irb> c = IRB::InputCompletor::CompletionProc
irb> c.call("s.", "s.")
/home/cinsk/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/irb/completion.rb:37: warning: multiple values for a block parameter (2 for 1)
    from (irb):4
    TypeError: can't convert Array into String
    from /home/cinsk/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/irb/completion.rb:179:in `quote'
    from /home/cinsk/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/irb/completion.rb:179
    from (irb):4:in `call'
    from (irb):4:in `irb_binding'
    from /home/cinsk/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding'
    from /home/cinsk/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/irb/workspace.rb:52
Maybe IRB bug!!

whereas in ruby 1.9.2p180 (irb 0.9.6):

irb> s = "text"
irb> c = IRB::InputCompletor::CompletionProc
irb> c.call("s.", "s.")
=> [nil, nil, nil, "s.eql?", ... ]

Please give some solution about this.

Thanks,

Installing from marmalade claims ruby-mode isn't available

After configuring marmalade as a package source:

M-x package-install inf-ruby

Debugger entered--Lisp error: (error "Package `ruby-mode-1.1' is unavailable")

Probably ought to work with the ruby-mode that comes with Emacs 23. Either that, or ruby-mode should be published on marmalade.

inf-ruby-console-rails should allow for other environments

I had a need to run rails console in test mode to work through an issue in the test environment, but it defaults to development. I created the following for test mode:

(defun inf-ruby-console-rails-test (dir)
  "Run Rails console in DIR."
  (interactive "D")
  (let ((default-directory (file-name-as-directory dir)))
    (run-ruby "rails console test" "rails")))

It seems like it would be better to allow for a prompt for environment, but that's a bit beyond my elisp skills right now.

Completion aborted: Not at a top-level prompt

Hi!

My config is emacs24+win7+ruby187+inf-ruby-20120722

It 's so strange that When I fist Use Tab to complete the code for example: 1.up[tab] it will complete as 1.upto,
then I exec a statement with enter
e.g. 1.upto(9) { |x| print x } and returns the 123456789,
when I type 1.up[tab] again next, It comes wrong with the Warning "Completion aborted: Not at a top-level prompt"
So why ??

pry syntax highlighting/color

Using pry from inf-ruby looks like this:

screen shot 2016-09-28 at 5 38 51 pm

Using pry from iTerm2 looks like this:

screen shot 2016-09-28 at 5 40 14 pm

Is there a way to get pry's syntax highlighting from within inf-ruby?

Here's what my inf-ruby configuration looks like:

(require 'inf-ruby)
(setq inf-ruby-default-implementation "pry")
(add-hook 'inf-ruby-mode-hook
  (function
    (lambda ()
      (setq show-trailing-whitespace nil)
      (linum-mode 0))))

Here's my ~/.pryrc:

Pry.config.correct_indent = false if ENV['INSIDE_EMACS']

Thanks for your help!

Consider adding a basic README

Having a basic README is always a good idea. Some people might not be used to Emacs's tradition of having some documentation in the source code itself :-)

inf-ruby-console-auto not work

I get nothing output in buffer *rails*. (the inf-ruby-console-auto) after executed inf-ruby-console-auto in a Rails file.

I have output in inf-ruby buffer => "robe on".
And I can execute code in inf-ruby. puts "hi".
And I also tested on a new Rails app code demo (generated with rails new demo).

Emacs version: 25.0.50.2
System: Arch Linux
latest version inf-ruby which instaled with el-get.

Consider adding a menu for the minor mode

Although I rarely use menus I think it'd be good if inf-ruby-minor-mode had a menu since it has quite a few interactive commands and Emacs newbies generally search for useful commands in menus. OSX users, in particular, don't disable their menubars, since they gain nothing from that.

I've also filed a bug on emacs-devel, that ruby-mode is one of the few major modes that doesn't define a menu. Ideally we'd nest an inf-ruby menu under an ruby-mode top-level menu.

inf-ruby and variable scope problem

for example, I write :
a = 3

then select it and C-c C-r send it to inf-ruby buffer

then I want to see what in the variable " a " , I type " a " in inf-ruby, but it shows :

"undefined variable or method a in main", why ?

otherwise, " a = 3" in inf -ruby buffer, "def b ;puts a ;end " in ruby file,then send the function to inf-ruby.
executive it,also
"undefined variable or method a in main"

I google and google hours but no answer.I hope you can solve it.

OS: linuxmint 14.1
Machine: ASUS 1015BX netbook
emacs : 24.2 installed from PPA,newest version,
ruby-mode.el.................: installed from ruby src code (/misc/),worked with rvm.el
ruby : 1.9.3 -p362 installed from rvm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.